branch: externals/consult commit ade38705802323dd46f8790f952b1e46b8c893c0 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Revert "Fix consult--temporary-files" This reverts commit cce3e1c1e0e5e192426977768a3830671facd9ca. --- consult.el | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/consult.el b/consult.el index 09bf1fd3bc..006f436787 100644 --- a/consult.el +++ b/consult.el @@ -1159,10 +1159,12 @@ ORIG is the original function, HOOKS the arguments." (defun consult--temporary-files () "Return a function to open files temporarily for preview." - (let* ((orig-buffers (buffer-list)) - (temporary-buffers nil) - (upgrade-buffers - (lambda () + (let ((dir default-directory) + (hook (make-symbol "consult--temporary-files-window-selection-change")) + (orig-buffers (buffer-list)) + temporary-buffers) + (fset hook + (lambda (_) ;; Fully initialize previewed files and keep them alive. (unless (consult--completion-window-p) (let (live-files) @@ -1183,11 +1185,6 @@ 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. - (fset hook (lambda (_) (run-at-time 0 nil upgrade-buffers))) (lambda (&optional name) (if name (let ((default-directory dir))