diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2005-05-16 15:49:27 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2005-05-16 15:49:27 +0000 |
commit | 35bc5d82600f330082298823f09f53259a90ea81 (patch) | |
tree | 328e8f1df7bcd3cb68f4dfa7de371543da885c89 /lisp/emacs-lisp/bytecomp.el | |
parent | 133fe4c8a2d944324dc2c9a42b01ab1d258ad49d (diff) | |
parent | cc211a0ff8145e0814413e237bb5674d615968b7 (diff) | |
download | emacs-35bc5d82600f330082298823f09f53259a90ea81.tar.gz emacs-35bc5d82600f330082298823f09f53259a90ea81.tar.bz2 emacs-35bc5d82600f330082298823f09f53259a90ea81.zip |
Merged from miles@gnu.org--gnu-2005 (patch 307-312)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-307
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-308
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-309
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-310
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-311
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-312
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-346
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index b93979de82c..970a64d062b 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -338,8 +338,8 @@ Elements of the list may be be: free-vars references to variables not in the current lexical scope. unresolved calls to unknown functions. - callargs lambda calls with args that don't match the definition. - redefine function cell redefined from a macro to a lambda or vice + callargs function calls with args that don't match the definition. + redefine function name redefined from a macro to ordinary function or vice versa, or redefined to take a different number of arguments. obsolete obsolete variables and functions. noruntime functions that may not be defined at runtime (typically @@ -1244,6 +1244,20 @@ extra args." (dolist (elt '(format message error)) (put elt 'byte-compile-format-like t)) +;; Warn if a custom definition fails to specify :group. +(defun byte-compile-nogroup-warn (form) + (let ((keyword-args (cdr (cdr (cdr (cdr form))))) + (name (cadr form))) + (unless (plist-get keyword-args :group) + (byte-compile-warn + "%s for `%s' fails to specify containing group" + (cdr (assq (car form) + '((custom-declare-group . defgroup) + (custom-declare-face . defface) + (custom-declare-variable . defcustom)))) + (if (and (consp name) (eq (car name) 'quote)) + (cadr name) name))))) + ;; Warn if the function or macro is being redefined with a different ;; number of arguments. (defun byte-compile-arglist-warn (form macrop) @@ -2729,7 +2743,7 @@ If FORM is a lambda or a macro, byte-compile it as a function." (when (byte-compile-const-symbol-p fn) (byte-compile-warn "`%s' called as a function" fn)) (and (memq 'interactive-only byte-compile-warnings) - (memq (car form) byte-compile-interactive-only-functions) + (memq fn byte-compile-interactive-only-functions) (byte-compile-warn "`%s' used from Lisp code\n\ That command is designed for interactive use only" fn)) (if (and handler @@ -2739,8 +2753,10 @@ That command is designed for interactive use only" fn)) (progn (byte-compile-set-symbol-position fn) (funcall handler form)) - (if (memq 'callargs byte-compile-warnings) - (byte-compile-callargs-warn form)) + (when (memq 'callargs byte-compile-warnings) + (if (memq fn '(custom-declare-group custom-declare-variable custom-declare-face)) + (byte-compile-nogroup-warn form)) + (byte-compile-callargs-warn form)) (byte-compile-normal-call form)) (if (memq 'cl-functions byte-compile-warnings) (byte-compile-cl-warn form)))) |