[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult de94f2c7c1 3/3: consult--temporary-files: Simpl
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult de94f2c7c1 3/3: consult--temporary-files: Simplify |
Date: |
Wed, 22 Jun 2022 11:57:23 -0400 (EDT) |
branch: externals/consult
commit de94f2c7c1c9ec6ffebf77c94b1b5b6ab5b615cc
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
consult--temporary-files: Simplify
---
consult.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/consult.el b/consult.el
index 3ae11501a8..0252ba775f 100644
--- a/consult.el
+++ b/consult.el
@@ -1159,14 +1159,13 @@ ORIG is the original function, HOOKS the arguments."
(defun consult--temporary-files ()
"Return a function to open files temporarily for preview."
- (let* ((dir default-directory)
- (orig-buffers (buffer-list))
+ (let* ((orig-buffers (buffer-list))
(temporary-buffers nil)
(upgrade-buffers
(lambda ()
;; Fully initialize previewed files and keep them alive.
(unless (consult--completion-window-p)
- (let ((default-directory dir) live-files)
+ (let (live-files)
(pcase-dolist (`(,file . ,buf) temporary-buffers)
(when-let (wins (and (buffer-live-p buf)
(get-buffer-window-list buf)))
@@ -1184,6 +1183,7 @@ ORIG is the original function, HOOKS the arguments."
(pcase-dolist (`(,win . ,state) wins)
(setf (car (alist-get 'buffer state)) buf)
(window-state-put state win))))))))
+ (dir default-directory)
(hook (make-symbol
"consult--temporary-files-window-selection-change")))
;; Run the buffer upgrade not within the window-selection-change-hook,
;; since the hook is called during redisplay.