unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: view-read-only causes read-write
Date: Mon, 21 Apr 2003 10:39:54 -0600	[thread overview]
Message-ID: <3EA41EDA.7090202@yahoo.com> (raw)
In-Reply-To: mailman.4998.1050903900.21513.bug-gnu-emacs@gnu.org

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  <ihs_4664@yahoo.com>

	* 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>

  parent reply	other threads:[~2003-04-21 16:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4772.1050547956.21513.bug-gnu-emacs@gnu.org>
2003-04-17 17:10 ` view-read-only causes read-write Kevin Rodgers
2003-04-21  1:17   ` Dan Jacobson
     [not found]   ` <mailman.4998.1050903900.21513.bug-gnu-emacs@gnu.org>
2003-04-21 16:39     ` Kevin Rodgers [this message]
2003-04-17  1:59 Dan Jacobson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EA41EDA.7090202@yahoo.com \
    --to=ihs_4664@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).