diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2005-07-29 19:54:18 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2005-07-29 19:54:18 +0000 |
commit | 01e4a4fa0349d23595f61f531fec66d8f3c11c65 (patch) | |
tree | ad1aded31b11d02f1e3f2347fa930156ad2b7af1 /lisp/emacs-lisp/bytecomp.el | |
parent | d0278ce84522bdbc650e00e91137904e001b5de9 (diff) | |
download | emacs-01e4a4fa0349d23595f61f531fec66d8f3c11c65.tar.gz |
(byte-compile-make-variable-buffer-local)
(byte-compile-form-make-variable-buffer-local): New functions to warn about
misuses of make-variable-buffer-local where make-local-variable was meant.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index e21a7ccb4a0..6ccf65b1fd9 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3790,6 +3790,19 @@ that suppresses all warnings during execution of BODY." (defun byte-compile-no-warnings (form) (let (byte-compile-warnings) (byte-compile-form (cons 'progn (cdr form))))) + +;; Warn about misuses of make-variable-buffer-local. +(byte-defop-compiler-1 make-variable-buffer-local byte-compile-make-variable-buffer-local) +(defun byte-compile-make-variable-buffer-local (form) + (if (eq (car-safe (car-safe (cdr-safe form))) 'quote) + (byte-compile-warn + "`make-variable-buffer-local' should be called at toplevel")) + (byte-compile-normal-call form)) +(put 'make-variable-buffer-local + 'byte-hunk-handler 'byte-compile-form-make-variable-buffer-local) +(defun byte-compile-form-make-variable-buffer-local (form) + (byte-compile-keep-pending form 'byte-compile-normal-call)) + ;;; tags |