unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Servilio Afre Puentes <servilio@gmail.com>
To: notmuch <notmuch@notmuchmail.org>
Subject: [PATCH] Try to provide search buffers with titles from  notmuch-folders.
Date: Thu, 15 Apr 2010 08:16:09 -0400	[thread overview]
Message-ID: <r2sb22065d01004150516jf099f3dcw180a7db0dc972c76@mail.gmail.com> (raw)

---
 emacs/notmuch.el |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index be09f42..17e0e86 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -696,6 +696,15 @@ characters as well as `_.+-'.
     (apply 'notmuch-call-notmuch-process "tag"
 	   (append action-split (list notmuch-search-query-string) nil))))

+(defun notmuch-search-buffer-title (query)
+  "Returns the title for a buffer with notmuch search results."
+  (let ((folder (car (rassoc query notmuch-folders))))
+       (if folder
+	   (concat "*notmuch-folder-" folder "*")
+	 (concat "*notmuch-search-" query "*"))
+       )
+)
+
 ;;;###autoload
 (defun notmuch-search (query &optional oldest-first target-thread target-line)
   "Run \"notmuch search\" with the given query string and display results.
@@ -708,7 +717,7 @@ The optional parameters are used as follows:
   target-line: The line number to move to if the target thread does not
                appear in the search results."
   (interactive "sNotmuch search: ")
-  (let ((buffer (get-buffer-create (concat "*notmuch-search-" query "*"))))
+  (let ((buffer (get-buffer-create (notmuch-search-buffer-title query))))
     (switch-to-buffer buffer)
     (notmuch-search-mode)
     (set 'notmuch-search-query-string query)
-- 
1.7.0.4

             reply	other threads:[~2010-04-15 12:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-15 12:16 Servilio Afre Puentes [this message]
2010-04-15 13:42 ` [PATCH] Try to provide search buffers with titles from notmuch-folders David Bremner
2010-04-19  4:02 ` Servilio Afre Puentes

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=r2sb22065d01004150516jf099f3dcw180a7db0dc972c76@mail.gmail.com \
    --to=servilio@gmail.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).