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
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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
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
45 Otherwise `ido-completing-read' will freeze after PROMPT is displayed.
\r
48 I tested this on emacs 23.1 & 24.3.
\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
53 (*) http://lists.gnu.org/archive/html/emacs-pretest-bug/2003-02/msg00087.html
\r
55 emacs/notmuch-mua.el | 13 +++++++++++++
\r
56 1 file changed, 13 insertions(+)
\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
64 (defvar notmuch-mua-sender-history nil)
\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
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
79 (defun notmuch-mua-prompt-for-sender ()
\r
81 (let (name addresses one-name-only)
\r