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 | 67f1264db80bfed52a4b53d4396264d9883ef216 (patch) | |
| tree | 416445562056c2c6b8434d50e878924eba4a7221 /lisp/emacs-lisp | |
| parent | e45814cb2fb5bf6f19bc5cadcd29bcb65a93f738 (diff) | |
| download | emacs-67f1264db80bfed52a4b53d4396264d9883ef216.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')
| -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 |
