From 817502f9fe8dd907318a26c31f1347c080a95bc6 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 16 Mar 2012 23:13:12 +2000 Subject: [PATCH] [PATCH] emacs: Fix search tab completion in terminals --- c9/8df346eba6ace7dbc8fa15094c9bc13f374d98 | 100 ++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 c9/8df346eba6ace7dbc8fa15094c9bc13f374d98 diff --git a/c9/8df346eba6ace7dbc8fa15094c9bc13f374d98 b/c9/8df346eba6ace7dbc8fa15094c9bc13f374d98 new file mode 100644 index 000000000..8642e325d --- /dev/null +++ b/c9/8df346eba6ace7dbc8fa15094c9bc13f374d98 @@ -0,0 +1,100 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 59228431FAF + for ; Thu, 15 Mar 2012 20:13:32 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 5VONQQgdxtMo for ; + Thu, 15 Mar 2012 20:13:31 -0700 (PDT) +Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU + [18.7.68.35]) + by olra.theworths.org (Postfix) with ESMTP id BDE6A431FAE + for ; Thu, 15 Mar 2012 20:13:31 -0700 (PDT) +X-AuditID: 12074423-b7f9c6d0000008c3-7c-4f62afdb4b15 +Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) + by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP + id 46.19.02243.BDFA26F4; Thu, 15 Mar 2012 23:13:31 -0400 (EDT) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q2G3DU9P022629; + Thu, 15 Mar 2012 23:13:30 -0400 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q2G3DTxP027209 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Thu, 15 Mar 2012 23:13:30 -0400 (EDT) +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) + (envelope-from ) + id 1S8Nbd-0001y5-Bz; Thu, 15 Mar 2012 23:13:29 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs: Fix search tab completion in terminals +Date: Thu, 15 Mar 2012 23:13:12 -0400 +Message-Id: <1331867592-7535-1-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.7.2 +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFprNIsWRmVeSWpSXmKPExsUixG6nrnt7fZK/wZHV/BbXb85kdmD0eLbq + FnMAYxSXTUpqTmZZapG+XQJXxr5te1gLbnBVLL3fzdjAeIiji5GTQ0LARGLP5GnsELaYxIV7 + 69m6GLk4hAT2MUpsOrSKEcLZwCjxomEPVOYkk0TX13WsEM5mRolPKx4xgvSzCWhIbNu/HMwW + EZCW2Hl3NlARBwezgJrEny4VkLCwgJ3Eok2nwdaxCKhKzL3SCVbOK2Av8e76cagzFCRmTLnC + OIGRdwEjwypG2ZTcKt3cxMyc4tRk3eLkxLy81CJdM73czBK91JTSTYzgMHBR3sH456DSIUYB + DkYlHt5V/En+QqyJZcWVuYcYJTmYlER5jZYBhfiS8lMqMxKLM+KLSnNSiw8xSnAwK4nwZhgk + +gvxpiRWVqUW5cOkpDlYlMR5NbTe+QkJpCeWpGanphakFsFkZTg4lCR4164DGipYlJqeWpGW + mVOCkGbi4AQZzgM03BwYN0K8xQWJucWZ6RD5U4yKUuK89iAJAZBERmkeXC8sTl8xigO9Iszr + AlLFA4xxuO5XQIOZgAaXfIsDGVySiJCSamCMzvgSsO6qtobv1Ug1tmVc5bnuIj8+zvt6SEyo + 2ejj8228YhzrlwTNFNq0vtN+yRsZ4zjzQ9M/XdU8+nTuvu9OYdZ8E4vuPz1YNeX5Bzb7B0ci + n2v2Wy0M0Et8pB8/z2a6J491rWZwBk9ybsqVQ2buk3T6eNOmm85apxl8f9rjVRte3lT+4Miv + xFKckWioxVxUnAgA+Y/DOa4CAAA= +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 16 Mar 2012 03:13:32 -0000 + +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. +--- + emacs/notmuch.el | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index 99e0c93..f0afa07 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))))) +-- +1.7.7.2 + -- 2.26.2