* [PATCH] emacs: put the last search on top of recent searches in notmuch-hello
@ 2011-12-22 0:23 Dmitry Kurochkin
2011-12-22 6:48 ` David Edmondson
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dmitry Kurochkin @ 2011-12-22 0:23 UTC (permalink / raw)
To: notmuch
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.
---
emacs/notmuch-hello.el | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index f892ff7..2fb0cfc 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -154,8 +154,9 @@ Typically \",\" in the US and UK and \".\" in Europe."
(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))))
--
1.7.7.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] emacs: put the last search on top of recent searches in notmuch-hello
2011-12-22 0:23 [PATCH] emacs: put the last search on top of recent searches in notmuch-hello Dmitry Kurochkin
@ 2011-12-22 6:48 ` David Edmondson
2011-12-22 7:48 ` Tomi Ollila
2011-12-22 11:33 ` David Bremner
2 siblings, 0 replies; 4+ messages in thread
From: David Edmondson @ 2011-12-22 6:48 UTC (permalink / raw)
To: Dmitry Kurochkin, notmuch
[-- Attachment #1: Type: text/plain, Size: 503 bytes --]
On Thu, 22 Dec 2011 04:23:50 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
> 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.
Looks good.
dme.
--
David Edmondson, http://dme.org
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] emacs: put the last search on top of recent searches in notmuch-hello
2011-12-22 0:23 [PATCH] emacs: put the last search on top of recent searches in notmuch-hello Dmitry Kurochkin
2011-12-22 6:48 ` David Edmondson
@ 2011-12-22 7:48 ` Tomi Ollila
2011-12-22 11:33 ` David Bremner
2 siblings, 0 replies; 4+ messages in thread
From: Tomi Ollila @ 2011-12-22 7:48 UTC (permalink / raw)
To: Dmitry Kurochkin, notmuch
On Thu, 22 Dec 2011 04:23:50 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
> 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.
> ---
+1
Tomi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] emacs: put the last search on top of recent searches in notmuch-hello
2011-12-22 0:23 [PATCH] emacs: put the last search on top of recent searches in notmuch-hello Dmitry Kurochkin
2011-12-22 6:48 ` David Edmondson
2011-12-22 7:48 ` Tomi Ollila
@ 2011-12-22 11:33 ` David Bremner
2 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2011-12-22 11:33 UTC (permalink / raw)
To: Dmitry Kurochkin, notmuch
On Thu, 22 Dec 2011 04:23:50 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
> 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.
Pushed.
d
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-12-22 11:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-22 0:23 [PATCH] emacs: put the last search on top of recent searches in notmuch-hello Dmitry Kurochkin
2011-12-22 6:48 ` David Edmondson
2011-12-22 7:48 ` Tomi Ollila
2011-12-22 11:33 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).