* `error' warnings in defstruct
@ 2004-01-30 12:48 David PONCE
0 siblings, 0 replies; only message in thread
From: David PONCE @ 2004-01-30 12:48 UTC (permalink / raw)
Hi,
Here is a small patch that fixes a mismatch between the number of
`format' %-sequences and arguments in `error' statements generated by
the `defstruct' macro.
I discovered that since the (nice) byte-compiler change that now make
it warn in such cases :-)
Hope it will help.
David
2004-01-30 David Ponce <david@dponce.com>
* cl-macs.el (defstruct): Fix missing %-sequence in generated
error statement.
(cl-struct-setf-expander): Ditto.
Index: lisp/emacs-lisp/cl-macs.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/cl-macs.el,v
retrieving revision 1.43
diff -c -r1.43 cl-macs.el
*** lisp/emacs-lisp/cl-macs.el 1 Sep 2003 15:45:20 -0000 1.43
--- lisp/emacs-lisp/cl-macs.el 30 Jan 2004 12:30:04 -0000
***************
*** 2260,2266 ****
(and pred-check
(list (list 'or pred-check
(list 'error
! (format "%s accessing a non-%s"
accessor name)
'cl-x))))
(list (if (eq type 'vector) (list 'aref 'cl-x pos)
--- 2260,2266 ----
(and pred-check
(list (list 'or pred-check
(list 'error
! (format "%s accessing a non-%s %%S"
accessor name)
'cl-x))))
(list (if (eq type 'vector) (list 'aref 'cl-x pos)
***************
*** 2340,2346 ****
(list (list 'or (subst temp 'cl-x pred-form)
(list 'error
(format
! "%s storing a non-%s" accessor name)
temp))))
(list (if (eq (car (get name 'cl-struct-type)) 'vector)
(list 'aset temp pos store)
--- 2340,2346 ----
(list (list 'or (subst temp 'cl-x pred-form)
(list 'error
(format
! "%s storing a non-%s %%S" accessor name)
temp))))
(list (if (eq (car (get name 'cl-struct-type)) 'vector)
(list 'aset temp pos store)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-01-30 12:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-30 12:48 `error' warnings in defstruct David PONCE
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).