From pablog.ubuntu at gmail.com Sat Oct 9 06:42:25 2010 From: pablog.ubuntu at gmail.com (Pablo Castellano) Date: Sat, 09 Oct 2010 15:42:25 +0200 Subject: [Portland] xdg-utils upstream status In-Reply-To: <20100930212446.GL4850@burratino> References: <1247245382.22979.196.camel@shizuru> <87skh4igvr.fsf@windlord.stanford.edu> <1247263238.5814.5.camel@tomoyo> <20090711095845.GE3505@yellowpig> <4A5871DF.5040303@debian.org> <20100629105503.GA2799@burratino> <1285326634.7378.21.camel@siphilis> <20100930212446.GL4850@burratino> Message-ID: <1286631745.1327.54.camel@siphilis> I've tried the script. It has worked well for me with a bit of refining. I'm attaching here my modified version. On Thu, 2010-09-30 at 16:24 -0500, Jonathan Nieder wrote: > Fathi Boudra wrote: > > > ok, let's move to git > > Something like the following should do it. > > Thoughts? Improvements? > > mkdir /tmp/conversion && > cd /tmp/conversion && > apt-get install cvs2svn git && > cat >authors.txt <<\END_AUTHORS_DOT_TXT && > bastian = Waldo Bastian > bryce = Bryce Harrington > cworth = Carl Worth > fabo = Fathi Boudra > jwhite = Jeremy White > krake = Kevin Krammer > llunak = Lubos Lunak > micke = Mikael Hallendal > mr = Mikhail Ramendik > norbertf = Norbert Frese > rdieter = Rex Dieter > whipple = Tom Whipple > importer = cvs2git > END_AUTHORS_DOT_TXT > > cat >portland-git.sh <<\END_PORTLAND_GIT_SCRIPT && > #!/bin/sh > set -e > authors_file=$(pwd)/authors.txt > export authors_file > fetch_cvs () { > rsync -avzP freedesktop.org::cvs/portland . > } > convert_from_cvs () { > git init --bare portland-git.git && > cvs2git --blobfile=/dev/fd/3 --dumpfile=/dev/fd/3 \ > --username=importer --encoding=latin-1 --encoding=utf-8 \ > portland 3>&1 >&2 | > ( > cd portland-git.git && > git fast-import && > git gc --aggressive > ) > } > delete_orig_refs () { > # clean up after filter-branch. > eval "$( > git for-each-ref --shell \ > --format='git update-ref -d %(refname) &&' \ > refs/original && > echo : > )" > } > clean_tags () { > eval "$( > git for-each-ref --shell --format=' > ref=%(refname) && > new_ref=$(echo "$ref" | > sed -e " > s/RELEASE_TP/tmp/ > s/RELEASE_/v/ > s/_BETA_/-beta/ > s/_RC/-rc/ > s/_/./g > " > ) && > echo "$ref -> $new_ref" && > git update-ref -d "$ref" && > git update-ref "$new_ref" %(objectname) && > ' && > echo : > )" > } > clean_repo () { > git filter-branch --env-filter ' > get_name () { > grep "^$1 =" "$authors_file" | > sed "s/^.*= \(.*\) <.*>$/\1/" > } > > get_email () { > grep "^$1 =" "$authors_file" | > sed "s/^.*= .* <\(.*\)>$/\1/" > } > > GIT_AUTHOR_NAME=$(get_name $GIT_COMMITTER_NAME) && > GIT_AUTHOR_EMAIL=$(get_email $GIT_COMMITTER_NAME) && > GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME && > GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL && > export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL && > export GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL > ' -- --all && > delete_orig_refs && > clean_tags && > git gc --aggressive > } > extract_subdir () { > git clone --mirror portland-git.git "$1.git" && > ( > cd $i.git && > git remote rm origin && > git filter-branch --subdirectory-filter "portland/$i" \ > --prune-empty -- --all && > delete_orig_refs > ) > } > fetch_cvs && > convert_from_cvs && > ( cd portland-git.git && clean_repo ) && > for i in dapi-dbus dapi libxdg-vfs xdg-utils > do > extract_subdir $i > done > END_PORTLAND_GIT_SCRIPT > > sh portland-git.sh -- GPG/PGP KeyID: 463F919C available on http://pgpkeys.mit.edu:11371/ Fingerprint: A9CC 7ABA 698F 028B CC7F D885 78F4 4F3A 463F 919C http://www.lainconscienciadepablo.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: portland-git-conversion.sh Type: application/x-shellscript Size: 3788 bytes Desc: not available URL: From jrnieder at gmail.com Fri Oct 22 09:15:50 2010 From: jrnieder at gmail.com (Jonathan Nieder) Date: Fri, 22 Oct 2010 11:15:50 -0500 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <20101022112510.GA8920@arakhar> References: <20100316160157.14422.44232.reportbug@localhost> <4B9FB2C4.3070504@dsv.su.se> <20100628135509.GA12278@burratino> <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> Message-ID: <20101022161550.GG9224@burratino> Jan Braun wrote: > --- /usr/bin/xdg-email 2010-09-15 13:08:29.000000000 +0200 > +++ ./xdg-email 2010-10-22 09:36:13.000000000 +0200 > @@ -354,7 +354,8 @@ > > detectDE() > { > - if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; > + if [ x"$MAILER" != x"" ]; then DE=envvar; > + elif [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; Interesting! I like it. Nitpicks: - I think it would be good to call the envvar XDG_MAILER, because (1) the mailer for use in the console may not be the mailer to use on the desktop, and (2) it would be nice to leave open the possibility of a MAILER variable along the lines of BROWSER with more useful semantics in the future. - What happens if the mailer contains shell metacharacters? See http://lists.freedesktop.org/archives/portland/2010-September/001135.html for a similar attempt (and please feel free to pick and choose what you like from it). From jrnieder at gmail.com Fri Oct 22 22:11:30 2010 From: jrnieder at gmail.com (Jonathan Nieder) Date: Sat, 23 Oct 2010 00:11:30 -0500 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <20101022221330.GA4487@arakhar> References: <20100316160157.14422.44232.reportbug@localhost> <4B9FB2C4.3070504@dsv.su.se> <20100628135509.GA12278@burratino> <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> <20101022161550.GG9224@burratino> <20101022221330.GA4487@arakhar> Message-ID: <20101023051130.GA12800@burratino> Jan Braun wrote: > Also, in the current proposal, the argument list of $MAILER necessarily > starts with "mailto:". If the programs being put in MAILER check that > and fail on unrecognized arguments, we have a way to introduce, up- and > downward-compatibly [...] Ok, I'm convinced. Still in an ideal world there would be a separate XMAILER and MAILER but, well, we're not in an ideal world. :) > *) My approach prefers XDG_MAILER over the desktop environment's idea of > a mailer. I feel that's the proper priority and important to get right. Yes. > *) Quoting, see above. There are two precedents to compare. BROWSER does some wacko thing (actually, I never understood it and I fear different programs have different behavior with shell metacharacters). iirc EDITOR and VISUAL traditionally are passed to the shell somewhat like this: sh -c "$EDITOR \"\$1\"" - filename or within a shell: set -- filename eval "$EDITOR" '"$1"' I wouldn't mind just forbidding shell metacharacters[*] if you prefer that. [*] http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02 From pelle at dsv.su.se Sat Oct 23 04:20:46 2010 From: pelle at dsv.su.se (Per Olofsson) Date: Sat, 23 Oct 2010 13:20:46 +0200 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <20101023051130.GA12800@burratino> References: <20100316160157.14422.44232.reportbug@localhost> <4B9FB2C4.3070504@dsv.su.se> <20100628135509.GA12278@burratino> <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> <20101022161550.GG9224@burratino> <20101022221330.GA4487@arakhar> <20101023051130.GA12800@burratino> Message-ID: <4CC2C50E.3060602@dsv.su.se> Hi, 2010-10-23 07:11, Jonathan Nieder skrev: > >> *) Quoting, see above. > > There are two precedents to compare. BROWSER does some wacko thing > (actually, I never understood it and I fear different programs > have different behavior with shell metacharacters). It substitutes %s if there's a %s in the string. Take a look at /usr/bin/sensible-browser. > iirc EDITOR and > VISUAL traditionally are passed to the shell somewhat like this: > > sh -c "$EDITOR \"\$1\"" - filename > > or within a shell: > > set -- filename > eval "$EDITOR" '"$1"' Again, why not simply $EDITOR "$1" > I wouldn't mind just forbidding shell metacharacters[*] if you prefer > that. > > [*] http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02 Yeah, putting metacharacters in a variable is asking for trouble anyway. -- Pelle From jrnieder at gmail.com Sat Oct 23 15:22:11 2010 From: jrnieder at gmail.com (Jonathan Nieder) Date: Sat, 23 Oct 2010 17:22:11 -0500 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <4CC2C50E.3060602@dsv.su.se> References: <4B9FB2C4.3070504@dsv.su.se> <20100628135509.GA12278@burratino> <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> <20101022161550.GG9224@burratino> <20101022221330.GA4487@arakhar> <20101023051130.GA12800@burratino> <4CC2C50E.3060602@dsv.su.se> Message-ID: <20101023222211.GA21875@burratino> Per Olofsson wrote: > Again, why not simply > > $EDITOR "$1" Because that is a weird hybrid of two behaviors: 1. "$EDITOR" "$1" does not respect shell metacharacters at all, so if you use, e.g., EDITOR='emacs -nw', then it will look for a binary with that name. Advantage: can be used by C programs directly using exec(). 2. sh -c ' "$1"' - filename respects _all_ shell metacharacters, including pipes, variable expansions, redirections etc. 3. $EDITOR "$1" respects only the shell metacharacters that have to do with word splitting (if I remember correctly). It is hard to use from C programs --- I think you have to first export EDITOR, then run sh -c '$EDITOR "$1"' - filename > Yeah, putting metacharacters in a variable is asking for trouble anyway. On e.g. Windows it is common to have filenames with spaces. It can also be convenient to pass options with commands like this. Anyway, luckily it is always possible to get whatever effect is desired with a well-placed script. From pelle at dsv.su.se Sun Oct 24 12:58:36 2010 From: pelle at dsv.su.se (Per Olofsson) Date: Sun, 24 Oct 2010 21:58:36 +0200 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <20101023222211.GA21875@burratino> References: <4B9FB2C4.3070504@dsv.su.se> <20100628135509.GA12278@burratino> <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> <20101022161550.GG9224@burratino> <20101022221330.GA4487@arakhar> <20101023051130.GA12800@burratino> <4CC2C50E.3060602@dsv.su.se> <20101023222211.GA21875@burratino> Message-ID: <4CC48FEC.8080107@dsv.su.se> Hi, 2010-10-24 00:22, Jonathan Nieder skrev: > Per Olofsson wrote: > >> Again, why not simply >> >> $EDITOR "$1" > > Because that is a weird hybrid of two behaviors: > > 1. "$EDITOR" "$1" > > does not respect shell metacharacters at all, so if you use, e.g., > EDITOR='emacs -nw', then it will look for a binary with that name. No good. > Advantage: can be used by C programs directly using exec(). > > 2. sh -c ' "$1"' - filename > > respects _all_ shell metacharacters, including pipes, variable > expansions, redirections etc. It might also leave a shell process hanging around. So maybe sh -c "exec $EDITOR \"\$1\"" - "$filename" ? > > 3. $EDITOR "$1" > > respects only the shell metacharacters that have to do with > word splitting (if I remember correctly). In fact, it seems to only support word splitting. No quotes or anything else. > It is hard to use from > C programs --- I think you have to first export EDITOR, then run > > sh -c '$EDITOR "$1"' - filename OK. So maybe option 2 is the best one then. >> Yeah, putting metacharacters in a variable is asking for trouble anyway. > > On e.g. Windows it is common to have filenames with spaces. It can > also be convenient to pass options with commands like this. > > Anyway, luckily it is always possible to get whatever effect is > desired with a well-placed script. It's nice to be able to say EDITOR="emacs -nw" I think. I'm not sure how important it is to be able to quote spaces and such though. Still, if option 2 is easier to implement from C programs, perhaps it's the best option. -- Pelle From pelle at dsv.su.se Sun Oct 24 14:37:08 2010 From: pelle at dsv.su.se (Per Olofsson) Date: Sun, 24 Oct 2010 23:37:08 +0200 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <20101023222211.GA21875@burratino> References: <4B9FB2C4.3070504@dsv.su.se> <20100628135509.GA12278@burratino> <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> <20101022161550.GG9224@burratino> <20101022221330.GA4487@arakhar> <20101023051130.GA12800@burratino> <4CC2C50E.3060602@dsv.su.se> <20101023222211.GA21875@burratino> Message-ID: <4CC4A704.5010101@dsv.su.se> Hi again, I've applied two patches to the git repo now to add support for $MAILER and fallback to mutt. They're attached. I've attached them; please take a look at them. Thank you for your help! -- Pelle -------------- next part -------------- A non-text attachment was scrubbed... Name: xdg-email-envvar.diff Type: text/x-patch Size: 1197 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: xdg-email-mutt-detect.diff Type: text/x-patch Size: 653 bytes Desc: not available URL: From jrnieder at gmail.com Sun Oct 24 22:44:12 2010 From: jrnieder at gmail.com (Jonathan Nieder) Date: Mon, 25 Oct 2010 00:44:12 -0500 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <4CC4A704.5010101@dsv.su.se> References: <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> <20101022161550.GG9224@burratino> <20101022221330.GA4487@arakhar> <20101023051130.GA12800@burratino> <4CC2C50E.3060602@dsv.su.se> <20101023222211.GA21875@burratino> <4CC4A704.5010101@dsv.su.se> Message-ID: <20101025054412.GA30801@burratino> Per Olofsson wrote: > I've applied two patches to the git repo now to add support for $MAILER > and fallback to mutt. They're attached. Nice. > --- a/scripts/xdg-email > +++ b/scripts/xdg-email > @@ -504,6 +505,23 @@ open_xfce() > fi > } > > +open_envvar() > +{ > + local OLDIFS="$IFS" > + IFS=: > + for i in $MAILER; do This means that to use a mailer command including a colon, one would write something like MAILER='vim -d con$(printf \072)20/30/600/150' The more obvious ?MAILER='vim -d con\:20/30/600/150'? doesn't work --- it splits as (1) con\, (2) 20/30/600/150. I can't see an easier way to cleanly support multiple alternative mailers. I am very happy to have $MAILER working at all, so for what it's worth, I like the patch. From pelle at dsv.su.se Mon Oct 25 01:04:19 2010 From: pelle at dsv.su.se (Per Olofsson) Date: Mon, 25 Oct 2010 10:04:19 +0200 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <20101025054412.GA30801@burratino> References: <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> <20101022161550.GG9224@burratino> <20101022221330.GA4487@arakhar> <20101023051130.GA12800@burratino> <4CC2C50E.3060602@dsv.su.se> <20101023222211.GA21875@burratino> <4CC4A704.5010101@dsv.su.se> <20101025054412.GA30801@burratino> Message-ID: <4CC53A03.8040303@dsv.su.se> 2010-10-25 07:44, Jonathan Nieder skrev: > This means that to use a mailer command including a colon, one would > write something like > > MAILER='vim -d con$(printf \072)20/30/600/150' > > The more obvious ?MAILER='vim -d con\:20/30/600/150'? doesn't work --- > it splits as (1) con\, (2) 20/30/600/150. > > I can't see an easier way to cleanly support multiple alternative > mailers. I am very happy to have $MAILER working at all, so for what > it's worth, I like the patch. > OK, thanks! -- Pelle From janbraun at gmx.de Fri Oct 22 15:13:34 2010 From: janbraun at gmx.de (Jan Braun) Date: Fri, 22 Oct 2010 22:13:34 -0000 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <20101022161550.GG9224@burratino> References: <20100316160157.14422.44232.reportbug@localhost> <4B9FB2C4.3070504@dsv.su.se> <20100628135509.GA12278@burratino> <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> <20101022161550.GG9224@burratino> Message-ID: <20101022221330.GA4487@arakhar> Jonathan Nieder schrob: > Interesting! I like it. Thanks! > Nitpicks: Also thanks! :) > - I think it would be good to call the envvar XDG_MAILER, because > (1) the mailer for use in the console may not be the mailer to > use on the desktop, I considered that, but since there's no XDG_BROWSER and no XDG_EDITOR, I figured there's no point in splitting MAILER/XDG_MAILER. Particularly as switching MUAs is presumably more effort than switching browsers or editors. ($PAGER is useless without a terminal, hence moot here.) Also, $BROWSER does (at least by some programs[1]) get parsed into a list of colon-separated commands which are tried in order until the first one succeeds, this we could do to $MAILER too. I didn't implement that because: a) My shell-fu is not good enough to survive the resulting quoting mess, I'd have to drop (jump?) to haskell/python for that. b) If you really need that functionality, pointing MAILER at a shell script that iterates through the options isn't unreasonable IMHO. But if someone feels the itch to implement it, I'd applaud that. > and (2) it would be nice to leave open the > possibility of a MAILER variable along the lines of BROWSER with > more useful semantics in the future. That's a good point, especially the "passing mail bodies via commandline is a poor idea" argument. But then again, there doesn't seem to be anyone likely to fight XDG over standardization of such things, and my gut reaction was "It's an _old_ problem, no one has suggested anything substantially new for this for over a decade, it just lies there waiting to be implemented, so just give it the obvious name and be done with it." Also, in the current proposal, the argument list of $MAILER necessarily starts with "mailto:". If the programs being put in MAILER check that and fail on unrecognized arguments, we have a way to introduce, up- and downward-compatibly (by falling back to mailto: if necessary), any new protocol we can find a unique name for. (I realize that part was not a particularly compelling argument, and wouldn't further object if you guys felt XDG_MAILER was the more conservative/better approach and went with that. I'm just explaining why I felt, and feel, that grabbing MAILER here and now is reasonable.) > - What happens if the mailer contains shell metacharacters? I'd hope they get expanded, once, by a posix-compatible /bin/sh, but I'm squeamish that way. Your | eval "$XDG_MAILER" '"$@"' looks as if it allows more evi^Wnifty quoting tricks than my mere | $XDG_MAILER "$1" but I think the most important consideration would be to mimic existing BROWSER/EDITOR behavior, assuming there's such a thing. Again, [1]. > See http://lists.freedesktop.org/archives/portland/2010-September/001135.html > for a similar attempt (and please feel free to pick and choose what you > like from it). Thanks, and ditto for my code. A quick sumary of the differences I see: *) My approach prefers XDG_MAILER over the desktop environment's idea of a mailer. I feel that's the proper priority and important to get right. *) Quoting, see above. *) You wrote documentation. Awesome. :) cheers, Jan [1] Anyone know of a good documentation for BROWSER/EDITOR/VISUAL/PAGER? A half-assed web search left me with the feeling that they're "well known", i.e. not truly documented at all. Or possibly there's more info in dead trees. Will have a look again tomorrow or sunday unless one of you beats me to it. *crosses fingers* -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From pelle at dsv.su.se Fri Oct 22 15:19:47 2010 From: pelle at dsv.su.se (Per Olofsson) Date: Fri, 22 Oct 2010 22:19:47 -0000 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <20101022161550.GG9224@burratino> References: <20100316160157.14422.44232.reportbug@localhost> <4B9FB2C4.3070504@dsv.su.se> <20100628135509.GA12278@burratino> <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> <20101022161550.GG9224@burratino> Message-ID: <4CC20E00.6060507@dsv.su.se> Hi, 2010-10-22 18:15, Jonathan Nieder skrev: > - I think it would be good to call the envvar XDG_MAILER, because > (1) the mailer for use in the console may not be the mailer to > use on the desktop, and (2) it would be nice to leave open the > possibility of a MAILER variable along the lines of BROWSER with > more useful semantics in the future. Well, it's not specific to "XDG". I think it should be called MAILER. According to this page, it already exists: http://catb.org/~esr/BROWSER/ but there is no description of it. I wonder if the X issue can be solved similarly to BROWSER. I'm not even sure how it's solved with BROWSER. What if the user doesn't want a graphical browser? -- Pelle From pelle at dsv.su.se Fri Oct 22 15:45:39 2010 From: pelle at dsv.su.se (Per Olofsson) Date: Fri, 22 Oct 2010 22:45:39 -0000 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <20101022221330.GA4487@arakhar> References: <20100316160157.14422.44232.reportbug@localhost> <4B9FB2C4.3070504@dsv.su.se> <20100628135509.GA12278@burratino> <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> <20101022161550.GG9224@burratino> <20101022221330.GA4487@arakhar> Message-ID: <4CC21412.3030405@dsv.su.se> Hi, > Also, $BROWSER does (at least by some programs[1]) get parsed into a > list of colon-separated commands which are tried in order until the > first one succeeds, this we could do to $MAILER too. I didn't implement > that because: > a) My shell-fu is not good enough to survive the resulting quoting mess, > I'd have to drop (jump?) to haskell/python for that. We could simply copy the code that parses $BROWSER (it's in upstream but not the Debian package). > Also, in the current proposal, the argument list of $MAILER necessarily > starts with "mailto:". If the programs being put in MAILER check that > and fail on unrecognized arguments, we have a way to introduce, up- and > downward-compatibly (by falling back to mailto: if necessary), any new > protocol we can find a unique name for. > (I realize that part was not a particularly compelling argument, and > wouldn't further object if you guys felt XDG_MAILER was the more > conservative/better approach and went with that. I'm just explaining why > I felt, and feel, that grabbing MAILER here and now is reasonable.) Agreed. > >> > - What happens if the mailer contains shell metacharacters? > I'd hope they get expanded, once, by a posix-compatible /bin/sh, but I'm > squeamish that way. Your > | eval "$XDG_MAILER" '"$@"' > looks as if it allows more evi^Wnifty quoting tricks than my mere > | $XDG_MAILER "$1" > but I think the most important consideration would be to mimic existing > BROWSER/EDITOR behavior, assuming there's such a thing. Again, [1]. You don't have to eval anything. Simply don't quote $MAILER when you invoke it. Then the shell will parse it. > [1] Anyone know of a good documentation for BROWSER/EDITOR/VISUAL/PAGER? http://catb.org/~esr/BROWSER/ -- Pelle From janbraun at gmx.de Fri Oct 22 17:47:33 2010 From: janbraun at gmx.de (Jan Braun) Date: Sat, 23 Oct 2010 00:47:33 -0000 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <4CC20FAC.7010507@dsv.su.se> References: <20100316160157.14422.44232.reportbug@localhost> <4B9FB2C4.3070504@dsv.su.se> <20100628135509.GA12278@burratino> <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> <4CC20FAC.7010507@dsv.su.se> Message-ID: <20101023004729.GA12405@arakhar> [ wildly merged quotes from 3 mails. I hope you don't mind.] Per Olofsson schrob: > Thanks. There's a problem though. xdg-email is meant specifically for > GUI programs. That means there's no tty available in general. So you > can't simply run mutt - you need to run it in a terminal window. /usr/lib/mutt/mailto-mutt already does that (in addition to parsing mailto: links). And it shouldn't be too hard to prevent it from spawning an x-terminal-emulator if already in a terminal. In fact: > I wonder if the X issue can be solved similarly to BROWSER. I'm not > even sure how it's solved with BROWSER. What if the user doesn't want > a graphical browser? That's me! And I seem to have success with | #!/bin/sh | ELINKS=/some/where/elinks | local L | if L="`tput lines`" && [ "$L"0 -gt "1"0 ] ; then | exec $ELINKS "$@" | else | exec x-terminal-emulator -e $ELINKS "$@" | fi and pointing BROWSER to that. Still new and in trial, but so far works for xdg-open in the linux console, in an x-terminal-emulator, and under X outside of a terminal emulator. Opens an x-terminal-emulator exactly in the last case. Should be probably factored into "run-in-terminal.sh" and used as BROWSER='run-in-terminal.sh /some/where/elinks' > There's also the question of the user setting for example MAILER=alpine. She should set MAILER='run-in-terminal.sh alpine' instead. :) > Then xdg-email will have to recognize that it's not an X app and also > launch it in a terminal. How will it know that? I guess that doesn't > work with BROWSER either at the moment. Correct, xdg-email can't know if $MAILER is an X app. The user has to supply that information, by not prefixing withrun-in-terminal.sh . (Unless she knows she'll never use xdg-email from inside a native X application, then she could guarantee alpine always has a terminal. Ha! Not what you expected she'd do to your GUI-helper. ;) > Thirdly, your patch always uses the MAILER variable if it's defined, > even when running under a DE. I'm not sure that's the correct thing to do. No problem, I am sure. :D Having set the environment variable is an explicit statement of the form "I demand mutt as my mua!". Using a DE, in contrast, is more along the line of "I generally like what GNOME is doing", it's much less specific about my email preferences. And if we make xdg-email prefer the DE's idea over MAILER, I can't even unset GNOME's email preferences, I have to explicitly configure GNOME to use mutt. And I have to configure KDE to use mutt, if I occasionally use KDE too, for whatever reason. And I have to re-configure MAILER, GNOME and KDE if I decide to switch to mutt-ng. Note I also can't configure GNOME/KDE to use xdg-email, because that'd be a cycle. If we make xdg-email prefer MAILER over the DE's idea, on the other hand, I can still set MAILER to mutt. When I then use GNOME/KDE/XFCE, I can, once, say "use xdg-email as a mailto handler", and everything will follow MAILER around to mutt-ng, or alpine, or whatever. Alternatively, I can set just KDE to stick with kmail(?), and it will. And, best of all, if I don't care about that funky MAILER stuff for people who use non-DE software or multiple DEs, I don't have to: it will never be set, and never get in my way. > > [1] Anyone know of a good documentation for BROWSER/EDITOR/VISUAL/PAGER? > http://catb.org/~esr/BROWSER/ Thanks. And I guess that EDITOR/VISUAL/PAGER never supported X or the colon-fallthough-scheme, but just assume they're running in a terminal? > [MAILER and colon-fallthrough] We could simply copy the code that > parses $BROWSER (it's in upstream but not the Debian package) Nice, +1. cheers, Jan -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From pelle at dsv.su.se Sat Oct 23 04:08:45 2010 From: pelle at dsv.su.se (Per Olofsson) Date: Sat, 23 Oct 2010 11:08:45 -0000 Subject: [Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce In-Reply-To: <20101023004729.GA12405@arakhar> References: <20100316160157.14422.44232.reportbug@localhost> <4B9FB2C4.3070504@dsv.su.se> <20100628135509.GA12278@burratino> <4C2FB558.9050107@dsv.su.se> <20101022095325.GA29612@arakhar> <4CC1731D.1090900@dsv.su.se> <20101022112510.GA8920@arakhar> <4CC20FAC.7010507@dsv.su.se> <20101023004729.GA12405@arakhar> Message-ID: <4CC2C23A.5060002@dsv.su.se> Hi, 2010-10-23 02:47, Jan Braun skrev: > [ wildly merged quotes from 3 mails. I hope you don't mind.] Not at all :-) > Per Olofsson schrob: >> Thanks. There's a problem though. xdg-email is meant specifically for >> GUI programs. That means there's no tty available in general. So you >> can't simply run mutt - you need to run it in a terminal window. > > /usr/lib/mutt/mailto-mutt already does that (in addition to > parsing mailto: links). And it shouldn't be too hard to prevent it from > spawning an x-terminal-emulator if already in a terminal. In fact: Actually, I found out that mutt supports mailto: links without that script. >> I wonder if the X issue can be solved similarly to BROWSER. I'm not >> even sure how it's solved with BROWSER. What if the user doesn't want >> a graphical browser? > > That's me! And I seem to have success with ... OK. >> Then xdg-email will have to recognize that it's not an X app and also >> launch it in a terminal. How will it know that? I guess that doesn't >> work with BROWSER either at the moment. > > Correct, xdg-email can't know if $MAILER is an X app. The user has to > supply that information, by not prefixing withrun-in-terminal.sh . > (Unless she knows she'll never use xdg-email from inside a native X > application, then she could guarantee alpine always has a terminal. Ha! > Not what you expected she'd do to your GUI-helper. ;) Right :-) >> Thirdly, your patch always uses the MAILER variable if it's defined, >> even when running under a DE. I'm not sure that's the correct thing to do. > > No problem, I am sure. :D > Having set the environment variable is an explicit statement of the form > "I demand mutt as my mua!". Using a DE, in contrast, is more along the > line of "I generally like what GNOME is doing", it's much less specific > about my email preferences. Makes sense. It's different from how xdg-open handles $BROWSER, but maybe that's not a problem. > Thanks. And I guess that EDITOR/VISUAL/PAGER never supported X or the > colon-fallthough-scheme, but just assume they're running in a terminal? Yes, I suppose so. -- Pelle