[Patch v3 06/11] perf-test: add caching of xapian database
[notmuch-archives.git] / 04 / 54b845a037e4dfdd55ed3298fc8ee347a70490
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 C023B431E84\r
6         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 05:48:41 -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: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 4J1xtZSQl3pU for <notmuch@notmuchmail.org>;\r
16         Wed, 25 Jan 2012 05:48:41 -0800 (PST)\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
18  [74.125.82.45])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  EBFCA431FBC    for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 05:48:40 -0800\r
21  (PST)\r
22 Received: by wgbdt12 with SMTP id dt12so4808711wgb.2\r
23         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 05:48:39 -0800 (PST)\r
24 MIME-Version: 1.0\r
25 Received: by 10.180.80.68 with SMTP id p4mr7402594wix.21.1327499319700;\r
26         Wed, 25 Jan 2012 05:48:39 -0800 (PST)\r
27 Received: from hotblack-desiato.hh.sledj.net\r
28         (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])\r
29         by mx.google.com with ESMTPS id m8sm1603917wia.11.2012.01.25.05.48.37\r
30         (version=TLSv1/SSLv3 cipher=OTHER);\r
31         Wed, 25 Jan 2012 05:48:38 -0800 (PST)\r
32 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
33         id 205569FF26; Wed, 25 Jan 2012 13:48:36 +0000 (GMT)\r
34 From: David Edmondson <dme@dme.org>\r
35 To: notmuch@notmuchmail.org\r
36 Subject: [PATCH 3/3] emacs: Prefer '[No Subject]' to blank subjects.\r
37 Date: Wed, 25 Jan 2012 13:48:34 +0000\r
38 Message-Id: <1327499314-7887-4-git-send-email-dme@dme.org>\r
39 X-Mailer: git-send-email 1.7.8.3\r
40 In-Reply-To: <1327499314-7887-1-git-send-email-dme@dme.org>\r
41 References: <1327496913-4946-1-git-send-email-dme@dme.org>\r
42         <1327499314-7887-1-git-send-email-dme@dme.org>\r
43 X-Gm-Message-State:\r
44  ALoCoQmXJJoAuC69naV/UWVKiehNgFoW/D2mSP9FOIOcxf2Bsq0SbGRVtUN+wH+g6IMVi6QoZgLe\r
45 X-BeenThere: notmuch@notmuchmail.org\r
46 X-Mailman-Version: 2.1.13\r
47 Precedence: list\r
48 List-Id: "Use and development of the notmuch mail system."\r
49         <notmuch.notmuchmail.org>\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
53 List-Post: <mailto:notmuch@notmuchmail.org>\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
57 X-List-Received-Date: Wed, 25 Jan 2012 13:48:42 -0000\r
58 \r
59 ---\r
60  emacs/notmuch-lib.el   |    6 ++++++\r
61  emacs/notmuch-print.el |    8 ++++++--\r
62  emacs/notmuch-show.el  |    5 ++++-\r
63  emacs/notmuch.el       |    5 +----\r
64  4 files changed, 17 insertions(+), 7 deletions(-)\r
65 \r
66 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
67 index 241fe8c..5b8a41c 100644\r
68 --- a/emacs/notmuch-lib.el\r
69 +++ b/emacs/notmuch-lib.el\r
70 @@ -130,6 +130,12 @@ the user hasn't set this variable with the old or new value."\r
71    (interactive)\r
72    (kill-buffer (current-buffer)))\r
73  \r
74 +(defun notmuch-prettify-subject (subject)\r
75 +  (if (and subject\r
76 +          (string-match "^[ \t]*$" subject))\r
77 +      (setq subject "[No Subject]"))\r
78 +  subject)\r
79 +\r
80  ;;\r
81  \r
82  (defun notmuch-common-do-stash (text)\r
83 diff --git a/emacs/notmuch-print.el b/emacs/notmuch-print.el\r
84 index 83eb525..51bb740 100644\r
85 --- a/emacs/notmuch-print.el\r
86 +++ b/emacs/notmuch-print.el\r
87 @@ -19,6 +19,8 @@\r
88  ;;\r
89  ;; Authors: David Edmondson <dme@dme.org>\r
90  \r
91 +(require 'notmuch-lib)\r
92 +\r
93  (defcustom notmuch-print-mechanism 'notmuch-print-lpr\r
94    "How should printing be done?"\r
95    :group 'notmuch\r
96 @@ -56,14 +58,16 @@ Optional OUTPUT allows passing a list of flags to muttprint."\r
97  \r
98  (defun notmuch-print-ps-print (msg)\r
99    "Print a message buffer using the ps-print package."\r
100 -  (let ((subject (plist-get (notmuch-show-get-prop :headers msg) :Subject)))\r
101 +  (let ((subject (notmuch-prettify-subject\r
102 +                 (plist-get (notmuch-show-get-prop :headers msg) :Subject))))\r
103      (rename-buffer subject t)\r
104      (ps-print-buffer)))\r
105  \r
106  (defun notmuch-print-ps-print/evince (msg)\r
107    "Preview a message buffer using ps-print and evince."\r
108    (let ((ps-file (make-temp-file "notmuch"))\r
109 -       (subject (plist-get (notmuch-show-get-prop :headers msg) :Subject)))\r
110 +       (subject (notmuch-prettify-subject\r
111 +                 (plist-get (notmuch-show-get-prop :headers msg) :Subject))))\r
112      (rename-buffer subject t)\r
113      (ps-print-buffer ps-file)\r
114      (notmuch-print-run-evince ps-file)))\r
115 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
116 index e6a5b31..c602b3e 100644\r
117 --- a/emacs/notmuch-show.el\r
118 +++ b/emacs/notmuch-show.el\r
119 @@ -985,7 +985,7 @@ buffer."\r
120        (notmuch-show-next-open-message))\r
121  \r
122      ;; Set the header line to the subject of the first open message.\r
123 -    (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject)))\r
124 +    (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject)))\r
125  \r
126      (notmuch-show-mark-read)))\r
127  \r
128 @@ -1216,6 +1216,9 @@ Some useful entries are:\r
129  (defun notmuch-show-get-depth ()\r
130    (notmuch-show-get-prop :depth))\r
131  \r
132 +(defun notmuch-show-get-pretty-subject ()\r
133 +  (notmuch-prettify-subject (notmuch-show-get-subject)))\r
134 +\r
135  (defun notmuch-show-set-tags (tags)\r
136    "Set the tags of the current message."\r
137    (notmuch-show-set-prop :tags tags)\r
138 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
139 index 3f6b977..ce1e232 100644\r
140 --- a/emacs/notmuch.el\r
141 +++ b/emacs/notmuch.el\r
142 @@ -440,10 +440,7 @@ Complete list of currently available key bindings:\r
143    "Display the currently selected thread."\r
144    (interactive "P")\r
145    (let ((thread-id (notmuch-search-find-thread-id))\r
146 -       (subject (notmuch-search-find-subject)))\r
147 -\r
148 -    (if (string-match "^[ \t]*$" subject)\r
149 -       (setq subject "[No Subject]"))\r
150 +       (subject (notmuch-prettify-subject (notmuch-search-find-subject))))\r
151  \r
152      (if (> (length thread-id) 0)\r
153         (notmuch-show thread-id\r
154 -- \r
155 1.7.8.3\r
156 \r