diff options
Diffstat (limited to 'lisp/emacs-lisp')
| -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  | 
