From 4ad3058476bdc7f5fa7e60d91c240a63e1f5f73d Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Fri, 16 Jun 2017 22:55:52 +0200 Subject: [PATCH] Remove `buffer-local-value' as generalized variable (Bug#26624) * lisp/emacs-lisp/gv.el (buffer-local-value): Remove. * lisp/files.el (file-name-non-special): Remove a stale comment. --- etc/NEWS | 7 +++++++ lisp/emacs-lisp/gv.el | 4 ---- lisp/files.el | 2 -- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index aacdf79b57..5b87939cf7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -51,6 +51,13 @@ sets the XTerm window title. The default is to set the window title. ** The FILENAME argument to 'file-name-base' is now mandatory and no longer defaults to 'buffer-file-name'. +** 'buffer-local-value' is no longer a generalized variable. This is +because the buffer-local value of a variable always consists of two +pieces: the actual value of the variable, and whether it is +buffer-local. But 'buffer-local-value' returns only one piece of +information, which is not enough for a generalized variable. In +particular, 'cl-letf' can't be made to work with 'buffer-local-value'. + * Lisp Changes in Emacs 27.1 diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 892d6e9716..f504ca43b0 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -367,10 +367,6 @@ setf (gv-define-setter window-point (v &optional w) `(set-window-point ,w ,v)) (gv-define-setter window-start (v &optional w) `(set-window-start ,w ,v)) -(gv-define-setter buffer-local-value (val var buf) - (macroexp-let2 nil v val - `(with-current-buffer ,buf (set (make-local-variable ,var) ,v)))) - (gv-define-expander alist-get (lambda (do key alist &optional default remove testfn) (macroexp-let2 macroexp-copyable-p k key diff --git a/lisp/files.el b/lisp/files.el index fe7cb1a8a9..4bb611a3ba 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -7005,8 +7005,6 @@ file-name-non-special (when (and visit buffer-file-name) (setq buffer-file-name (concat "/:" buffer-file-name)))))) (`unquote-then-quote - ;; We can't use `cl-letf' with `(buffer-local-value)' here - ;; because it wouldn't work during bootstrapping. (let ((buffer (current-buffer))) ;; `unquote-then-quote' is only used for the ;; `verify-visited-file-modtime' action, which takes a buffer -- 2.14.1