summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2006-12-11 04:36:04 +0000
committerRichard M. Stallman <rms@gnu.org>2006-12-11 04:36:04 +0000
commitb9b14938f9a018591703b7b1824f28bff284dfc3 (patch)
tree7e0d6ec64d7eb04c0a0674a0d69afcde89ab70fa
parentb424911536a1edf192ab5a40c9ff808486ac5dcd (diff)
downloademacs-b9b14938f9a018591703b7b1824f28bff284dfc3.tar.gz
(defstruct): Suppress warnings about calls to cl-struct-setf-expander.
-rw-r--r--lisp/emacs-lisp/cl-macs.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index bd257a98366..ba556512532 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2292,10 +2292,15 @@ copier, a `NAME-p' predicate, and setf-able `NAME-SLOT' accessors.
(if (cadr (memq :read-only (cddr desc)))
(list 'error (format "%s is a read-only slot"
accessor))
- (list 'cl-struct-setf-expander 'cl-x
- (list 'quote name) (list 'quote accessor)
- (and pred-check (list 'quote pred-check))
- pos)))
+ ;; If cl is loaded only for compilation,
+ ;; the call to cl-struct-setf-expander would
+ ;; cause a warning because it may not be
+ ;; defined at run time. Suppress that warning.
+ (list 'with-no-warnings
+ (list 'cl-struct-setf-expander 'cl-x
+ (list 'quote name) (list 'quote accessor)
+ (and pred-check (list 'quote pred-check))
+ pos))))
forms)
(if print-auto
(nconc print-func