aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch.el
diff options
context:
space:
mode:
authorGravatar Dmitry Kurochkin <dmitry.kurochkin@gmail.com>2012-01-25 05:10:53 +0400
committerGravatar David Bremner <bremner@debian.org>2012-01-25 08:33:39 -0400
commitbc267b70b01c79f6bdda52641e9cd7574a151eff (patch)
treec1a58bde12630d315b2b98b6a128937290a2fd8e /emacs/notmuch.el
parent02d88159226b351091ae94e2176d2e59c79d21d3 (diff)
emacs: use a single history for all searches
There are two ways to do search in Emacs UI: search widget in notmuch-hello buffer and `notmuch-search' function bound to "s". Before the change, these search mechanisms used different history lists. The patch makes notmuch-hello search use the same history list as `notmuch-search' function.
Diffstat (limited to 'emacs/notmuch.el')
-rw-r--r--emacs/notmuch.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 3ec0816e..e02966f2 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -925,21 +925,25 @@ PROMPT is the string to prompt with."
(t (list string)))))))
;; this was simpler than convincing completing-read to accept spaces:
(define-key keymap (kbd "<tab>") 'minibuffer-complete)
- (read-from-minibuffer prompt nil keymap nil
- 'notmuch-query-history nil nil))))
+ (let ((history-delete-duplicates t))
+ (read-from-minibuffer prompt nil keymap nil
+ 'notmuch-search-history nil nil)))))
;;;###autoload
-(defun notmuch-search (query &optional oldest-first target-thread target-line continuation)
- "Run \"notmuch search\" with the given query string and display results.
+(defun notmuch-search (&optional query oldest-first target-thread target-line continuation)
+ "Run \"notmuch search\" with the given `query' and display results.
-The optional parameters are used as follows:
+If `query' is nil, it is read interactively from the minibuffer.
+Other optional parameters are used as follows:
oldest-first: A Boolean controlling the sort order of returned threads
target-thread: A thread ID (with the thread: prefix) that will be made
current if it appears in the search results.
target-line: The line number to move to if the target thread does not
appear in the search results."
- (interactive (list (notmuch-read-query "Notmuch search: ")))
+ (interactive)
+ (if (null query)
+ (setq query (notmuch-read-query "Notmuch search: ")))
(let ((buffer (get-buffer-create (notmuch-search-buffer-title query))))
(switch-to-buffer buffer)
(notmuch-search-mode)