GNU bug report logs - #9357
23.3.50; defstruct format bug

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Wed, 24 Aug 2011 09:39:01 UTC

Severity: normal

Found in version 23.3.50

Done: Leo <sdl.web <at> gmail.com>

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 9357 in the body.
You can then email your comments to 9357 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 owner <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#9357; Package emacs. (Wed, 24 Aug 2011 09:39:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org. (Wed, 24 Aug 2011 09:39:01 GMT) Full text and rfc822 format available.

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

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 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 sent to Leo <sdl.web <at> gmail.com>:
You have taken responsibility. (Fri, 26 Aug 2011 10:16:02 GMT) Full text and rfc822 format available.

Notification sent to Leo <sdl.web <at> gmail.com>:
bug acknowledged by developer. (Fri, 26 Aug 2011 10:16:02 GMT) Full text and rfc822 format available.

Message #10 received at 9357-done <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: 9357-done <at> debbugs.gnu.org
Subject: Re: bug#9357: 23.3.50; defstruct format bug
Date: Fri, 26 Aug 2011 18:13:05 +0800
Fixed in 24.1.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 23 Sep 2011 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 69 days ago.

Previous Next


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