unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: Add a space after completed tag operations
Date: Fri, 25 Oct 2013 10:13:32 +0300	[thread overview]
Message-ID: <m2bo2desbn.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <1382650227-4055-1-git-send-email-amdragon@mit.edu>

On Fri, Oct 25 2013, Austin Clements <amdragon@MIT.EDU> 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

  reply	other threads:[~2013-10-25  7:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 21:30 [PATCH] emacs: Add a space after completed tag operations Austin Clements
2013-10-25  7:13 ` Tomi Ollila [this message]
2013-10-25  8:04 ` Mark Walters
2013-10-28 11:04 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2bo2desbn.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=amdragon@MIT.EDU \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).