unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Drew Adams <drew.adams@oracle.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 33595@debbugs.gnu.org
Subject: bug#33595: [PATCH] RE: bug#33595: 26; Have `try-completion' or `completion--done' run abnormal hook if sole completion
Date: Sat, 29 Dec 2018 10:08:25 +0200	[thread overview]
Message-ID: <83imzc69hi.fsf@gnu.org> (raw)
In-Reply-To: <cf27ba32-acd4-4c12-a9b0-e279d6a74d63@default> (message from Drew Adams on Fri, 28 Dec 2018 10:56:08 -0800 (PST))

> Date: Fri, 28 Dec 2018 10:56:08 -0800 (PST)
> From: Drew Adams <drew.adams@oracle.com>
> 
> ping.
> 
> Would someone please consider committing this patch?  Thx.

Stefan, any comments?  If okay, I'd like to push this to master.

> diff -u minibuffer.el minibuffer-2018-12-03a-patched.el
> --- minibuffer.el	2018-12-03 09:23:45.858608200 -0800
> +++ minibuffer-2018-12-03a-patched.el	2018-12-03 09:27:17.862397300 -0800
> @@ -753,6 +753,10 @@
>  the second failed attempt to complete."
>    :type '(choice (const nil) (const t) (const lazy)))
>  
> +(defvar completion-sole-match-functions ()
> +  "Functions to be run when completion results in only one match.
> +Each function must accept that completion as its first arg.")
> +
>  (defconst completion-styles-alist
>    '((emacs21
>       completion-emacs21-try-completion completion-emacs21-all-completions
> @@ -1769,6 +1773,8 @@
>    (let* ((exit-fun (plist-get completion-extra-properties :exit-function))
>           (pre-msg (and exit-fun (current-message))))
>      (cl-assert (memq finished '(exact sole finished unknown)))
> +    (when (eq finished 'finished)
> +      (run-hook-with-args 'completion-sole-match-functions string))
>      (when exit-fun
>        (when (eq finished 'unknown)
>          (setq finished
> 
> 
> 
> 





  reply	other threads:[~2018-12-29  8:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03  4:07 bug#33595: 26; Have `try-completion' or `completion--done' run abnormal hook if sole completion Drew Adams
2018-12-03 18:52 ` bug#33595: [PATCH] " Drew Adams
2018-12-28 18:56   ` Drew Adams
2018-12-29  8:08     ` Eli Zaretskii [this message]
2019-01-02  1:23       ` Stefan Monnier
2019-01-02  4:41 ` Stefan Monnier
2019-01-02  7:11   ` Drew Adams
2019-01-02 15:27     ` Stefan Monnier
2019-01-02 16:20       ` Drew Adams
2019-01-03  3:15         ` Stefan Monnier

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://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83imzc69hi.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=33595@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=monnier@iro.umontreal.ca \
    /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://git.savannah.gnu.org/cgit/emacs.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).