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

Re: command-line-args



> There's a strange behavior that the recent Emacs calls a
> FUNCTION interactively when the command line arguments
> -f FUNCTION
> 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 ?


        Stefan


--- startup.el	1 Sep 2003 15:45:15 -0000	1.322
+++ startup.el	19 Sep 2003 16:12:59 -0000
@@ -1634,9 +1644,10 @@
                                 "-funcall"
                                 "-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)))))