From ab2d904e060c6dada013f8bd731fbb4ff824b040 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 2 Nov 2009 16:02:32 -0800 Subject: [PATCH] notmuch.el: Hide thread IDs in notmuch-search mode. One more baby step toward something that's pleasant to use. --- TODO | 2 -- notmuch.el | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index b94d055b..50daa2c7 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,5 @@ Add support to format a reply buffer for a particular message. -Hide thread IDs in notmuch-search mode in notmuch.el. - Selectively hide headers and bodies in notmuch-show mode in notmuch.el, (for example, for read messages). diff --git a/notmuch.el b/notmuch.el index 73f02963..d0c7f320 100644 --- a/notmuch.el +++ b/notmuch.el @@ -95,6 +95,28 @@ (re-search-forward "[a-fA-F0-9]*") (filter-buffer-substring beg (point))))) +(defun notmuch-search-markup-this-thread-id () + (beginning-of-line) + (let ((beg (point))) + (re-search-forward "[a-fA-F0-9]*") + (forward-char) + (overlay-put (make-overlay beg (point)) 'invisible 'notmuch-search))) + +(defun notmuch-search-markup-thread-ids () + (save-excursion + (beginning-of-buffer) + (while (not (eobp)) + (notmuch-search-markup-this-thread-id) + (next-line)))) + +(defun notmuch-search-hide-thread-ids () + (interactive) + (add-to-invisibility-spec 'notmuch-search)) + +(defun notmuch-search-show-thread-ids () + (interactive) + (remove-from-invisibility-spec 'notmuch-search)) + (defun notmuch-search-show-thread () (interactive) (notmuch-show (notmuch-search-find-thread-id))) @@ -164,6 +186,7 @@ (save-excursion (call-process "notmuch" nil t nil "search" query) ) + (notmuch-search-markup-thread-ids) ))) (defun notmuch () -- 2.43.0