unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: notmuch@notmuchmail.org
Subject: [PATCH -V3] notmuch: Add search mode hook
Date: Thu, 19 Nov 2009 11:40:54 +0530	[thread overview]
Message-ID: <1258611054-3888-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> (raw)

This patch add notmuch-search-hook that gets run when we
after displaying search results


Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc:Keith Packard <keithp@keithp.com>

---
 notmuch.el |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 706e9f3..1fc54c3 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -654,6 +654,12 @@ view, (remove the \"inbox\" tag from each), with
   :options '(goto-address)
   :group 'notmuch)
 
+(defcustom notmuch-search-hook nil
+  "List of functions to call when notmuch displays the search results."
+  :type 'hook
+  :options '(hl-line-mode)
+  :group 'notmuch)
+
 ; Make show mode a bit prettier, highlighting URLs and using word wrap
 
 (defun notmuch-show-pretty-hook ()
@@ -661,6 +667,9 @@ view, (remove the \"inbox\" tag from each), with
   (visual-line-mode))
 
 (add-hook 'notmuch-show-hook 'notmuch-show-pretty-hook)
+(add-hook 'notmuch-search-hook
+	  (lambda()
+	    (hl-line-mode 1) ))
 
 (defun notmuch-show (thread-id &optional parent-buffer)
   "Run \"notmuch show\" with the given thread ID and display results.
@@ -911,7 +920,8 @@ This function advances point to the next line when finished."
 	    (call-process "notmuch" nil t nil "search" "--sort=oldest-first" query)
 	  (call-process "notmuch" nil t nil "search" "--sort=newest-first" query))
 	(notmuch-search-markup-thread-ids)
-	))))
+	))
+    (run-hooks 'notmuch-search-hook)))
 
 (defun notmuch-search-refresh-view ()
   "Refresh the current view.
-- 
1.6.5.2.74.g610f9

             reply	other threads:[~2009-11-19  6:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19  6:10 Aneesh Kumar K.V [this message]
2009-11-19 15:09 ` [PATCH -V3] notmuch: Add search mode hook Keith Packard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1258611054-3888-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).