[PATCH 1/4] configure: SC2006: Use $(..) instead of deprecated `..`
[notmuch-archives.git] / ea / 28c1b8c38129de2d964a0c4f79a243a58a3ec9
1 Return-Path: <dme@dme.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 8DB5340DF1C\r
6         for <notmuch@notmuchmail.org>; Mon, 22 Nov 2010 03:54:47 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id Ou7fOGISRO50 for <notmuch@notmuchmail.org>;\r
16         Mon, 22 Nov 2010 03:54:37 -0800 (PST)\r
17 Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
18         [74.125.82.181])\r
19         by olra.theworths.org (Postfix) with ESMTP id 430EE40DF1B\r
20         for <notmuch@notmuchmail.org>; Mon, 22 Nov 2010 03:54:37 -0800 (PST)\r
21 Received: by wyb36 with SMTP id 36so2377312wyb.26\r
22         for <notmuch@notmuchmail.org>; Mon, 22 Nov 2010 03:54:36 -0800 (PST)\r
23 Received: by 10.216.180.85 with SMTP id i63mr735989wem.53.1290426874783;\r
24         Mon, 22 Nov 2010 03:54:34 -0800 (PST)\r
25 Received: from ut.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com\r
26         [81.149.164.25])\r
27         by mx.google.com with ESMTPS id x3sm2222809wes.22.2010.11.22.03.54.33\r
28         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
29         Mon, 22 Nov 2010 03:54:34 -0800 (PST)\r
30 Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
31         id 265E0594058; Mon, 22 Nov 2010 11:51:06 +0000 (GMT)\r
32 From: David Edmondson <dme@dme.org>\r
33 To: notmuch@notmuchmail.org\r
34 Subject: [PATCH] emacs: Add `notmuch-jump-to-recent-buffer'.\r
35 Date: Mon, 22 Nov 2010 11:51:04 +0000\r
36 Message-Id: <1290426664-15745-1-git-send-email-dme@dme.org>\r
37 X-Mailer: git-send-email 1.7.2.3\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Mon, 22 Nov 2010 11:54:47 -0000\r
51 \r
52 >From a Carl Worth idea: Add `notmuch-jump-to-recent-buffer', which\r
53 will select the most recently used notmuch buffer (search, show or\r
54 hello). If no recent buffer is found, run `notmuch'.\r
55 \r
56 It is expected that the user will global bind this command to a key\r
57 sequence.\r
58 ---\r
59  emacs/notmuch.el |   18 ++++++++++++++++++\r
60  1 files changed, 18 insertions(+), 0 deletions(-)\r
61 \r
62 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
63 index e8d4d98..67271d1 100644\r
64 --- a/emacs/notmuch.el\r
65 +++ b/emacs/notmuch.el\r
66 @@ -962,6 +962,24 @@ current search results AND that are tagged with the given tag."\r
67    (interactive)\r
68    (notmuch-hello))\r
69  \r
70 +;;;###autoload\r
71 +(defun notmuch-jump-to-recent-buffer ()\r
72 +  "Jump to the most recent notmuch buffer (search, show or hello).\r
73 +\r
74 +If no recent buffer is found, run `notmuch'."\r
75 +  (interactive)\r
76 +  (let ((last\r
77 +        (loop for buffer in (buffer-list)\r
78 +              if (progn\r
79 +                   (set-buffer buffer)\r
80 +                   (or (eq major-mode 'notmuch-show-mode)\r
81 +                       (eq major-mode 'notmuch-search-mode)\r
82 +                       (eq major-mode 'notmuch-hello-mode)))\r
83 +              return buffer)))\r
84 +    (if last\r
85 +       (switch-to-buffer last)\r
86 +      (notmuch))))\r
87 +\r
88  (setq mail-user-agent 'notmuch-user-agent)\r
89  \r
90  (provide 'notmuch)\r
91 -- \r
92 1.7.2.3\r
93 \r