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

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

eval-last-sexp should return the value too.


From: Deepak Goel
Subject: eval-last-sexp should return the value too.
Date: Mon, 5 Nov 2001 20:03:29 -0500 (EST)

In GNU Emacs 21.1.2 (sparc-sun-solaris2.6, X toolkit, Xaw3d scroll bars)
 of 2001-10-30 on ratbert.eng.umd.edu
configured using `configure  --prefix=/usr/local/gnu 
--infodir=/usr/local/gnu/info/emacs-21.1 --with-kerberos --with-x 
--with-x-toolkit=yes --with-xpm --with-jpeg --with-tiff --with-gif --with-png'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

With emacs -q -no-site-file, 
(and in lisp mode), if i do an eval-last-sexp (with or without a
prefix argument) on  an expression like (+ 1 2 3), the function does
what it should---print in minibuffer and optionally insert the value.

But it does not return that value any more.. my programs that used
eval-last-sexp got broken with emacs21.. 

Looking at the code, it seems that the intended behavior was to indeed
return the value too, but one little piece of text-property expression
at the end has disrupted it..

IMHO (i did some testing), the following simple patch to
the function eval-last-sexp-1 in lisp-mode.el fixes it:


====================================================

cd ~/tmp/
diff -cw /usr/local/gnu/share/emacs/21.1/lisp/emacs-lisp/lisp-mode.el 
/homes/deego/tmp/lisp-mode.el
*** /usr/local/gnu/share/emacs/21.1/lisp/emacs-lisp/lisp-mode.el        Fri Jul 
27 11:26:53 2001
--- /homes/deego/tmp/lisp-mode.el       Mon Nov  5 19:56:37 2001
***************
*** 430,436 ****
          (last-sexp-setup-props beg end value 
                                 unabbreviated
                                 (buffer-substring-no-properties beg end))
!         )))))
  
  
  (defun eval-last-sexp (eval-last-sexp-arg-internal)
--- 430,436 ----
          (last-sexp-setup-props beg end value 
                                 unabbreviated
                                 (buffer-substring-no-properties beg end))
!         )) value)))
  
  
  (defun eval-last-sexp (eval-last-sexp-arg-internal)

Diff finished at Mon Nov  5 19:56:50









reply via email to

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