From cd34c34bdc3dacd25be164ccc3b912f0b7f75f3f Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Fri, 25 Oct 2013 09:04:13 +0100 Subject: [PATCH] Re: [PATCH] emacs: Add a space after completed tag operations --- 68/c4f6e556e0a62a9d166a3b719419df3d9a2f2e | 127 ++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 68/c4f6e556e0a62a9d166a3b719419df3d9a2f2e diff --git a/68/c4f6e556e0a62a9d166a3b719419df3d9a2f2e b/68/c4f6e556e0a62a9d166a3b719419df3d9a2f2e new file mode 100644 index 000000000..85bd4cdc2 --- /dev/null +++ b/68/c4f6e556e0a62a9d166a3b719419df3d9a2f2e @@ -0,0 +1,127 @@ +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 9A39B431FC2 + for ; Fri, 25 Oct 2013 01:04:29 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 DxMiC2jp3JlV for ; + Fri, 25 Oct 2013 01:04:22 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 20E10431FB6 + for ; Fri, 25 Oct 2013 01:04:22 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1VZcNT-0002ML-0H; Fri, 25 Oct 2013 09:04:18 +0100 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1VZcNS-0003WJ-Lw; Fri, 25 Oct 2013 09:04:14 +0100 +From: Mark Walters +To: Austin Clements , notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: Add a space after completed tag operations +In-Reply-To: <1382650227-4055-1-git-send-email-amdragon@mit.edu> +References: <1382650227-4055-1-git-send-email-amdragon@mit.edu> +User-Agent: Notmuch/0.16 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Fri, 25 Oct 2013 09:04:13 +0100 +Message-ID: <8738np7p4y.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 93.97.24.31 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: cdaa836c7a501d274c4f9765501ab852 (of first 20000 bytes) +X-SpamAssassin-Score: 0.0 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored 0.0 points. Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * 0.0 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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, 25 Oct 2013 08:04:29 -0000 + + +Tested and LGTM +1 + +Best wishes + +Mark + +On Thu, 24 Oct 2013, Austin Clements wrote: +> 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 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2