Some tag-related operations accept a single tag without prefix
(`notmuch-select-tag-with-completion'), others accept multiple tags
prefixed with '+' or '-' (`notmuch-read-tag-changes'). Before the
change, both functions used a single default minibuffer history. This
is inconvenient because you have to skip options with incompatible
format when going through the history. The patch adds separate
history lists for the two functions. Note that functions that accept
the same input format (e.g. "+", "-", "*") share the history list as
before.
(defvar notmuch-query-history nil
"Variable to store minibuffer history for notmuch queries")
(defvar notmuch-query-history nil
"Variable to store minibuffer history for notmuch queries")
+(defvar notmuch-select-tag-history nil
+ "Variable to store minibuffer history for
+`notmuch-select-tag-with-completion' function.")
+
+(defvar notmuch-read-tag-changes-history nil
+ "Variable to store minibuffer history for
+`notmuch-read-tag-changes' function.")
+
(defun notmuch-tag-completions (&optional search-terms)
(split-string
(with-output-to-string
(defun notmuch-tag-completions (&optional search-terms)
(split-string
(with-output-to-string
(defun notmuch-select-tag-with-completion (prompt &rest search-terms)
(let ((tag-list (notmuch-tag-completions search-terms)))
(defun notmuch-select-tag-with-completion (prompt &rest search-terms)
(let ((tag-list (notmuch-tag-completions search-terms)))
- (completing-read prompt tag-list)))
+ (completing-read prompt tag-list nil nil nil 'notmuch-select-tag-history)))
(defun notmuch-read-tag-changes (&optional initial-input &rest search-terms)
(let* ((all-tag-list (notmuch-tag-completions))
(defun notmuch-read-tag-changes (&optional initial-input &rest search-terms)
(let* ((all-tag-list (notmuch-tag-completions))
(define-key map " " 'self-insert-command)
map)))
(delete "" (completing-read-multiple "Tags (+add -drop): "
(define-key map " " 'self-insert-command)
map)))
(delete "" (completing-read-multiple "Tags (+add -drop): "
- tag-list nil nil initial-input))))
+ tag-list nil nil initial-input
+ 'notmuch-read-tag-changes-history))))
(defun notmuch-update-tags (tags tag-changes)
"Return a copy of TAGS with additions and removals from TAG-CHANGES.
(defun notmuch-update-tags (tags tag-changes)
"Return a copy of TAGS with additions and removals from TAG-CHANGES.