summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/bytecomp.el13
-rw-r--r--lisp/emacs-lisp/cl-extra.el8
2 files changed, 16 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 1094b1b8cb1..0dd0ead9d61 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3792,6 +3792,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
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 107f8b1b223..16e777ed2b5 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -1,6 +1,6 @@
;;; cl-extra.el --- Common Lisp features, part 2 -*-byte-compile-dynamic: t;-*-
-;; Copyright (C) 1993,2000,2003 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2000, 2003, 2005 Free Software Foundation, Inc.
;; Author: Dave Gillespie <daveg@synaptics.com>
;; Keywords: extensions
@@ -38,9 +38,7 @@
;;; Code:
-(or (memq 'cl-19 features)
- (error "Tried to load `cl-extra' before `cl'!"))
-
+(require 'cl)
;;; Type coercion.
@@ -763,5 +761,5 @@ This also does some trivial optimizations to make the form prettier."
(run-hooks 'cl-extra-load-hook)
-;;; arch-tag: bcd03437-0871-43fb-a8f1-ad0e0b5427ed
+;; arch-tag: bcd03437-0871-43fb-a8f1-ad0e0b5427ed
;;; cl-extra.el ends here