GNU bug report logs - #14387
24.3; The return value of setf is not the last VAL in the list

Previous Next

Package: emacs;

Reported by: 白井 彰 <okshirai <at> gmail.com>

Date: Sat, 11 May 2013 17:53:02 UTC

Severity: normal

Found in version 24.3

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14387 in the body.
You can then email your comments to 14387 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14387; Package emacs. (Sat, 11 May 2013 17:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 白井 彰 <okshirai <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 11 May 2013 17:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 白井 彰 <okshirai <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: okshirai <at> gmail.com
Subject: 24.3; The return value of setf is not the last VAL in the list
Date: Sun, 12 May 2013 01:40:49 +0900
(describe-function 'setf) says "The return value is the last VAL in  
the list.", but it does not:

% /Users/shiraiakira/emacs-24.3/nextstep/Emacs.app/Contents/MacOS/ 
Emacs -Q

(require 'gv)
gv
(require 'cl)
cl
(let ((pl '(aaa bbb))) (setf (cl-getf pl 'aaa) 'ccc))
(aaa ccc)    ; This should be ccc


In GNU Emacs 24.3.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)
 of 2013-04-30 on mini2.local
Windowing system distributor `Apple', version 10.3.949
Configured using:
 `configure '--with-ns' '--without-x''

Important settings:
  value of $LANG: ja_JP.ujis
  locale-coding-system: japanese-iso-8bit-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
( r e q u i r e SPC ' g v ) C-j ( r e q u i r e SPC
' c l ) C-j ( l e t SPC ( ( p l SPC ' ( a a a SPC b
b b ) ) ) SPC ( s e t f SPC ( c l - g e t f SPC p l
SPC ' a a a ) SPC ' c c c ) ) C-j <escape> x r e p
o r t - e m a c s - b u g <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message cl-macs format-spec
rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils cl cl-lib gv time-date
japan-util tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process ns multi-tty
emacs)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14387; Package emacs. (Wed, 15 May 2013 02:02:03 GMT) Full text and rfc822 format available.

Message #8 received at 14387 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 白井 彰 <okshirai <at> gmail.com>
Cc: 14387 <at> debbugs.gnu.org
Subject: Re: bug#14387: 24.3;
	The return value of setf is not the last VAL in the list
Date: Tue, 14 May 2013 22:01:00 -0400
> (let ((pl '(aaa bbb))) (setf (cl-getf pl 'aaa) 'ccc))
> (aaa ccc)    ; This should be ccc

Oops, good point.  The patch below should fix it (installed in trunk).


        Stefan


=== modified file 'lisp/emacs-lisp/cl-extra.el'
--- lisp/emacs-lisp/cl-extra.el	2013-01-02 16:13:04 +0000
+++ lisp/emacs-lisp/cl-extra.el	2013-05-15 01:55:53 +0000
@@ -597,8 +597,11 @@
                   (macroexp-let2 nil d def
                     (funcall do `(cl-getf ,getter ,k ,d)
                              (lambda (v)
-                               (funcall setter
-                                        `(cl--set-getf ,getter ,k ,v))))))))))
+                               (macroexp-let2 nil val v
+                                 `(progn
+                                    ,(funcall setter
+                                              `(cl--set-getf ,getter ,k ,val))
+                                    ,val))))))))))
   (setplist '--cl-getf-symbol-- plist)
   (or (get '--cl-getf-symbol-- tag)
       ;; Originally we called cl-get here,





bug closed, send any further explanations to 14387 <at> debbugs.gnu.org and 白井 彰 <okshirai <at> gmail.com> Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Wed, 15 May 2013 02:02:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 12 Jun 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.