[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/bytecomp.el
From: |
Richard M . Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/bytecomp.el |
Date: |
Sat, 14 May 2005 08:29:22 -0400 |
Index: emacs/lisp/emacs-lisp/bytecomp.el
diff -c emacs/lisp/emacs-lisp/bytecomp.el:2.163
emacs/lisp/emacs-lisp/bytecomp.el:2.164
*** emacs/lisp/emacs-lisp/bytecomp.el:2.163 Sun May 1 13:28:55 2005
--- emacs/lisp/emacs-lisp/bytecomp.el Sat May 14 12:29:22 2005
***************
*** 338,345 ****
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
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
--- 338,345 ----
free-vars references to variables not in the current lexical scope.
unresolved calls to unknown functions.
! 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,1249 ****
--- 1244,1263 ----
(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,2735 ****
(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)
(byte-compile-warn "`%s' used from Lisp code\n\
That command is designed for interactive use only" fn))
(if (and handler
--- 2743,2749 ----
(when (byte-compile-const-symbol-p fn)
(byte-compile-warn "`%s' called as a function" fn))
(and (memq 'interactive-only byte-compile-warnings)
! (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,2746 ****
(progn
(byte-compile-set-symbol-position fn)
(funcall handler form))
! (if (memq 'callargs byte-compile-warnings)
! (byte-compile-callargs-warn form))
(byte-compile-normal-call form))
(if (memq 'cl-functions byte-compile-warnings)
(byte-compile-cl-warn form))))
--- 2753,2762 ----
(progn
(byte-compile-set-symbol-position fn)
(funcall handler 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))))