Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 25 / 2e0b4c4361413679cb43f61531ffda61b15b07
1 Return-Path: <too@guru-group.fi>\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 AA228431FBF\r
6         for <notmuch@notmuchmail.org>; Mon, 27 Jan 2014 12:23:54 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 tb-fHVb1MIYk for <notmuch@notmuchmail.org>;\r
16         Mon, 27 Jan 2014 12:23:45 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 6B297431FBC\r
19         for <notmuch@notmuchmail.org>; Mon, 27 Jan 2014 12:23:45 -0800 (PST)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 2785310008B; Mon, 27 Jan 2014 22:23:39 +0200 (EET)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH 1/1] emacs: initialize ido(-completing-read) in emacs 23.[123]\r
25 Date: Mon, 27 Jan 2014 22:23:37 +0200\r
26 Message-Id: <1390854217-7281-1-git-send-email-tomi.ollila@iki.fi>\r
27 X-Mailer: git-send-email 1.8.0\r
28 In-Reply-To: <m24n4q5xf9.fsf@guru.guru-group.fi>\r
29 References: <m24n4q5xf9.fsf@guru.guru-group.fi>\r
30 Cc: tomi.ollila@iki.fi\r
31 X-BeenThere: notmuch@notmuchmail.org\r
32 X-Mailman-Version: 2.1.13\r
33 Precedence: list\r
34 List-Id: "Use and development of the notmuch mail system."\r
35         <notmuch.notmuchmail.org>\r
36 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
37         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
38 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
39 List-Post: <mailto:notmuch@notmuchmail.org>\r
40 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
41 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
43 X-List-Received-Date: Mon, 27 Jan 2014 20:23:54 -0000\r
44 \r
45 Otherwise `ido-completing-read' will freeze after PROMPT is displayed.\r
46 ---\r
47 \r
48 I tested this on emacs 23.1 & 24.3.\r
49 \r
50 I also tested this by adding (sit-for 2.0) inside the advice -- this\r
51 lead to the addition of (ad-activate 'ido-completing-read (*)).\r
52 \r
53 (*) http://lists.gnu.org/archive/html/emacs-pretest-bug/2003-02/msg00087.html\r
54 \r
55  emacs/notmuch-mua.el | 13 +++++++++++++\r
56  1 file changed, 13 insertions(+)\r
57 \r
58 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
59 index 00cd980..481abd7 100644\r
60 --- a/emacs/notmuch-mua.el\r
61 +++ b/emacs/notmuch-mua.el\r
62 @@ -287,6 +287,19 @@ the From: header is already filled in by notmuch."\r
63  \r
64  (defvar notmuch-mua-sender-history nil)\r
65  \r
66 +;; Workaround: Running `ido-completing-read' in emacs 23.1, 23.2 and 23.3\r
67 +;; without some explicit initialization fill freeze the operation.\r
68 +;; Hence, we advice `ido-completing-read' to ensure required initialization\r
69 +;; is done.\r
70 +(if (and (= emacs-major-version 23) (< emacs-minor-version 4))\r
71 +    (defadvice ido-completing-read (before notmuch-ido-mode-init activate)\r
72 +      (ido-init-completion-maps)\r
73 +      (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)\r
74 +      (add-hook 'choose-completion-string-functions\r
75 +               'ido-choose-completion-string)\r
76 +      (ad-disable-advice 'ido-completing-read 'before 'notmuch-ido-mode-init)\r
77 +      (ad-activate 'ido-completing-read)))\r
78 +\r
79  (defun notmuch-mua-prompt-for-sender ()\r
80    (interactive)\r
81    (let (name addresses one-name-only)\r
82 -- \r
83 1.8.0\r
84 \r