branch: externals/consult
commit 1f705f884fd65aa3791e61c7892f66687ff2e946
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Revert "consult-info: Better interaction with minibuffer-nonselected-mode"
This reverts commit e356cd8907f891c358cb1b4c8c3d14f4539a2a9b.
---
consult-info.el | 45 ++++++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 23 deletions(-)
diff --git a/consult-info.el b/consult-info.el
index ef5301f3c0..561c128ef8 100644
--- a/consult-info.el
+++ b/consult-info.el
@@ -139,34 +139,33 @@ CALLBACK receives the candidates."
(setq buf nil)))))
(when buf (kill-buffer buf)))))
-(defun consult-info--with-buffers (manuals fun)
+(defun consult-info--prepare-buffers (manuals fun)
"Prepare buffers for MANUALS and call FUN with buffers."
(declare (indent 1))
(let (buffers)
(unwind-protect
(let ((reporter (make-progress-reporter "Preparing" 0 (length
manuals))))
(consult--with-increased-gc
- (save-window-excursion
- (cl-loop
- for idx from 0 for manual in manuals do
- (push (consult-info--buffer manual #'always) buffers)
- ;; Create a separate buffer if the info manual has subfiles.
They
- ;; are present on my system and have names like
- ;; /usr/share/info/texinfo.info-2.gz.
- (while-let
- ((sub (buffer-local-value 'Info-current-subfile (car
buffers)))
- (pos (string-match-p "-\\([0-9]+\\)\\'" sub))
- (buf (consult-info--buffer
- manual
- (lambda ()
- (ignore-errors
- (Info-read-subfile
- (format "%s%s" (substring sub 0 pos)
- (1- (string-to-number (substring sub
pos)))))
- (Info-select-node)
- t)))))
- (push buf buffers))
- (progress-reporter-update reporter (1+ idx) manual))))
+ (cl-loop
+ for idx from 0 for manual in manuals do
+ (push (consult-info--buffer manual #'always) buffers)
+ ;; Create a separate buffer if the info manual has subfiles. They
+ ;; are present on my system and have names like
+ ;; /usr/share/info/texinfo.info-2.gz.
+ (while-let
+ ((sub (buffer-local-value 'Info-current-subfile (car buffers)))
+ (pos (string-match-p "-\\([0-9]+\\)\\'" sub))
+ (buf (consult-info--buffer
+ manual
+ (lambda ()
+ (ignore-errors
+ (Info-read-subfile
+ (format "%s%s" (substring sub 0 pos)
+ (1- (string-to-number (substring sub
pos)))))
+ (Info-select-node)
+ t)))))
+ (push buf buffers))
+ (progress-reporter-update reporter (1+ idx) manual)))
(progress-reporter-done reporter)
(funcall fun (reverse buffers)))
(mapc #'kill-buffer buffers))))
@@ -179,7 +178,7 @@ CALLBACK receives the candidates."
(list (file-name-base Info-current-file))
(info-initialize)
(completing-read-multiple "Info Manuals: " (info--manual-names nil) nil
t)))
- (consult-info--with-buffers manuals
+ (consult-info--prepare-buffers manuals
(lambda (buffers)
(consult--read
(consult--dynamic-collection