mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 20:08:10 +01:00
emacs: put the last search on top of recent searches in notmuch-hello
Notmuch-hello stores a list of recent searches. Before the change, if a search from this list is repeated, the recent search list is not changed. The patch makes repeated recent searches move to the head of the list. I.e. the last search is always on top of the recent search list, which is what one would expect from a history list.
This commit is contained in:
parent
9a0b61da56
commit
49af79cd2a
1 changed files with 3 additions and 2 deletions
|
@ -157,8 +157,9 @@ International Bureau of Weights and Measures."
|
|||
(defvar notmuch-hello-recent-searches nil)
|
||||
|
||||
(defun notmuch-hello-remember-search (search)
|
||||
(if (not (member search notmuch-hello-recent-searches))
|
||||
(push search notmuch-hello-recent-searches))
|
||||
(setq notmuch-hello-recent-searches
|
||||
(delete search notmuch-hello-recent-searches))
|
||||
(push search notmuch-hello-recent-searches)
|
||||
(if (> (length notmuch-hello-recent-searches)
|
||||
notmuch-recent-searches-max)
|
||||
(setq notmuch-hello-recent-searches (butlast notmuch-hello-recent-searches))))
|
||||
|
|
Loading…
Reference in a new issue