emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix bootstrap build of files.el


From: Philipp
Subject: [PATCH] Fix bootstrap build of files.el
Date: Sat, 6 May 2017 23:21:57 +0200

* 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 7e627d36d4..8ac1993754 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 @@ file-name-non-special
            (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.12.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]