emacs-devel
[Top][All Lists]
Advanced

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

`error' warnings in defstruct


From: David PONCE
Subject: `error' warnings in defstruct
Date: Fri, 30 Jan 2004 13:48:23 +0100 (CET)

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  <address@hidden>

        * 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)





reply via email to

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