diff options
| author | Glenn Morris | 2007-06-07 07:00:00 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-06-07 07:00:00 +0000 |
| commit | 15ce9dcfa1dea8036f6b59cec6a5f20e1bca8f45 (patch) | |
| tree | 65e5b560ecce99ed06c82c2a97363cb997d4b3ac | |
| parent | 04cc80ae25db7dcf23a6125b3341a69e585c2132 (diff) | |
| download | emacs-15ce9dcfa1dea8036f6b59cec6a5f20e1bca8f45.tar.gz emacs-15ce9dcfa1dea8036f6b59cec6a5f20e1bca8f45.zip | |
(byte-compile-warnings): Add new option `make-local'.
(byte-compile-warnings-safe-p): Add `make-local'.
(byte-compile-make-variable-buffer-local): Allow
byte-compile-warnings to suppress this warning.
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index f1761c125ac..0a37f098a7b 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -101,6 +101,8 @@ | |||
| 101 | ;; `cl-warnings' (calls to CL functions) | 101 | ;; `cl-warnings' (calls to CL functions) |
| 102 | ;; `interactive-only' (calls to commands that are | 102 | ;; `interactive-only' (calls to commands that are |
| 103 | ;; not good to call from Lisp) | 103 | ;; not good to call from Lisp) |
| 104 | ;; `make-local' (dubious calls to | ||
| 105 | ;; `make-variable-buffer-local') | ||
| 104 | ;; byte-compile-compatibility Whether the compiler should | 106 | ;; byte-compile-compatibility Whether the compiler should |
| 105 | ;; generate .elc files which can be loaded into | 107 | ;; generate .elc files which can be loaded into |
| 106 | ;; generic emacs 18. | 108 | ;; generic emacs 18. |
| @@ -356,14 +358,16 @@ Elements of the list may be: | |||
| 356 | cl-functions calls to runtime functions from the CL package (as | 358 | cl-functions calls to runtime functions from the CL package (as |
| 357 | distinguished from macros and aliases). | 359 | distinguished from macros and aliases). |
| 358 | interactive-only | 360 | interactive-only |
| 359 | commands that normally shouldn't be called from Lisp code." | 361 | commands that normally shouldn't be called from Lisp code. |
| 362 | make-local calls to make-variable-buffer-local that may be incorrect." | ||
| 360 | :group 'bytecomp | 363 | :group 'bytecomp |
| 361 | :type `(choice (const :tag "All" t) | 364 | :type `(choice (const :tag "All" t) |
| 362 | (set :menu-tag "Some" | 365 | (set :menu-tag "Some" |
| 363 | (const free-vars) (const unresolved) | 366 | (const free-vars) (const unresolved) |
| 364 | (const callargs) (const redefine) | 367 | (const callargs) (const redefine) |
| 365 | (const obsolete) (const noruntime) | 368 | (const obsolete) (const noruntime) |
| 366 | (const cl-functions) (const interactive-only)))) | 369 | (const cl-functions) (const interactive-only) |
| 370 | (const make-local)))) | ||
| 367 | (put 'byte-compile-warnings 'safe-local-variable 'byte-compile-warnings-safe-p) | 371 | (put 'byte-compile-warnings 'safe-local-variable 'byte-compile-warnings-safe-p) |
| 368 | ;;;###autoload | 372 | ;;;###autoload |
| 369 | (defun byte-compile-warnings-safe-p (x) | 373 | (defun byte-compile-warnings-safe-p (x) |
| @@ -374,7 +378,7 @@ Elements of the list may be: | |||
| 374 | (when (memq e '(free-vars unresolved | 378 | (when (memq e '(free-vars unresolved |
| 375 | callargs redefine | 379 | callargs redefine |
| 376 | obsolete noruntime | 380 | obsolete noruntime |
| 377 | cl-functions interactive-only)) | 381 | cl-functions interactive-only make-local)) |
| 378 | e)) | 382 | e)) |
| 379 | x) | 383 | x) |
| 380 | x)))) | 384 | x)))) |
| @@ -3888,7 +3892,8 @@ that suppresses all warnings during execution of BODY." | |||
| 3888 | ;; Warn about misuses of make-variable-buffer-local. | 3892 | ;; Warn about misuses of make-variable-buffer-local. |
| 3889 | (byte-defop-compiler-1 make-variable-buffer-local byte-compile-make-variable-buffer-local) | 3893 | (byte-defop-compiler-1 make-variable-buffer-local byte-compile-make-variable-buffer-local) |
| 3890 | (defun byte-compile-make-variable-buffer-local (form) | 3894 | (defun byte-compile-make-variable-buffer-local (form) |
| 3891 | (if (eq (car-safe (car-safe (cdr-safe form))) 'quote) | 3895 | (if (and (eq (car-safe (car-safe (cdr-safe form))) 'quote) |
| 3896 | (memq 'make-local byte-compile-warnings)) | ||
| 3892 | (byte-compile-warn | 3897 | (byte-compile-warn |
| 3893 | "`make-variable-buffer-local' should be called at toplevel")) | 3898 | "`make-variable-buffer-local' should be called at toplevel")) |
| 3894 | (byte-compile-normal-call form)) | 3899 | (byte-compile-normal-call form)) |