diff options
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 26 |
2 files changed, 25 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 94b9b54e0ac..12c1da63322 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2005-05-14 Richard M. Stallman <rms@gnu.org> | 1 | 2005-05-14 Richard M. Stallman <rms@gnu.org> |
| 2 | 2 | ||
| 3 | * emacs-lisp/bytecomp.el (byte-compile-nogroup-warn): New function. | ||
| 4 | (byte-compile-form): Call byte-compile-nogroup-warn. | ||
| 5 | (byte-compile-warning-types): Doc fix. | ||
| 6 | |||
| 3 | * progmodes/cc-engine.el (c-literal-faces): | 7 | * progmodes/cc-engine.el (c-literal-faces): |
| 4 | Add font-lock-comment-delimiter-face. | 8 | Add font-lock-comment-delimiter-face. |
| 5 | 9 | ||
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: | |||
| 338 | 338 | ||
| 339 | free-vars references to variables not in the current lexical scope. | 339 | free-vars references to variables not in the current lexical scope. |
| 340 | unresolved calls to unknown functions. | 340 | unresolved calls to unknown functions. |
| 341 | callargs lambda calls with args that don't match the definition. | 341 | callargs function calls with args that don't match the definition. |
| 342 | redefine function cell redefined from a macro to a lambda or vice | 342 | redefine function name redefined from a macro to ordinary function or vice |
| 343 | versa, or redefined to take a different number of arguments. | 343 | versa, or redefined to take a different number of arguments. |
| 344 | obsolete obsolete variables and functions. | 344 | obsolete obsolete variables and functions. |
| 345 | noruntime functions that may not be defined at runtime (typically | 345 | noruntime functions that may not be defined at runtime (typically |
| @@ -1244,6 +1244,20 @@ extra args." | |||
| 1244 | (dolist (elt '(format message error)) | 1244 | (dolist (elt '(format message error)) |
| 1245 | (put elt 'byte-compile-format-like t)) | 1245 | (put elt 'byte-compile-format-like t)) |
| 1246 | 1246 | ||
| 1247 | ;; Warn if a custom definition fails to specify :group. | ||
| 1248 | (defun byte-compile-nogroup-warn (form) | ||
| 1249 | (let ((keyword-args (cdr (cdr (cdr (cdr form))))) | ||
| 1250 | (name (cadr form))) | ||
| 1251 | (unless (plist-get keyword-args :group) | ||
| 1252 | (byte-compile-warn | ||
| 1253 | "%s for `%s' fails to specify containing group" | ||
| 1254 | (cdr (assq (car form) | ||
| 1255 | '((custom-declare-group . defgroup) | ||
| 1256 | (custom-declare-face . defface) | ||
| 1257 | (custom-declare-variable . defcustom)))) | ||
| 1258 | (if (and (consp name) (eq (car name) 'quote)) | ||
| 1259 | (cadr name) name))))) | ||
| 1260 | |||
| 1247 | ;; Warn if the function or macro is being redefined with a different | 1261 | ;; Warn if the function or macro is being redefined with a different |
| 1248 | ;; number of arguments. | 1262 | ;; number of arguments. |
| 1249 | (defun byte-compile-arglist-warn (form macrop) | 1263 | (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." | |||
| 2729 | (when (byte-compile-const-symbol-p fn) | 2743 | (when (byte-compile-const-symbol-p fn) |
| 2730 | (byte-compile-warn "`%s' called as a function" fn)) | 2744 | (byte-compile-warn "`%s' called as a function" fn)) |
| 2731 | (and (memq 'interactive-only byte-compile-warnings) | 2745 | (and (memq 'interactive-only byte-compile-warnings) |
| 2732 | (memq (car form) byte-compile-interactive-only-functions) | 2746 | (memq fn byte-compile-interactive-only-functions) |
| 2733 | (byte-compile-warn "`%s' used from Lisp code\n\ | 2747 | (byte-compile-warn "`%s' used from Lisp code\n\ |
| 2734 | That command is designed for interactive use only" fn)) | 2748 | That command is designed for interactive use only" fn)) |
| 2735 | (if (and handler | 2749 | (if (and handler |
| @@ -2739,8 +2753,10 @@ That command is designed for interactive use only" fn)) | |||
| 2739 | (progn | 2753 | (progn |
| 2740 | (byte-compile-set-symbol-position fn) | 2754 | (byte-compile-set-symbol-position fn) |
| 2741 | (funcall handler form)) | 2755 | (funcall handler form)) |
| 2742 | (if (memq 'callargs byte-compile-warnings) | 2756 | (when (memq 'callargs byte-compile-warnings) |
| 2743 | (byte-compile-callargs-warn form)) | 2757 | (if (memq fn '(custom-declare-group custom-declare-variable custom-declare-face)) |
| 2758 | (byte-compile-nogroup-warn form)) | ||
| 2759 | (byte-compile-callargs-warn form)) | ||
| 2744 | (byte-compile-normal-call form)) | 2760 | (byte-compile-normal-call form)) |
| 2745 | (if (memq 'cl-functions byte-compile-warnings) | 2761 | (if (memq 'cl-functions byte-compile-warnings) |
| 2746 | (byte-compile-cl-warn form)))) | 2762 | (byte-compile-cl-warn form)))) |