aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Tomi Ollila <tomi.ollila@iki.fi>2014-01-27 22:23:37 +0200
committerGravatar David Bremner <david@tethera.net>2014-02-03 16:20:39 -0400
commit9c1bc977d79808fca5b4fd0c584570bd4da90bef (patch)
tree44f72e7601a047832914dee3415b62b85df75ecc /emacs
parentb220aefdf9c46f4b472a0b06a18ae7341620dcc5 (diff)
emacs: initialize ido(-completing-read) in emacs 23.[123]
Otherwise `ido-completing-read' will freeze after PROMPT is displayed.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-mua.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 00cd9808..481abd7c 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -287,6 +287,19 @@ the From: header is already filled in by notmuch."
(defvar notmuch-mua-sender-history nil)
+;; Workaround: Running `ido-completing-read' in emacs 23.1, 23.2 and 23.3
+;; without some explicit initialization fill freeze the operation.
+;; Hence, we advice `ido-completing-read' to ensure required initialization
+;; is done.
+(if (and (= emacs-major-version 23) (< emacs-minor-version 4))
+ (defadvice ido-completing-read (before notmuch-ido-mode-init activate)
+ (ido-init-completion-maps)
+ (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
+ (add-hook 'choose-completion-string-functions
+ 'ido-choose-completion-string)
+ (ad-disable-advice 'ido-completing-read 'before 'notmuch-ido-mode-init)
+ (ad-activate 'ido-completing-read)))
+
(defun notmuch-mua-prompt-for-sender ()
(interactive)
(let (name addresses one-name-only)