From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: view-read-only causes read-write Date: Mon, 21 Apr 2003 10:39:54 -0600 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3EA41EDA.7090202@yahoo.com> References: <3E9EE005.1040408@yahoo.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1050943199 6418 80.91.224.249 (21 Apr 2003 16:39:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Apr 2003 16:39:59 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 21 18:39:56 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 197eKi-0001f9-00 for ; Mon, 21 Apr 2003 18:39:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 197eLQ-0001sW-03 for gnu-bug-gnu-emacs@m.gmane.org; Mon, 21 Apr 2003 12:40:40 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 197eKv-0001IO-00 for bug-gnu-emacs@prep.ai.mit.edu; Mon, 21 Apr 2003 12:40:09 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 197eKj-0000ZN-00 for bug-gnu-emacs@prep.ai.mit.edu; Mon, 21 Apr 2003 12:40:01 -0400 Original-Received: from chx400.switch.ch ([130.59.10.2]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 197eKh-0000Vq-00 for bug-gnu-emacs@prep.ai.mit.edu; Mon, 21 Apr 2003 12:39:56 -0400 Original-Received: from mail.fu-berlin.de ([160.45.11.165]) by chx400.switch.ch with esmtp (Exim 3.20 #1) id 197eKg-0001RF-00 for gnu-emacs-bug@moderators.isc.org; Mon, 21 Apr 2003 18:39:55 +0200 Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Mon, 21 Apr 2003 18:39:54 +0200 (MEST) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Mon, 21 Apr 2003 18:39:54 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 51 X-Orig-NNTP-Posting-Host: 170.207.51.80 X-Orig-X-Trace: fu-berlin.de 1050943194 5642896 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4860 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4860 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 * 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")) -- Kevin Rodgers