]> code.delx.au - gnu-emacs/commitdiff
(byte-compile-make-variable-buffer-local)
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 29 Jul 2005 19:54:18 +0000 (19:54 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 29 Jul 2005 19:54:18 +0000 (19:54 +0000)
(byte-compile-form-make-variable-buffer-local): New functions to warn about
misuses of make-variable-buffer-local where make-local-variable was meant.

lisp/ChangeLog
lisp/emacs-lisp/bytecomp.el

index 1cc3c86785cd0190dba6929f806be11d31cba49d..4f7aa114de51b71ccad94929405a4b2ddbb96950 100644 (file)
@@ -1,3 +1,10 @@
+2005-07-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/bytecomp.el (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.
+
 2005-07-29  Juanma Barranquero  <lekktu@gmail.com>
 
        * bs.el (bs-attributes-list): Doc fix.
@@ -21,8 +28,8 @@
 
 2005-07-29  Kenichi Handa  <handa@m17n.org>
 
-       * international/mule-cmds.el (select-message-coding-system): Be
-       sure to use LF for end-of-line.  If no coding system is decided,
+       * international/mule-cmds.el (select-message-coding-system):
+       Be sure to use LF for end-of-line.  If no coding system is decided,
        return iso-8859-1-unix.
 
 2005-07-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * term/README: Describe the terminal-init-* functionality.
 
-       * startup.el (command-line): After loading the terminal
-       initialization file call the corresponding terminal initialization
-       function.
+       * startup.el (command-line): After loading the terminal initialization
+       file call the corresponding terminal initialization function.
 
 2005-07-27  Kenichi Handa  <handa@m17n.org>
 
        * ps-bdf.el (bdf-read-font-info): Ignore glyphs whose ENCODING is
        negative.
 
-       * ps-mule.el (ps-mule-bitmap-prologue): Fix arguments to
-       setcharwidth.
+       * ps-mule.el (ps-mule-bitmap-prologue): Fix arguments to setcharwidth.
        (ps-mule-composition-prologue): Fix for the case that
        RelativeCompose is false.
 
index e21a7ccb4a08d185a00ff1ef472ff2c9573c3c4d..6ccf65b1fd94e277009a43e209179f63e0f5ee99 100644 (file)
@@ -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))
+
 \f
 ;;; tags