# HG changeset patch # User Stefan Monnier # Date 1122666858 0 # Node ID 12ea7ab25f7ca9f2a8ac1cf3681db5a9b10a6afb # Parent 32b32ccdedc05d000ebfb09c92e24ec19e0e4249 (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. diff -r 32b32ccdedc0 -r 12ea7ab25f7c lisp/ChangeLog --- a/lisp/ChangeLog Fri Jul 29 18:05:51 2005 +0000 +++ b/lisp/ChangeLog Fri Jul 29 19:54:18 2005 +0000 @@ -1,3 +1,10 @@ +2005-07-29 Stefan Monnier + + * 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 * bs.el (bs-attributes-list): Doc fix. @@ -21,8 +28,8 @@ 2005-07-29 Kenichi Handa - * 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 @@ -89,17 +96,15 @@ * 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 * 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. diff -r 32b32ccdedc0 -r 12ea7ab25f7c lisp/emacs-lisp/bytecomp.el --- a/lisp/emacs-lisp/bytecomp.el Fri Jul 29 18:05:51 2005 +0000 +++ b/lisp/emacs-lisp/bytecomp.el Fri Jul 29 19:54:18 2005 +0000 @@ -3790,6 +3790,19 @@ (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