all messages for Emacs-related lists mirrored at yhetil.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.