[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#62263: 28.1; Feature Request: Favorites variable support for minibuf
From: |
Juri Linkov |
Subject: |
bug#62263: 28.1; Feature Request: Favorites variable support for minibuffers |
Date: |
Wed, 22 Mar 2023 19:43:12 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) |
> If anyone can provide me with some hack around the history variable
> to emulate those benefits, i would be glad.
One example that you could look at is project--read-file-cpd-relative
where it filters out non-project history items:
(relname (cl-letf ((history-add-new-input nil)
((symbol-value hist)
(mapcan
(lambda (s)
(and (string-prefix-p abbr-cpd s)
(not (eq abbr-cpd-length (length s)))
(list (substring s abbr-cpd-length))))
(symbol-value hist))))
(project--completing-read-strict prompt
new-collection
predicate
hist mb-default)))
The same way you could filter out non-favorites from the currently
active history list symbol from minibuffer-history-variable for your
commands next-favorite-element and previous-favorite-element, or
in an advice-add around next-history-element/previous-history-element.