From c311ebf090e8c77033d00e858d14c606b0ff4ab5 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 25 Oct 2013 17:30:27 +2000 Subject: [PATCH] [PATCH] emacs: Add a space after completed tag operations --- f3/6055db725594fad48983b25fb81fd7d7fd9a1a | 116 ++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 f3/6055db725594fad48983b25fb81fd7d7fd9a1a diff --git a/f3/6055db725594fad48983b25fb81fd7d7fd9a1a b/f3/6055db725594fad48983b25fb81fd7d7fd9a1a new file mode 100644 index 000000000..f9af59345 --- /dev/null +++ b/f3/6055db725594fad48983b25fb81fd7d7fd9a1a @@ -0,0 +1,116 @@ +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 129D3431FBD + for ; Thu, 24 Oct 2013 14:30:44 -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 iW1lXEqfhnI7 for ; + Thu, 24 Oct 2013 14:30:35 -0700 (PDT) +Received: from dmz-mailsec-scanner-7.mit.edu (dmz-mailsec-scanner-7.mit.edu + [18.7.68.36]) + by olra.theworths.org (Postfix) with ESMTP id B9C76431FB6 + for ; Thu, 24 Oct 2013 14:30:35 -0700 (PDT) +X-AuditID: 12074424-b7f528e0000009aa-11-5269917ad005 +Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) + by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP + id 2F.11.02474.A7199625; Thu, 24 Oct 2013 17:30:34 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id r9OLUWNK015937; + Thu, 24 Oct 2013 17:30:32 -0400 +Received: from drake.dyndns.org (26-4-172.dynamic.csail.mit.edu [18.26.4.172]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r9OLUUar007115 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Thu, 24 Oct 2013 17:30:31 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1VZSUA-00017l-R9; Thu, 24 Oct 2013 17:30:30 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs: Add a space after completed tag operations +Date: Thu, 24 Oct 2013 17:30:27 -0400 +Message-Id: <1382650227-4055-1-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.8.4.rc3 +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFprFIsWRmVeSWpSXmKPExsUixCmqrVs1MTPIYPtnbovrN2cyOzB6PFt1 + izmAMYrLJiU1J7MstUjfLoErY+6m2ywFK/grfj+QbmA8wtPFyMkhIWAi0XRuOjOELSZx4d56 + ti5GLg4hgX2MEntfTmKEcDYySnS++8MC4Rxhkpj7aCZU2VxGiYbv65hA+tkENCS27V/OCGKL + CEhL7Lw7m7WLkYODWUBN4k+XCkhYWMBJ4vHMj2DrWARUJU7NXcMOYvMK2Eu87FjCCnGGksTC + U9tYJzDyLmBkWMUom5JbpZubmJlTnJqsW5ycmJeXWqRrrpebWaKXmlK6iREUBOwuKjsYmw8p + HWIU4GBU4uHV+JAeJMSaWFZcmXuIUZKDSUmUt29CZpAQX1J+SmVGYnFGfFFpTmrxIUYJDmYl + Ed5pekA53pTEyqrUonyYlDQHi5I47y0O+yAhgfTEktTs1NSC1CKYrAwHh5IE706QoYJFqemp + FWmZOSUIaSYOTpDhPEDDD4PU8BYXJOYWZ6ZD5E8xKkqJ88qAJARAEhmleXC9sCh9xSgO9Iow + 7y2QKh5ghMN1vwIazAQ0eMqSNJDBJYkIKakGxvk/n31949rBWK3zadfxPeu+1IXM5p7z/Gjz + nSuG7hanywvits9hMDoqXe2ULcW8Yb5o0mTOsFWbv1rzKZ4SOa+kobx39626IyuSmB+tlI4U + O/qmqVb3Ms/yV0lvp6v/kEr9P0F+XfhcB+H49Vdup/tE1b1d+X/fyXOBF7ZlXqnNcJJfJyrT + uUOJpTgj0VCLuag4EQAfRzrrrQIAAA== +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: Thu, 24 Oct 2013 21:30:44 -0000 + +Previously, when a user fully completed a tag operation, they had to +press space to begin entering another tag operation. This is +different from, say, shell file name completion, which typically +inserts a space after an unambiguous completion under the assumption +that the user will want to enter more input. + +This patch tweaks `notmuch-read-tag-changes' to act more like shell +file name completion: after an unambiguous tag completion, it now +inserts a space, ready and waiting for another tagging operation from +the user. This is backwards-compatible with old habits, since there's +no harm in putting an extra space. +--- + +Just because of the context, this must be applied on top of the +currently pending tag completion series +id:"1382487721-31776-1-git-send-email-amdragon@mit.edu". The change +itself should be otherwise independent. + + emacs/notmuch-tag.el | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el +index 7b21006..8b921f1 100644 +--- a/emacs/notmuch-tag.el ++++ b/emacs/notmuch-tag.el +@@ -229,8 +229,16 @@ initial input in the minibuffer." + (set-keymap-parent map crm-local-completion-map) + (define-key map " " 'self-insert-command) + map))) +- (delete "" (completing-read-multiple prompt +- tag-list nil nil initial-input ++ (delete "" (completing-read-multiple ++ prompt ++ ;; Append the separator to each completion so when the ++ ;; user completes a tag they can immediately begin ++ ;; entering another. `completing-read-multiple' ++ ;; ultimately splits the input on crm-separator, so we ++ ;; don't need to strip this back off (we just need to ++ ;; delete "empty" entries caused by trailing spaces). ++ (mapcar (lambda (tag-op) (concat tag-op crm-separator)) tag-list) ++ nil nil initial-input + 'notmuch-read-tag-changes-history)))) + + (defun notmuch-update-tags (tags tag-changes) +-- +1.8.4.rc3 + -- 2.26.2