]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bootstrap build of files.el
authorPhilipp <phst@google.com>
Sat, 6 May 2017 21:19:22 +0000 (23:19 +0200)
committerPhilipp <phst@google.com>
Sat, 6 May 2017 21:23:45 +0000 (23:23 +0200)
* lisp/files.el (file-name-non-special): Don't use cl-letf.

lisp/files.el

index 7e627d36d49d9c65c5a72e13d1a3d65f55368e14..8ac1993754edd7375b90609a68ba3b91b49b2664 100644 (file)
@@ -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)))))