From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 19CD2431FC2 for ; Fri, 25 Oct 2013 00:13:49 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 On3siqpaOiqB for ; Fri, 25 Oct 2013 00:13:40 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 89E91431FB6 for ; Fri, 25 Oct 2013 00:13:40 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 96108100217; Fri, 25 Oct 2013 10:13:32 +0300 (EEST) From: Tomi Ollila 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+115~g11c2ff5 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain 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 07:13:49 -0000 On Fri, Oct 25 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. > --- LGTM. Tested by hand-editing "(mapcar ...)" part to the code (re-evaluated defun in *scratch* buffer) and it worked fine. Tomi > > 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