From 701a787627af52cda39887f6de24efa01ce5c950 Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Thu, 19 Nov 2009 11:40:54 +0530 Subject: [PATCH] [notmuch] [PATCH -V3] notmuch: Add search mode hook --- 7b/917d4849a379a30c5eeadef0a87bfa16f322ac | 100 ++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 7b/917d4849a379a30c5eeadef0a87bfa16f322ac diff --git a/7b/917d4849a379a30c5eeadef0a87bfa16f322ac b/7b/917d4849a379a30c5eeadef0a87bfa16f322ac new file mode 100644 index 000000000..40d1520c9 --- /dev/null +++ b/7b/917d4849a379a30c5eeadef0a87bfa16f322ac @@ -0,0 +1,100 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 9B5B0431FBC + for ; Wed, 18 Nov 2009 22:11:03 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id AEB7q4sH0JGN for ; + Wed, 18 Nov 2009 22:11:02 -0800 (PST) +Received: from e23smtp04.au.ibm.com (e23smtp04.au.ibm.com [202.81.31.146]) + by olra.theworths.org (Postfix) with ESMTP id 4939B431FAE + for ; Wed, 18 Nov 2009 22:11:02 -0800 (PST) +Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) + by e23smtp04.au.ibm.com (8.14.3/8.13.1) with ESMTP id nAJ67oWS006270 + for ; Thu, 19 Nov 2009 17:07:50 +1100 +Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) + by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id + nAJ67b5t1298602 + for ; Thu, 19 Nov 2009 17:07:37 +1100 +Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) + by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id + nAJ6AxE9031821 + for ; Thu, 19 Nov 2009 17:11:00 +1100 +Received: from localhost.localdomain (N20wks267599wss.in.ibm.com + [9.124.31.111]) + by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id + nAJ6AvUh031796; Thu, 19 Nov 2009 17:10:58 +1100 +From: "Aneesh Kumar K.V" +To: notmuch@notmuchmail.org +Date: Thu, 19 Nov 2009 11:40:54 +0530 +Message-Id: <1258611054-3888-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> +X-Mailer: git-send-email 1.6.5.2.74.g610f9 +Subject: [notmuch] [PATCH -V3] notmuch: Add search mode hook +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.12 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 19 Nov 2009 06:11:03 -0000 + +This patch add notmuch-search-hook that gets run when we +after displaying search results + + +Signed-off-by: Aneesh Kumar K.V +Cc:Keith Packard + +--- + 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 + -- 2.26.2