emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/consult 7da9b7494f 1/3: consult-info: Reduce node name


From: ELPA Syncer
Subject: [elpa] externals/consult 7da9b7494f 1/3: consult-info: Reduce node name allocations for group titles
Date: Thu, 26 Jan 2023 16:57:26 -0500 (EST)

branch: externals/consult
commit 7da9b7494f488dc4772ad28f4e68151e2004cdaf
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    consult-info: Reduce node name allocations for group titles
---
 consult-info.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/consult-info.el b/consult-info.el
index ea8b6ad777..2791d7039e 100644
--- a/consult-info.el
+++ b/consult-info.el
@@ -35,9 +35,12 @@
   (pcase-let ((`(,regexps . ,hl)
                (funcall consult--regexp-compiler input 'emacs t))
               (candidates nil)
-              (cand-idx 0))
+              (cand-idx 0)
+              (last-node nil)
+              (full-node nil))
     (pcase-dolist (`(,manual . ,buf) manuals)
       (with-current-buffer buf
+        (setq last-node nil full-node nil)
         (widen)
         (goto-char (point-min))
         ;; TODO subfile support?!
@@ -73,8 +76,10 @@
                     (cand (concat
                            (funcall hl (buffer-substring-no-properties bol 
eol))
                            (consult--tofu-encode cand-idx))))
-                (put-text-property 0 1 'consult--info
-                                   (list (format "(%s)%s" manual node) bol 
buf) cand)
+                (unless (equal node last-node)
+                  (setq full-node (concat "(" manual ")" node)
+                        last-node node))
+                (put-text-property 0 1 'consult--info (list full-node bol buf) 
cand)
                 (cl-incf cand-idx)
                 (push cand candidates)))
             (goto-char (1+ eol))))))



reply via email to

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