unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* A not quite stylish proposal for command line processing
@ 2007-07-29 13:07 David Kastrup
  2007-07-30 16:44 ` Richard Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: David Kastrup @ 2007-07-29 13:07 UTC (permalink / raw)
  To: emacs-devel


How about
(defun *argv++ nil (pop command-line-args-left))
?

It would allow to write

emacs --eval '(ediff-files (*argv++) (*argv++))' "$FILE1" "$FILE2"

instead of the much more tedious explicit variant.  Note that

emacs --eval "(ediff-files \"$FILE1\" \"$FILE2\")"

is _not_ equivalent since it requires $FILE1 to be properly quoted for
appearing inside of a Lisp string.

Somewhat more Lispish would be
(defvaralias 'argv 'command-line-args-left)
which would at least permit
emacs --eval '(ediff-files (pop argv) (pop argv))' "$FILE1" "$FILE2"

And it is more likely to be found by programmers using "apropos".  And
is actually only one character longer than the *argv++ cuteness.

Comments?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-07-31 20:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-29 13:07 A not quite stylish proposal for command line processing David Kastrup
2007-07-30 16:44 ` Richard Stallman
2007-07-30 16:52   ` Lennart Borgman (gmail)
2007-07-30 17:11     ` David Kastrup
2007-07-30 17:24       ` Lennart Borgman (gmail)
2007-07-30 16:57   ` David Kastrup
2007-07-31  3:38     ` Richard Stallman
2007-07-31  5:59       ` David Kastrup
2007-07-31 20:22         ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).