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 EE1CD4196F0 for ; Thu, 15 Apr 2010 05:16:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001] autolearn=ham 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 HIxSRnVaXZuw for ; Thu, 15 Apr 2010 05:16:10 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) by olra.theworths.org (Postfix) with ESMTP id DF353431FC1 for ; Thu, 15 Apr 2010 05:16:09 -0700 (PDT) Received: by wyj26 with SMTP id 26so582999wyj.26 for ; Thu, 15 Apr 2010 05:16:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=pCvtkoEOS5eS5I1azm73Nv6LyLppT289MCdXDPny8fE=; b=TuuVhAMVght8xOY0sD+OoGBtxfXZjzyfUnCUxkKMrb4hp4B1RwZiuX0LxeCWJu2/A7 8xkfzJg0bRmpnU32TUQ8hMeOX+xCKwEWKFWWpJZSVD0OfaijaOfU1ao1I5n+b6Ms/CvQ yuz74R8KF6HKS90Jtm1nvvZRbFjV3u8LAs+Vg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=UgDhYRvW07ab301Jsh8S+CAQHekHLlvnyXPSmS4ft2wAvIA70WnpxyvItX9VjYEnWT 9BxDZUGc2e4NlCKCb/2KBmRV+FrG+nmu4d1eHT3dsul1lKeCMVB0UPRF4iqs9R9CExow hUOWvJ231YhP6QChNkLjlSjZxM6z9YeWLotkA= MIME-Version: 1.0 Received: by 10.216.89.140 with HTTP; Thu, 15 Apr 2010 05:16:09 -0700 (PDT) Date: Thu, 15 Apr 2010 08:16:09 -0400 Received: by 10.216.164.21 with SMTP id b21mr3463wel.46.1271333769069; Thu, 15 Apr 2010 05:16:09 -0700 (PDT) Message-ID: Subject: [PATCH] Try to provide search buffers with titles from notmuch-folders. From: Servilio Afre Puentes To: notmuch Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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, 15 Apr 2010 12:16:11 -0000 --- 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