all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 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: Fri, 28 Dec 2018 10:56:08 -0800 (PST)	[thread overview]
Message-ID: <cf27ba32-acd4-4c12-a9b0-e279d6a74d63@default> (raw)
In-Reply-To: <5de4751e-8389-4400-aafe-9225e9470f01@default>

ping.

Would someone please consider committing this patch?  Thx.

------------------

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-28 18:56 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 [this message]
2018-12-29  8:08     ` Eli Zaretskii
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

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

  git send-email \
    --in-reply-to=cf27ba32-acd4-4c12-a9b0-e279d6a74d63@default \
    --to=drew.adams@oracle.com \
    --cc=33595@debbugs.gnu.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.