mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 11:58:10 +01:00
notmuch.el: Implement visual feedback for add/remove tags.
There's no undo still, but at least you can see what you are doing now.
This commit is contained in:
parent
fa226a7a10
commit
d4c4318fb9
2 changed files with 26 additions and 4 deletions
2
TODO
2
TODO
|
@ -1,7 +1,5 @@
|
||||||
Add support to format a reply buffer for a particular message.
|
Add support to format a reply buffer for a particular message.
|
||||||
|
|
||||||
Add feedback for tag addition/removal to notmuch.el.
|
|
||||||
|
|
||||||
Hide thread IDs in notmuch-search mode in notmuch.el.
|
Hide thread IDs in notmuch-search mode in notmuch.el.
|
||||||
|
|
||||||
Selectively hide headers and bodies in notmuch-show mode in
|
Selectively hide headers and bodies in notmuch-show mode in
|
||||||
|
|
28
notmuch.el
28
notmuch.el
|
@ -112,13 +112,37 @@
|
||||||
(error (buffer-substring beg end))
|
(error (buffer-substring beg end))
|
||||||
))))))
|
))))))
|
||||||
|
|
||||||
|
(defun notmuch-search-set-tags (tags)
|
||||||
|
(save-excursion
|
||||||
|
(end-of-line)
|
||||||
|
(re-search-backward "(")
|
||||||
|
(forward-char)
|
||||||
|
(let ((beg (point))
|
||||||
|
(inhibit-read-only t))
|
||||||
|
(re-search-forward ")")
|
||||||
|
(backward-char)
|
||||||
|
(let ((end (point)))
|
||||||
|
(delete-region beg end)
|
||||||
|
(insert (mapconcat 'identity tags " "))))))
|
||||||
|
|
||||||
|
(defun notmuch-search-get-tags ()
|
||||||
|
(save-excursion
|
||||||
|
(end-of-line)
|
||||||
|
(re-search-backward "(")
|
||||||
|
(let ((beg (+ (point) 1)))
|
||||||
|
(re-search-forward ")")
|
||||||
|
(let ((end (- (point) 1)))
|
||||||
|
(split-string (buffer-substring beg end))))))
|
||||||
|
|
||||||
(defun notmuch-search-add-tag (tag)
|
(defun notmuch-search-add-tag (tag)
|
||||||
(interactive "sTag to add: ")
|
(interactive "sTag to add: ")
|
||||||
(notmuch-search-call-notmuch-process "tag" (concat "+" tag) (concat "thread:" (notmuch-search-find-thread-id))))
|
(notmuch-search-call-notmuch-process "tag" (concat "+" tag) (concat "thread:" (notmuch-search-find-thread-id)))
|
||||||
|
(notmuch-search-set-tags (delete-dups (sort (cons tag (notmuch-search-get-tags)) 'string<))))
|
||||||
|
|
||||||
(defun notmuch-search-remove-tag (tag)
|
(defun notmuch-search-remove-tag (tag)
|
||||||
(interactive "sTag to remove: ")
|
(interactive "sTag to remove: ")
|
||||||
(notmuch-search-call-notmuch-process "tag" (concat "-" tag) (concat "thread:" (notmuch-search-find-thread-id))))
|
(notmuch-search-call-notmuch-process "tag" (concat "-" tag) (concat "thread:" (notmuch-search-find-thread-id)))
|
||||||
|
(notmuch-search-set-tags (delete tag (notmuch-search-get-tags))))
|
||||||
|
|
||||||
(defun notmuch-search-archive-thread ()
|
(defun notmuch-search-archive-thread ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
Loading…
Reference in a new issue