From 306e19f5ddec1b10a0e99ccc54823544187e7ac3 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 5 Nov 2009 15:02:20 -0800 Subject: [PATCH] notmuch show: Move subject from one-line summary down to its own line. And change the display code in emacs to display the one-line summary in inverse video. --- notmuch.c | 9 ++++----- notmuch.el | 8 +++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/notmuch.c b/notmuch.c index b20b4065..5dce6521 100644 --- a/notmuch.c +++ b/notmuch.c @@ -913,7 +913,6 @@ _get_one_line_summary (void *ctx, notmuch_message_t *message) const char *from; time_t date; const char *relative_date; - const char *subject; const char *tags; from = notmuch_message_get_header (message, "from"); @@ -921,12 +920,10 @@ _get_one_line_summary (void *ctx, notmuch_message_t *message) date = notmuch_message_get_date (message); relative_date = _format_relative_date (ctx, date); - subject = notmuch_message_get_header (message, "subject"); - tags = _get_tags_as_string (ctx, message); - return talloc_asprintf (ctx, "%s (%s) %s (%s)", - from, relative_date, subject, tags); + return talloc_asprintf (ctx, "%s (%s) (%s)", + from, relative_date, tags); } static void @@ -1118,6 +1115,8 @@ show_command (void *ctx, unused (int argc), unused (char *argv[])) printf ("%s\n", _get_one_line_summary (local, message)); + printf ("%s\n", notmuch_message_get_header (message, "subject")); + for (i = 0; i < ARRAY_SIZE (headers); i++) { name = headers[i]; value = notmuch_message_get_header (message, name); diff --git a/notmuch.el b/notmuch.el index 592c5ab5..4e649d44 100644 --- a/notmuch.el +++ b/notmuch.el @@ -436,9 +436,15 @@ which this thread was originally shown." (defun notmuch-show-markup-header () (re-search-forward notmuch-show-header-begin-regexp) - (next-line 2) + (forward-line 1) (beginning-of-line) (let ((beg (point))) + (end-of-line) + ; Inverse video for subject + (overlay-put (make-overlay beg (point)) 'face '((cons :inverse-video t))) + (beginning-of-line) + (forward-line 2) + (set 'beg (point)) (re-search-forward notmuch-show-header-end-regexp) (overlay-put (make-overlay beg (match-beginning 0)) 'invisible 'notmuch-show-header))) -- 2.26.2