[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#14387: 24.3; The return value of setf is not the last VAL in the lis
From: |
Stefan Monnier |
Subject: |
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> (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,