aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.el
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-16 11:57:05 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-16 11:57:05 -0800
commitd5068983b87c76798399d1d4d26e638e2feb6e0d (patch)
treea96a5689a355314a3b2ec4835f871c83b22f8f03 /notmuch.el
parent352e91625b2c0148a215ece9f857a56bdfab896f (diff)
notmuch.el: Display authors in a column separate from subject.
This makes it much easier to actually read the subject lines. The user can set notmuch-search-authors-width to control the width of the column. Two possible ideas for improving this support further: 1. Make the excess authors invisible instead of removing them from the buffer, (which means that isearch could still find them). 2. Have the user variable control a percentage of the window width rather than being a fixed number of columns.
Diffstat (limited to 'notmuch.el')
-rw-r--r--notmuch.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/notmuch.el b/notmuch.el
index 07193066..6d609dba 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -658,6 +658,9 @@ thread from that buffer can be show when done with this one)."
(notmuch-show-toggle-body-read-visible)))))
)))
+(defvar notmuch-search-authors-width 40
+ "Number of columns to use to diplay authors in a notmuch-search buffer.")
+
(defvar notmuch-search-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "a" 'notmuch-search-archive-thread)
@@ -756,7 +759,17 @@ global search.
(if (re-search-forward "thread:[a-fA-F0-9]*" nil t)
(progn
(forward-char)
- (overlay-put (make-overlay beg (point)) 'invisible 'notmuch-search)))))
+ (overlay-put (make-overlay beg (point)) 'invisible 'notmuch-search)
+ (re-search-forward ".*\\[[0-9]*/[0-9]*\\] \\([^;]*\\)\\(;\\)")
+ (let* ((authors (buffer-substring (match-beginning 1) (match-end 1)))
+ (authors-length (length authors)))
+ ;; Drop the semi-colon
+ (replace-match "" t nil nil 2)
+ (if (<= authors-length notmuch-search-authors-width)
+ (replace-match (concat authors (make-string
+ (- notmuch-search-authors-width
+ authors-length) ? )) t t nil 1)
+ (replace-match (concat (substring authors 0 (- notmuch-search-authors-width 3)) "...") t t nil 1)))))))
(defun notmuch-search-markup-thread-ids ()
(save-excursion