summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLawrence Mitchell <wence@gmx.li>2011-07-16 17:52:46 +0200
committerLars Magne Ingebrigtsen <larsi@gnus.org>2011-07-16 17:52:46 +0200
commit0794775d0d97c4f7291cc3954711a30447117963 (patch)
tree0e1f6c02171582b885c885047317dcee91664cf5
parentbe39b8cc93dca884ea46ec92f008a1bd2f27d53e (diff)
downloademacs-0794775d0d97c4f7291cc3954711a30447117963.tar.gz
Silence byte-compiler warning with :read-only defstruct slots
* emacs-lisp/cl-macs.el (defstruct): Ignore argument to setf method if slot is read-only. Fixes: debbugs:9035
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/emacs-lisp/cl-macs.el6
2 files changed, 9 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d22a6f081cd..a4c3f0c9217 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-16 Lawrence Mitchell <wence@gmx.li>
+
+ * emacs-lisp/cl-macs.el (defstruct): Ignore argument to setf
+ method if slot is read-only (bug#9035).
+
2011-07-16 Martin Rudalics <rudalics@gmx.at>
* frame.el (select-frame-set-input-focus): New argument
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 5b6d08472f1..d6b4643d6a4 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2396,8 +2396,10 @@ value, that slot cannot be set via `setf'.
(push (cons accessor t) side-eff)
(push (list 'define-setf-method accessor '(cl-x)
(if (cadr (memq :read-only (cddr desc)))
- (list 'error (format "%s is a read-only slot"
- accessor))
+ (list 'progn '(ignore cl-x)
+ (list 'error
+ (format "%s is a read-only slot"
+ 'accessor)))
;; If cl is loaded only for compilation,
;; the call to cl-struct-setf-expander would
;; cause a warning because it may not be