From: Austin Clements Date: Fri, 16 Mar 2012 03:13:12 +0000 (-0400) Subject: emacs: Fix search tab completion in terminals X-Git-Tag: 0.13_rc1~140 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=0eaf4a21dda9519cc08db5b49126b02c4c6b5682 emacs: Fix search tab completion in terminals In X, Emacs distinguishes the tab key, which produces a 'tab event; from C-i, which produces a ?\t event. However, in a terminal, these are indistinguishable and only produce a ?\t event. In order to simplify things, Emacs automatically translates from 'tab to ?\t (see "Function key translations" in M-x describe-bindings), so functions only need to be bound to ?\t to work in all situations. Previously, the search tab completion code usedq (kbd ""), which produced the event sequence [tab], which only matched the 'tab event and hence only worked in X. This patch changes it to (kbd "TAB"), which matches the general ?\t event and works in all situations. --- diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 99e0c93a..f0afa072 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -962,7 +962,7 @@ PROMPT is the string to prompt with." completions))) (t (list string))))))) ;; this was simpler than convincing completing-read to accept spaces: - (define-key keymap (kbd "") 'minibuffer-complete) + (define-key keymap (kbd "TAB") 'minibuffer-complete) (let ((history-delete-duplicates t)) (read-from-minibuffer prompt nil keymap nil 'notmuch-search-history nil nil)))))