diff options
| author | Stefan Monnier | 2008-06-08 02:07:25 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-06-08 02:07:25 +0000 |
| commit | ab5111e3df50ec7c21ffc86fb19e969db23c1f85 (patch) | |
| tree | e051e96d4f39e29737612320fee138b2f4d03ea0 /lisp | |
| parent | 2c01ac6a3f86b688a80d51e1364e2ebedd83ddee (diff) | |
| download | emacs-ab5111e3df50ec7c21ffc86fb19e969db23c1f85.tar.gz emacs-ab5111e3df50ec7c21ffc86fb19e969db23c1f85.zip | |
(byte-compile-current-group): New var.
(byte-compile-file): Initialize it.
(byte-compile-nogroup-warn): Keep track of the current group.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 25 |
2 files changed, 25 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 53305d3ad21..d8d74ab2053 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2008-06-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/bytecomp.el (byte-compile-current-group): New var. | ||
| 4 | (byte-compile-file): Initialize it. | ||
| 5 | (byte-compile-nogroup-warn): Keep track of the current group. | ||
| 6 | |||
| 1 | 2008-06-08 Glenn Morris <rgm@gnu.org> | 7 | 2008-06-08 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * Makefile.in (compile, compile-always, bootstrap-prepare): | 9 | * Makefile.in (compile, compile-always, bootstrap-prepare): |
| @@ -7,7 +13,7 @@ | |||
| 7 | 13 | ||
| 8 | * language/hanja-util.el (hanja-init-load): Use a char-table for | 14 | * language/hanja-util.el (hanja-init-load): Use a char-table for |
| 9 | hanja-table. | 15 | hanja-table. |
| 10 | (hangul-to-hanja-char): Adjusted for the above change. | 16 | (hangul-to-hanja-char): Adjust for the above change. |
| 11 | 17 | ||
| 12 | 2008-06-07 Glenn Morris <rgm@gnu.org> | 18 | 2008-06-07 Glenn Morris <rgm@gnu.org> |
| 13 | 19 | ||
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index e0a3f2221e2..1908e5790dd 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -924,6 +924,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." | |||
| 924 | (defvar byte-compile-current-form nil) | 924 | (defvar byte-compile-current-form nil) |
| 925 | (defvar byte-compile-dest-file nil) | 925 | (defvar byte-compile-dest-file nil) |
| 926 | (defvar byte-compile-current-file nil) | 926 | (defvar byte-compile-current-file nil) |
| 927 | (defvar byte-compile-current-group nil) | ||
| 927 | (defvar byte-compile-current-buffer nil) | 928 | (defvar byte-compile-current-buffer nil) |
| 928 | 929 | ||
| 929 | ;; Log something that isn't a warning. | 930 | ;; Log something that isn't a warning. |
| @@ -1335,9 +1336,13 @@ extra args." | |||
| 1335 | 1336 | ||
| 1336 | ;; Warn if a custom definition fails to specify :group. | 1337 | ;; Warn if a custom definition fails to specify :group. |
| 1337 | (defun byte-compile-nogroup-warn (form) | 1338 | (defun byte-compile-nogroup-warn (form) |
| 1338 | (let ((keyword-args (cdr (cdr (cdr (cdr form))))) | 1339 | (if (and (memq (car form) '(custom-declare-face custom-declare-variable)) |
| 1339 | (name (cadr form))) | 1340 | byte-compile-current-group) |
| 1340 | (or (not (eq (car-safe name) 'quote)) | 1341 | ;; The group will be provided implicitly. |
| 1342 | nil | ||
| 1343 | (let ((keyword-args (cdr (cdr (cdr (cdr form))))) | ||
| 1344 | (name (cadr form))) | ||
| 1345 | (or (not (eq (car-safe name) 'quote)) | ||
| 1341 | (and (eq (car form) 'custom-declare-group) | 1346 | (and (eq (car form) 'custom-declare-group) |
| 1342 | (equal name ''emacs)) | 1347 | (equal name ''emacs)) |
| 1343 | (plist-get keyword-args :group) | 1348 | (plist-get keyword-args :group) |
| @@ -1345,10 +1350,15 @@ extra args." | |||
| 1345 | (byte-compile-warn | 1350 | (byte-compile-warn |
| 1346 | "%s for `%s' fails to specify containing group" | 1351 | "%s for `%s' fails to specify containing group" |
| 1347 | (cdr (assq (car form) | 1352 | (cdr (assq (car form) |
| 1348 | '((custom-declare-group . defgroup) | 1353 | '((custom-declare-group . defgroup) |
| 1349 | (custom-declare-face . defface) | 1354 | (custom-declare-face . defface) |
| 1350 | (custom-declare-variable . defcustom)))) | 1355 | (custom-declare-variable . defcustom)))) |
| 1351 | (cadr name))))) | 1356 | (cadr name))) |
| 1357 | ;; Update the current group, if needed. | ||
| 1358 | (if (and byte-compile-current-file ;Only when byte-compiling a whole file. | ||
| 1359 | (eq (car form) 'custom-declare-group) | ||
| 1360 | (eq (car-safe name) 'quote)) | ||
| 1361 | (setq byte-compile-current-group (cadr name)))))) | ||
| 1352 | 1362 | ||
| 1353 | ;; Warn if the function or macro is being redefined with a different | 1363 | ;; Warn if the function or macro is being redefined with a different |
| 1354 | ;; number of arguments. | 1364 | ;; number of arguments. |
| @@ -1713,6 +1723,7 @@ The value is non-nil if there were no errors, nil if errors." | |||
| 1713 | ;; Force logging of the file name for each file compiled. | 1723 | ;; Force logging of the file name for each file compiled. |
| 1714 | (setq byte-compile-last-logged-file nil) | 1724 | (setq byte-compile-last-logged-file nil) |
| 1715 | (let ((byte-compile-current-file bytecomp-filename) | 1725 | (let ((byte-compile-current-file bytecomp-filename) |
| 1726 | (byte-compile-current-group nil) | ||
| 1716 | (set-auto-coding-for-load t) | 1727 | (set-auto-coding-for-load t) |
| 1717 | target-file input-buffer output-buffer | 1728 | target-file input-buffer output-buffer |
| 1718 | byte-compile-dest-file) | 1729 | byte-compile-dest-file) |