comparison lisp/emacs-lisp/bytecomp.el @ 62885:ef148239f15d

(byte-compile-nogroup-warn): Warn only when name to be defined is quoted.
author Richard M. Stallman <rms@gnu.org>
date Mon, 30 May 2005 06:49:18 +0000
parents d419c1ab3f39
children 885d1b72a2b1 6aee1e9b0bd7 01137c1fdbe9
comparison
equal deleted inserted replaced
62884:ab597e7c8a07 62885:ef148239f15d
1246 1246
1247 ;; Warn if a custom definition fails to specify :group. 1247 ;; Warn if a custom definition fails to specify :group.
1248 (defun byte-compile-nogroup-warn (form) 1248 (defun byte-compile-nogroup-warn (form)
1249 (let ((keyword-args (cdr (cdr (cdr (cdr form))))) 1249 (let ((keyword-args (cdr (cdr (cdr (cdr form)))))
1250 (name (cadr form))) 1250 (name (cadr form)))
1251 (unless (plist-get keyword-args :group) 1251 (or (plist-get keyword-args :group)
1252 (byte-compile-warn 1252 (not (and (consp name) (eq (car name) 'quote)))
1253 "%s for `%s' fails to specify containing group" 1253 (byte-compile-warn
1254 (cdr (assq (car form) 1254 "%s for `%s' fails to specify containing group"
1255 '((custom-declare-group . defgroup) 1255 (cdr (assq (car form)
1256 (custom-declare-face . defface) 1256 '((custom-declare-group . defgroup)
1257 (custom-declare-variable . defcustom)))) 1257 (custom-declare-face . defface)
1258 (if (and (consp name) (eq (car name) 'quote)) 1258 (custom-declare-variable . defcustom))))
1259 (cadr name) name))))) 1259 (cadr name)))))
1260 1260
1261 ;; 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
1262 ;; number of arguments. 1262 ;; number of arguments.
1263 (defun byte-compile-arglist-warn (form macrop) 1263 (defun byte-compile-arglist-warn (form macrop)
1264 (let ((old (byte-compile-fdefinition (nth 1 form) macrop))) 1264 (let ((old (byte-compile-fdefinition (nth 1 form) macrop)))