bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: view-read-only causes read-write


From: Kevin Rodgers
Subject: Re: view-read-only causes read-write
Date: Mon, 21 Apr 2003 10:39:54 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Dan Jacobson wrote:

P.S. I am no lisp pro but above I had to use an "(and ...)" or else
only one sexp was used, without any warning to the user.

K> Of course.  Symbolic expressions are well-defined: (function arg
K> ...).  In order to evaluate multiple sexps in sequence, use (progn
K> ...) or multiple --eval command line options.

Ok, then can't we sting the user with an error message like that then?
Are we rude to at least inform them that there is crud at the end of
their $ emacs -eval sequence that will not get eval'ed, or will they
snap back "of course, I put that there on purpose!" (what propose?)


Here's a patch.  The error message could easily be improved to include
the entire expression or just the trailing garbage.

2003-04-21  Kevin Rodgers  <address@hidden>

        * startup.el (command-line-1): Signal an error if there is trailing
        garbage following the --eval expression.


*** emacs-20.7/lisp/startup.el.orig     Sun Aug  1 19:12:00 1999
--- emacs-20.7/lisp/startup.el  Mon Apr 21 10:30:43 2003
***************
*** 1065,1071 ****
                     (setq tem argval)
                   (setq tem (car command-line-args-left))
                   (setq command-line-args-left (cdr command-line-args-left)))
!                (eval (read tem)))
                ;; Set the default directory as specified in -L.
                ((or (string-equal argi "-L")
                     (string-equal argi "-directory"))
--- 1065,1074 ----
                     (setq tem argval)
                   (setq tem (car command-line-args-left))
                   (setq command-line-args-left (cdr command-line-args-left)))
!                (let ((sexp-length (read-from-string tem)))
!                  (or (= (cdr sexp-lenth) (length tem))
!                      (error "Trailing garbage following expression"))
!                  (eval (car sexp-length))))
                ;; Set the default directory as specified in -L.
                ((or (string-equal argi "-L")
                     (string-equal argi "-directory"))


--
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;";>Kevin Rodgers</a>





reply via email to

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