Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / b0 / 7f09c5cbccbf69ecad46165a6bd56fda52f4b8
1 Return-Path: <markwalters1009@gmail.com>\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 arlo.cworth.org (Postfix) with ESMTP id A46296DE178A\r
6  for <notmuch@notmuchmail.org>; Sat, 24 Oct 2015 16:09:47 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.084\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.084 tagged_above=-999 required=5 tests=[AWL=0.486,\r
12   DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13  FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
14  RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
15  autolearn=disabled\r
16 Received: from arlo.cworth.org ([127.0.0.1])\r
17  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
18  with ESMTP id x_5opMA7Hvim for <notmuch@notmuchmail.org>;\r
19  Sat, 24 Oct 2015 16:09:45 -0700 (PDT)\r
20 Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com\r
21  [209.85.212.173])\r
22  by arlo.cworth.org (Postfix) with ESMTPS id 87D1D6DE176A\r
23  for <notmuch@notmuchmail.org>; Sat, 24 Oct 2015 16:09:45 -0700 (PDT)\r
24 Received: by wicfx6 with SMTP id fx6so71134821wic.1\r
25  for <notmuch@notmuchmail.org>; Sat, 24 Oct 2015 16:09:43 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27  h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
28  bh=YO6+MEks+JCsrrVgoVPHqq3ReCq/UfIer8VVuEt1dJM=;\r
29  b=x2JnaAuwMwsx++wiGz5vB0xu9NauLXjNjbOBz3jkqoeiXpA1p3ecbcHbqNfYEB/1/8\r
30  PaxCR09ELoK45cjnVIXU3Iu7exHrLZcU4PpjJtNCS6HcAnKsgyXOoVq36zBcF57GIl0y\r
31  yADWsqKbK29wtjqKSLhh6mWG38riXO0KsCXJy01Oq1FBk6ksSOYh6GURMxl5xJtRx1s/\r
32  RN88TaCFm7aXoub+alRkz3V5356C1BKa1N8Ytq2HGMXcdgsIQHBZcLMCq/Pr8g/6KhI4\r
33  B4NCr/FCBiHTsniy8fLYdiaJS4M2nnfysGJxAp6Is+ZZMzjMWfkjM5yhGjI47LtI8475\r
34  tIGw==\r
35 X-Received: by 10.180.198.142 with SMTP id jc14mr12176696wic.64.1445728183523;\r
36   Sat, 24 Oct 2015 16:09:43 -0700 (PDT)\r
37 Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
38  by smtp.gmail.com with ESMTPSA id q204sm1199336wmg.4.2015.10.24.16.09.42\r
39  (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
40  Sat, 24 Oct 2015 16:09:42 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH] Fix non internal cases for notmuch-address-command\r
44 Date: Sun, 25 Oct 2015 00:09:36 +0100\r
45 Message-Id: <1445728176-5168-1-git-send-email-markwalters1009@gmail.com>\r
46 X-Mailer: git-send-email 2.1.4\r
47 In-Reply-To: <87io5wkvb5.fsf@zancas.localnet>\r
48 References: <87io5wkvb5.fsf@zancas.localnet>\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.20\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53  <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
55  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
60  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Sat, 24 Oct 2015 23:09:47 -0000\r
62 \r
63 This makes tab completion do nothing when notmuch-address-command is\r
64 nil.\r
65 \r
66 It also stops company mode from being used when an external command is\r
67 specified, which was giving rise to some strange behaviour.\r
68 ---\r
69 \r
70 This patch is only really a 3 line patch (if you do a word-diff): the\r
71 rest is a whitespace change.\r
72 \r
73 Best wishes\r
74 \r
75 Mark\r
76 \r
77 emacs/notmuch-address.el | 53 ++++++++++++++++++++++++------------------------\r
78  emacs/notmuch-mua.el     |  1 +\r
79  2 files changed, 28 insertions(+), 26 deletions(-)\r
80 \r
81 diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el\r
82 index 2a748ec..d82c2aa 100644\r
83 --- a/emacs/notmuch-address.el\r
84 +++ b/emacs/notmuch-address.el\r
85 @@ -98,32 +98,33 @@ (defun notmuch-address-options (original)\r
86      (process-lines notmuch-address-command original))))\r
87  \r
88  (defun notmuch-address-expand-name ()\r
89 -  (let* ((end (point))\r
90 -        (beg (save-excursion\r
91 -               (re-search-backward "\\(\\`\\|[\n:,]\\)[ \t]*")\r
92 -               (goto-char (match-end 0))\r
93 -               (point)))\r
94 -        (orig (buffer-substring-no-properties beg end))\r
95 -        (completion-ignore-case t)\r
96 -        (options (with-temp-message "Looking for completion candidates..."\r
97 -                   (notmuch-address-options orig)))\r
98 -        (num-options (length options))\r
99 -        (chosen (cond\r
100 -                 ((eq num-options 0)\r
101 -                  nil)\r
102 -                 ((eq num-options 1)\r
103 -                  (car options))\r
104 -                 (t\r
105 -                  (funcall notmuch-address-selection-function\r
106 -                           (format "Address (%s matches): " num-options)\r
107 -                           (cdr options) (car options))))))\r
108 -    (if chosen\r
109 -       (progn\r
110 -         (push chosen notmuch-address-history)\r
111 -         (delete-region beg end)\r
112 -         (insert chosen))\r
113 -      (message "No matches.")\r
114 -      (ding))))\r
115 +  (when notmuch-address-command\r
116 +    (let* ((end (point))\r
117 +          (beg (save-excursion\r
118 +                 (re-search-backward "\\(\\`\\|[\n:,]\\)[ \t]*")\r
119 +                 (goto-char (match-end 0))\r
120 +                 (point)))\r
121 +          (orig (buffer-substring-no-properties beg end))\r
122 +          (completion-ignore-case t)\r
123 +          (options (with-temp-message "Looking for completion candidates..."\r
124 +                     (notmuch-address-options orig)))\r
125 +          (num-options (length options))\r
126 +          (chosen (cond\r
127 +                   ((eq num-options 0)\r
128 +                    nil)\r
129 +                   ((eq num-options 1)\r
130 +                    (car options))\r
131 +                   (t\r
132 +                    (funcall notmuch-address-selection-function\r
133 +                             (format "Address (%s matches): " num-options)\r
134 +                             (cdr options) (car options))))))\r
135 +      (if chosen\r
136 +         (progn\r
137 +           (push chosen notmuch-address-history)\r
138 +           (delete-region beg end)\r
139 +           (insert chosen))\r
140 +       (message "No matches.")\r
141 +       (ding)))))\r
142  \r
143  ;; Copied from `w3m-which-command'.\r
144  (defun notmuch-address-locate-command (command)\r
145 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
146 index 3feea29..63fc8db 100644\r
147 --- a/emacs/notmuch-mua.el\r
148 +++ b/emacs/notmuch-mua.el\r
149 @@ -280,6 +280,7 @@ (define-derived-mode notmuch-message-mode message-mode "Message[Notmuch]"\r
150        (setq message-completion-alist\r
151             (push notmuch-address-message-alist-member message-completion-alist))))\r
152    (when (and notmuch-message-use-company\r
153 +            (eq notmuch-address-command 'internal)\r
154              (require 'company nil t))\r
155      (notmuch-company-setup)))\r
156  \r
157 -- \r
158 2.1.4\r
159 \r