From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83imzc69hi.fsf@gnu.org> References: <5de4751e-8389-4400-aafe-9225e9470f01@default> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1546070943 17009 195.159.176.226 (29 Dec 2018 08:09:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Dec 2018 08:09:03 +0000 (UTC) Cc: 33595@debbugs.gnu.org To: Drew Adams , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 29 09:08:58 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gd9g2-0004Hy-3H for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2018 09:08:58 +0100 Original-Received: from localhost ([127.0.0.1]:35283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gd9i8-0002je-C9 for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2018 03:11:08 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gd9ha-0002bu-9b for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 03:11:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gd9h5-0004M9-64 for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 03:10:33 -0500 Original-Received: from debbugsout.gnu.org ([209.51.188.43]:33071) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gd9h4-0004LX-RE for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 03:10:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gd9h4-0005uV-F5 for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 03:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Dec 2018 08:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33595 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33595-submit@debbugs.gnu.org id=B33595.154607097822682 (code B ref 33595); Sat, 29 Dec 2018 08:10:02 +0000 Original-Received: (at 33595) by debbugs.gnu.org; 29 Dec 2018 08:09:38 +0000 Original-Received: from localhost ([127.0.0.1]:40808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gd9gg-0005tl-AY for submit@debbugs.gnu.org; Sat, 29 Dec 2018 03:09:38 -0500 Original-Received: from eggsout.gnu.org ([209.51.188.92]:48477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gd9gf-0005ta-FB for 33595@debbugs.gnu.org; Sat, 29 Dec 2018 03:09:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gd9fo-0003bD-Gl for 33595@debbugs.gnu.org; Sat, 29 Dec 2018 03:09:32 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gd9fo-0003b9-Ce; Sat, 29 Dec 2018 03:08:44 -0500 Original-Received: from [176.228.60.248] (port=2631 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gd9fn-0000ld-Vr; Sat, 29 Dec 2018 03:08:44 -0500 In-reply-to: (message from Drew Adams on Fri, 28 Dec 2018 10:56:08 -0800 (PST)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153974 Archived-At: > Date: Fri, 28 Dec 2018 10:56:08 -0800 (PST) > From: Drew Adams > > 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 > > > >