(define-key map "t" 'notmuch-search-filter-by-tag)
(define-key map "l" 'notmuch-search-filter)
(define-key map [mouse-1] 'notmuch-search-show-thread)
+ (define-key map "k" 'notmuch-tag-jump)
(define-key map "*" 'notmuch-search-tag-all)
(define-key map "a" 'notmuch-search-archive-thread)
(define-key map "-" 'notmuch-search-remove-tag)
(process-lines notmuch-command "search" "--output=tags" "*")))
(completions
(append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
- "subject:" "attachment:" "mimetype:")
+ "subject:" "attachment:")
(mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
- (mapcar (lambda (tag) (concat "is:" tag)) all-tags))))
+ (mapcar (lambda (tag) (concat "is:" tag)) all-tags)
+ (mapcar (lambda (mimetype) (concat "mimetype:" mimetype)) (mailcap-mime-types)))))
(let ((keymap (copy-keymap minibuffer-local-map))
(current-query (case major-mode
(notmuch-search-mode (notmuch-search-get-query))
;;;###autoload
(put 'notmuch-search 'notmuch-doc "Search for messages.")
-(defun notmuch-search (&optional query oldest-first target-thread target-line)
+(defun notmuch-search (&optional query oldest-first target-thread target-line no-display)
"Display threads matching QUERY in a notmuch-search buffer.
If QUERY is nil, it is read interactively from the minibuffer.
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.
+ NO-DISPLAY: Do not try to foreground the search results buffer. If it is
+ already foregrounded i.e. displayed in a window, this has no
+ effect, meaning the buffer will remain visible.
When called interactively, this will prompt for a query and use
the configured default sort order."
(let* ((query (or query (notmuch-read-query "Notmuch search: ")))
(buffer (get-buffer-create (notmuch-search-buffer-title query))))
- (switch-to-buffer buffer)
+ (if no-display
+ (set-buffer buffer)
+ (switch-to-buffer buffer))
(notmuch-search-mode)
;; Don't track undo information for this buffer
(set 'buffer-undo-list t)
(defun notmuch-search-refresh-view ()
"Refresh the current view.
-Kills the current buffer and runs a new search with the same
+Erases the current buffer and runs a new search with the same
query string as the current search. If the current thread is in
the new search results, then point will be placed on the same
thread. Otherwise, point will be moved to attempt to be in the
same relative position within the new buffer."
+ (interactive)
(let ((target-line (line-number-at-pos))
(oldest-first notmuch-search-oldest-first)
(target-thread (notmuch-search-find-thread-id 'bare))
(query notmuch-search-query-string))
- (notmuch-bury-or-kill-this-buffer)
- (notmuch-search query oldest-first target-thread target-line)
+ ;; notmuch-search erases the current buffer.
+ (notmuch-search query oldest-first target-thread target-line t)
(goto-char (point-min))))
(defun notmuch-search-toggle-order ()
(with-current-buffer b
(memq major-mode '(notmuch-show-mode
notmuch-search-mode
+ notmuch-tree-mode
notmuch-hello-mode
- message-mode))))
+ notmuch-message-mode))))
;;;###autoload
(defun notmuch-cycle-notmuch-buffers ()