bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9357: 23.3.50; defstruct format bug


From: Leo
Subject: bug#9357: 23.3.50; defstruct format bug
Date: Wed, 24 Aug 2011 17:35:30 +0800

Run compile-defun on the following form to see the problem.

(defstruct (state (:conc-name %state-)
                  (:constructor nil)
                  (:copier nil)
                  :named)
  beg end)

Proposed patch:

diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index fcbf028f..896465d8 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2338,17 +2338,14 @@ (defmacro defstruct (struct &rest descs)
                        (append
                         (and pred-check
                              (list (list 'or pred-check
-                                         (list 'error
-                                               (format "%s accessing a non-%s"
-                                                       accessor name)))))
+                                         `(error "%s accessing a non-%s" 
',accessor ',name))))
                         (list (if (eq type 'vector) (list 'aref 'cl-x pos)
                                 (if (= pos 0) '(car cl-x)
                                   (list 'nth pos 'cl-x)))))) forms)
              (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))
+                                `(error "%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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]