Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 92 / c1b8efc9459c706bb06b83df31b5979d5bca1b
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 E1A16429E34\r
6         for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 02:16:07 -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 0vCTdVz4Uj7W for <notmuch@notmuchmail.org>;\r
16         Mon, 30 Jan 2012 02:16:07 -0800 (PST)\r
17 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
18         [74.125.82.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 60188431FBC\r
21         for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 02:16:07 -0800 (PST)\r
22 Received: by werb10 with SMTP id b10so3639029wer.26\r
23         for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 02:16:06 -0800 (PST)\r
24 Received: by 10.216.133.104 with SMTP id p82mr6775390wei.6.1327918566118;\r
25         Mon, 30 Jan 2012 02:16:06 -0800 (PST)\r
26 Received: from hotblack-desiato.hh.sledj.net\r
27         (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])\r
28         by mx.google.com with ESMTPS id bj10sm29070795wib.9.2012.01.30.02.16.04\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Mon, 30 Jan 2012 02:16:05 -0800 (PST)\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
32         id 1415FA0CE8; Mon, 30 Jan 2012 10:16:03 +0000 (GMT)\r
33 From: David Edmondson <dme@dme.org>\r
34 To: notmuch@notmuchmail.org\r
35 Subject: [PATCH 1/2 v2] emacs: Stop the `truncate-string-to-width' madness.\r
36 Date: Mon, 30 Jan 2012 10:16:00 +0000\r
37 Message-Id: <1327918561-16245-2-git-send-email-dme@dme.org>\r
38 X-Mailer: git-send-email 1.7.8.3\r
39 In-Reply-To: <1327918561-16245-1-git-send-email-dme@dme.org>\r
40 References: <1327496913-4946-1-git-send-email-dme@dme.org>\r
41         <1327918561-16245-1-git-send-email-dme@dme.org>\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Mon, 30 Jan 2012 10:16:08 -0000\r
55 \r
56 There's no need to call `truncate-string-to-width' twice in this code\r
57 path.\r
58 ---\r
59  emacs/notmuch.el |   22 ++++++++++------------\r
60  1 files changed, 10 insertions(+), 12 deletions(-)\r
61 \r
62 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
63 index 72f78ed..d4d6904 100644\r
64 --- a/emacs/notmuch.el\r
65 +++ b/emacs/notmuch.el\r
66 @@ -469,18 +469,16 @@ Complete list of currently available key bindings:\r
67    (let ((thread-id (notmuch-search-find-thread-id))\r
68         (subject (notmuch-search-find-subject)))\r
69      (if (> (length thread-id) 0)\r
70 -       (notmuch-show thread-id\r
71 -                     (current-buffer)\r
72 -                     notmuch-search-query-string\r
73 -                     ;; name the buffer based on notmuch-search-find-subject\r
74 -                     (if (string-match "^[ \t]*$" subject)\r
75 -                         "[No Subject]"\r
76 -                       (truncate-string-to-width\r
77 -                        (concat "*"\r
78 -                                (truncate-string-to-width subject 32 nil nil t)\r
79 -                                "*")\r
80 -                        32 nil nil t))\r
81 -                     crypto-switch)\r
82 +       (progn\r
83 +         (if (string-match "^[ \t]*$" subject)\r
84 +             (setq subject "[No Subject]"))\r
85 +\r
86 +         (notmuch-show thread-id\r
87 +                       (current-buffer)\r
88 +                       notmuch-search-query-string\r
89 +                       ;; Name the buffer based on the subject.\r
90 +                       (concat "*" (truncate-string-to-width subject 30 nil nil t) "*")\r
91 +                       crypto-switch))\r
92        (message "End of search results."))))\r
93  \r
94  (defun notmuch-search-reply-to-thread (&optional prompt-for-sender)\r
95 -- \r
96 1.7.8.3\r
97 \r