From cea3b22bc742699d60c33194b73b391c05a2456d Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 6 May 2017 23:19:22 +0200 Subject: [PATCH] Fix bootstrap build of files.el * lisp/files.el (file-name-non-special): Don't use cl-letf. --- lisp/files.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index 7e627d36d49..8ac1993754e 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -29,7 +29,6 @@ ;;; Code: (eval-when-compile - (require 'cl-lib) (require 'pcase) (require 'easy-mmode)) ; For `define-minor-mode'. @@ -7032,13 +7031,18 @@ only these files will be asked to be saved." (when (and visit buffer-file-name) (setq buffer-file-name (concat "/:" buffer-file-name)))))) (`unquote-then-quote - (cl-letf* ((buffer (or (car arguments) (current-buffer))) - ((buffer-local-value 'buffer-file-name buffer) - (substring (buffer-file-name buffer) 2))) + ;; 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 ;; as only optional argument. - (apply operation arguments))) + (with-current-buffer (or (car arguments) buffer) + (let ((buffer-file-name (substring buffer-file-name 2))) + ;; Make sure to hide the temporary buffer change from the + ;; underlying operation. + (with-current-buffer buffer + (apply operation arguments)))))) (_ (apply operation arguments))))) -- 2.39.2