all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Strange behavior of `value'
@ 2007-07-06 16:12 Jay Belanger
  2007-07-06 17:32 ` Andreas Schwab
  2007-07-07 13:06 ` Richard Stallman
  0 siblings, 2 replies; 4+ messages in thread
From: Jay Belanger @ 2007-07-06 16:12 UTC (permalink / raw)
  To: emacs-devel; +Cc: jay.p.belanger


Using the latest cvs Emacs, started with "emacs -Q",I get the
following odd behavior. If I type in (in *scratch*, say):

(setq val 5)
val

and C-xC-e after each line, then the C-xC-e after the `val' gives me a
5.  Similarly if I type M-: val.
However, if I type in

(setq value 5)
value

and C-xC-e after each line, then the C-xC-e after the `value' gives me a
nil instead of 5.  If I type M-: value, I get a (void-variable value)
error.

Jay

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Strange behavior of `value'
  2007-07-06 16:12 Strange behavior of `value' Jay Belanger
@ 2007-07-06 17:32 ` Andreas Schwab
  2007-07-07 13:06 ` Richard Stallman
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2007-07-06 17:32 UTC (permalink / raw)
  To: jay.p.belanger; +Cc: emacs-devel

Jay Belanger <jay.p.belanger@gmail.com> writes:

> However, if I type in
>
> (setq value 5)
> value
>
> and C-xC-e after each line, then the C-xC-e after the `value' gives me a
> nil instead of 5.  If I type M-: value, I get a (void-variable value)
> error.

This is due to a dynamic binding around the evaluation of the
expression.  I have checked in a fix.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Strange behavior of `value'
  2007-07-06 16:12 Strange behavior of `value' Jay Belanger
  2007-07-06 17:32 ` Andreas Schwab
@ 2007-07-07 13:06 ` Richard Stallman
  2007-07-07 14:40   ` Jay Belanger
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2007-07-07 13:06 UTC (permalink / raw)
  To: jay.p.belanger; +Cc: jay.p.belanger, emacs-devel

Does this fix it?

*** lisp-mode.el	01 Apr 2007 17:40:39 -0400	1.201
--- lisp-mode.el	06 Jul 2007 22:24:55 -0400	
***************
*** 628,640 ****
    (interactive "P")
    (if (null eval-expression-debug-on-error)
        (eval-last-sexp-1 eval-last-sexp-arg-internal)
!     (let ((old-value eval-last-sexp-fake-value) new-value value)
!       (let ((debug-on-error old-value))
! 	(setq value (eval-last-sexp-1 eval-last-sexp-arg-internal))
! 	(setq new-value debug-on-error))
!       (unless (eq old-value new-value)
! 	(setq debug-on-error new-value))
!       value)))
  
  (defun eval-defun-1 (form)
    "Treat some expressions specially.
--- 628,641 ----
    (interactive "P")
    (if (null eval-expression-debug-on-error)
        (eval-last-sexp-1 eval-last-sexp-arg-internal)
!     (let ((values
! 	   (let ((debug-on-error eval-last-sexp-fake-value))
! 	     (list (eval-last-sexp-1 eval-last-sexp-arg-internal)
! 		   debug-on-error))))
!       (let ((new-value (cadr values)))
! 	(unless (eq new-value eval-last-sexp-fake-value)
! 	  (setq debug-on-error new-value)))
!       (car values))))
  
  (defun eval-defun-1 (form)
    "Treat some expressions specially.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Strange behavior of `value'
  2007-07-07 13:06 ` Richard Stallman
@ 2007-07-07 14:40   ` Jay Belanger
  0 siblings, 0 replies; 4+ messages in thread
From: Jay Belanger @ 2007-07-07 14:40 UTC (permalink / raw)
  To: emacs-devel; +Cc: jay.p.belanger


Richard Stallman <rms@gnu.org> writes:

> Does this fix it?

Yes, it does, although Andreas already checked in a fix.

Jay

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-07 14:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-06 16:12 Strange behavior of `value' Jay Belanger
2007-07-06 17:32 ` Andreas Schwab
2007-07-07 13:06 ` Richard Stallman
2007-07-07 14:40   ` Jay Belanger

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.