notmuch.el: controlling what does and doesn't get expanded in searches
[notmuch-archives.git] / 1e / a5dfeff1d8a17934aa2043b3b3fbd12127847e
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 7825C431FBC\r
6         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 05:08:40 -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 u07wwhlTBDBZ for <notmuch@notmuchmail.org>;\r
16         Wed, 25 Jan 2012 05:08:39 -0800 (PST)\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
18         [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 95002429E2F\r
21         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 05:08:39 -0800 (PST)\r
22 Received: by wibhi8 with SMTP id hi8so2463588wib.26\r
23         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 05:08:38 -0800 (PST)\r
24 MIME-Version: 1.0\r
25 Received: by 10.180.92.101 with SMTP id cl5mr27908287wib.21.1327496918508;\r
26         Wed, 25 Jan 2012 05:08:38 -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 em13sm24258528wid.7.2012.01.25.05.08.35\r
30         (version=TLSv1/SSLv3 cipher=OTHER);\r
31         Wed, 25 Jan 2012 05:08:37 -0800 (PST)\r
32 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
33         id 7E8A09FE6A; Wed, 25 Jan 2012 13:08:34 +0000 (GMT)\r
34 From: David Edmondson <dme@dme.org>\r
35 To: notmuch@notmuchmail.org\r
36 Subject: [PATCH 1/3] emacs: Stop the `truncate-string-to-width' madness.\r
37 Date: Wed, 25 Jan 2012 13:08:31 +0000\r
38 Message-Id: <1327496913-4946-2-git-send-email-dme@dme.org>\r
39 X-Mailer: git-send-email 1.7.8.3\r
40 In-Reply-To: <1327496913-4946-1-git-send-email-dme@dme.org>\r
41 References: <1327496913-4946-1-git-send-email-dme@dme.org>\r
42 X-Gm-Message-State:\r
43  ALoCoQlmMU5ofCDveNIwW6eHvcxJMCixHG5Yi3Pau+4T08XDGRT206lFw764eNZpjwD8cTyV6yyP\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Wed, 25 Jan 2012 13:08:40 -0000\r
57 \r
58 There's no need to call `truncate-string-to-width' twice in this code\r
59 path.\r
60 ---\r
61  emacs/notmuch.el |   14 ++++++--------\r
62  1 files changed, 6 insertions(+), 8 deletions(-)\r
63 \r
64 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
65 index 3ec0816..3f6b977 100644\r
66 --- a/emacs/notmuch.el\r
67 +++ b/emacs/notmuch.el\r
68 @@ -441,18 +441,16 @@ Complete list of currently available key bindings:\r
69    (interactive "P")\r
70    (let ((thread-id (notmuch-search-find-thread-id))\r
71         (subject (notmuch-search-find-subject)))\r
72 +\r
73 +    (if (string-match "^[ \t]*$" subject)\r
74 +       (setq subject "[No Subject]"))\r
75 +\r
76      (if (> (length thread-id) 0)\r
77         (notmuch-show thread-id\r
78                       (current-buffer)\r
79                       notmuch-search-query-string\r
80 -                     ;; name the buffer based on notmuch-search-find-subject\r
81 -                     (if (string-match "^[ \t]*$" subject)\r
82 -                         "[No Subject]"\r
83 -                       (truncate-string-to-width\r
84 -                        (concat "*"\r
85 -                                (truncate-string-to-width subject 32 nil nil t)\r
86 -                                "*")\r
87 -                        32 nil nil t))\r
88 +                     ;; Name the buffer based on the subject.\r
89 +                     (concat "*" (truncate-string-to-width subject 30 nil nil t) "*")\r
90                       crypto-switch)\r
91        (message "End of search results."))))\r
92  \r
93 -- \r
94 1.7.8.3\r
95 \r