[PATCH] emacs: Fix search tab completion in terminals
authorAustin Clements <amdragon@MIT.EDU>
Fri, 16 Mar 2012 03:13:12 +0000 (23:13 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:32 +0000 (09:45 -0800)
c9/8df346eba6ace7dbc8fa15094c9bc13f374d98 [new file with mode: 0644]

diff --git a/c9/8df346eba6ace7dbc8fa15094c9bc13f374d98 b/c9/8df346eba6ace7dbc8fa15094c9bc13f374d98
new file mode 100644 (file)
index 0000000..8642e32
--- /dev/null
@@ -0,0 +1,100 @@
+Return-Path: <amthrax@awakening.csail.mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 59228431FAF\r
+       for <notmuch@notmuchmail.org>; Thu, 15 Mar 2012 20:13:32 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 5VONQQgdxtMo for <notmuch@notmuchmail.org>;\r
+       Thu, 15 Mar 2012 20:13:31 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU\r
+       [18.7.68.35])\r
+       by olra.theworths.org (Postfix) with ESMTP id BDE6A431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 15 Mar 2012 20:13:31 -0700 (PDT)\r
+X-AuditID: 12074423-b7f9c6d0000008c3-7c-4f62afdb4b15\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 46.19.02243.BDFA26F4; Thu, 15 Mar 2012 23:13:31 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q2G3DU9P022629; \r
+       Thu, 15 Mar 2012 23:13:30 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q2G3DTxP027209\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Thu, 15 Mar 2012 23:13:30 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amthrax@awakening.csail.mit.edu>)\r
+       id 1S8Nbd-0001y5-Bz; Thu, 15 Mar 2012 23:13:29 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: Fix search tab completion in terminals\r
+Date: Thu, 15 Mar 2012 23:13:12 -0400\r
+Message-Id: <1331867592-7535-1-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.7.2\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFprNIsWRmVeSWpSXmKPExsUixG6nrnt7fZK/wZHV/BbXb85kdmD0eLbq\r
+       FnMAYxSXTUpqTmZZapG+XQJXxr5te1gLbnBVLL3fzdjAeIiji5GTQ0LARGLP5GnsELaYxIV7\r
+       69m6GLk4hAT2MUpsOrSKEcLZwCjxomEPVOYkk0TX13WsEM5mRolPKx4xgvSzCWhIbNu/HMwW\r
+       EZCW2Hl3NlARBwezgJrEny4VkLCwgJ3Eok2nwdaxCKhKzL3SCVbOK2Av8e76cagzFCRmTLnC\r
+       OIGRdwEjwypG2ZTcKt3cxMyc4tRk3eLkxLy81CJdM73czBK91JTSTYzgMHBR3sH456DSIUYB\r
+       DkYlHt5V/En+QqyJZcWVuYcYJTmYlER5jZYBhfiS8lMqMxKLM+KLSnNSiw8xSnAwK4nwZhgk\r
+       +gvxpiRWVqUW5cOkpDlYlMR5NbTe+QkJpCeWpGanphakFsFkZTg4lCR4164DGipYlJqeWpGW\r
+       mVOCkGbi4AQZzgM03BwYN0K8xQWJucWZ6RD5U4yKUuK89iAJAZBERmkeXC8sTl8xigO9Iszr\r
+       AlLFA4xxuO5XQIOZgAaXfIsDGVySiJCSamCMzvgSsO6qtobv1Ug1tmVc5bnuIj8+zvt6SEyo\r
+       2ejj8228YhzrlwTNFNq0vtN+yRsZ4zjzQ9M/XdU8+nTuvu9OYdZ8E4vuPz1YNeX5Bzb7B0ci\r
+       n2v2Wy0M0Et8pB8/z2a6J491rWZwBk9ybsqVQ2buk3T6eNOmm85apxl8f9rjVRte3lT+4Miv\r
+       xFKckWioxVxUnAgA+Y/DOa4CAAA=\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 16 Mar 2012 03:13:32 -0000\r
+\r
+In X, Emacs distinguishes the tab key, which produces a 'tab event;\r
+from C-i, which produces a ?\t event.  However, in a terminal, these\r
+are indistinguishable and only produce a ?\t event.  In order to\r
+simplify things, Emacs automatically translates from 'tab to ?\t (see\r
+"Function key translations" in M-x describe-bindings), so functions\r
+only need to be bound to ?\t to work in all situations.\r
+\r
+Previously, the search tab completion code usedq (kbd "<tab>"), which\r
+produced the event sequence [tab], which only matched the 'tab event\r
+and hence only worked in X.  This patch changes it to (kbd "TAB"),\r
+which matches the general ?\t event and works in all situations.\r
+---\r
+ emacs/notmuch.el |    2 +-\r
+ 1 files changed, 1 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index 99e0c93..f0afa07 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -962,7 +962,7 @@ PROMPT is the string to prompt with."\r
+                                        completions)))\r
+              (t (list string)))))))\r
+       ;; this was simpler than convincing completing-read to accept spaces:\r
+-      (define-key keymap (kbd "<tab>") 'minibuffer-complete)\r
++      (define-key keymap (kbd "TAB") 'minibuffer-complete)\r
+       (let ((history-delete-duplicates t))\r
+       (read-from-minibuffer prompt nil keymap nil\r
+                             'notmuch-search-history nil nil)))))\r
+-- \r
+1.7.7.2\r
+\r