[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: command-line-args

From: Stefan Monnier
Subject: Re: command-line-args
Date: 19 Sep 2003 12:15:54 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> There's a strange behavior that the recent Emacs calls a
> FUNCTION interactively when the command line arguments
> are given.  How to reproduce it is:

Yes, I changed it because I wanted to be able to say `emacs -f gdb'
and get gdb started rather than get an error.

> Because of this behavior, I can't use the following:

> emacs -f w3m http://some.news.site/daily-news.html&;

> Where w3m is yet another web browser command which has the
> interactive spec for prompting a url.

That was not intended.
I'm not sure how best to get both behaviors.

What do people think of a patch like the one below ?


--- startup.el  1 Sep 2003 15:45:15 -0000       1.322
+++ startup.el  19 Sep 2003 16:12:59 -0000
@@ -1634,9 +1644,10 @@
                                 "-e"))  ; what the source used to say
                  (setq tem (intern (or argval (pop command-line-args-left))))
-                 (if (commandp tem)
-                     (command-execute tem)
-                   (funcall tem)))
+                (condition-case nil
+                    (funcall tem)
+                  ((invalid-function wrong-number-of-arguments)
+                   (command-execute tem))))
                 ((member argi '("-eval" "-execute"))
                  (eval (read (or argval (pop command-line-args-left)))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]