GNU bug report logs - #62263
28.1; Feature Request: Favorites variable support for minibuffers

Previous Next

Package: emacs;

Reported by: omer.kasapoglu <at> boun.edu.tr

Date: Sat, 18 Mar 2023 16:38:02 UTC

Severity: wishlist

Found in version 28.1

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: omer.kasapoglu <at> boun.edu.tr
Cc: 62263 <at> debbugs.gnu.org
Subject: bug#62263: 28.1; Feature Request: Favorites variable support for minibuffers
Date: Wed, 22 Mar 2023 19:43:12 +0200
> 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.




This bug report was last modified 2 years and 90 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.