From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams 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: Fri, 28 Dec 2018 10:56:08 -0800 (PST) Message-ID: References: <5de4751e-8389-4400-aafe-9225e9470f01@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1546024049 23996 195.159.176.226 (28 Dec 2018 19:07:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 28 Dec 2018 19:07:29 +0000 (UTC) To: 33595@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 28 20:07:25 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 1gcxTc-0005zm-O5 for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Dec 2018 20:07:20 +0100 Original-Received: from localhost ([127.0.0.1]:32933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcxVj-0000rE-Fq for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Dec 2018 14:09:31 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcxVT-0000oE-8L for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2018 14:09:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcxJe-00026X-NF for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2018 13:57:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53515) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gcxJe-00026F-In for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2018 13:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gcxJe-0007nw-Ct for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2018 13:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Dec 2018 18:57: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.154602338029934 (code B ref 33595); Fri, 28 Dec 2018 18:57:02 +0000 Original-Received: (at 33595) by debbugs.gnu.org; 28 Dec 2018 18:56:20 +0000 Original-Received: from localhost ([127.0.0.1]:40657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcxIx-0007mk-Pg for submit@debbugs.gnu.org; Fri, 28 Dec 2018 13:56:20 -0500 Original-Received: from userp2130.oracle.com ([156.151.31.86]:59512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcxIu-0007mR-FT for 33595@debbugs.gnu.org; Fri, 28 Dec 2018 13:56:17 -0500 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBSIn0WD126293 for <33595@debbugs.gnu.org>; Fri, 28 Dec 2018 18:56:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=UvPJq0/KsBsxPp1vE5Kwjng9pHLZ/EYv8+Z1LzlnD9M=; b=LX4Rjp1Ow0IrPJHDeb3mb5HlyjXWZeaHHmPKOneK3wY0P3Ii0c4vcSYsH6WWE91bDtE9 0OSYfJQ+vbOfkBcJ9RLO4P3vtn4H6arE66dvJ+EGwPsILFavCKrT0ngDySpJlu3qHb4q 1Osj2drCeMokIEAnO42nrDkOlxVtKXyz9rfUYb3M0S+I04Dd+7SrZFXlox08TSR59DQL XtZBO3cQYo8lYtvBbpxY/fRS/83vdcipku/Ahdjq4Yy80u1+XLbMZCezuJnuI57QhMZz 0bIOOrluG4JsMOKRiVK+3fpwyDzD0QZR+RHnnZv2ZZkASJ9gEHVjhTmqrKP2s735jXT2 Lw== Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2phcpu2715-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <33595@debbugs.gnu.org>; Fri, 28 Dec 2018 18:56:10 +0000 Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wBSIu98a002337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <33595@debbugs.gnu.org>; Fri, 28 Dec 2018 18:56:09 GMT Original-Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wBSIu8Xr008152 for <33595@debbugs.gnu.org>; Fri, 28 Dec 2018 18:56:09 GMT In-Reply-To: <5de4751e-8389-4400-aafe-9225e9470f01@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4783.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9120 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=13 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812280163 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] X-Received-From: 208.118.235.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:153966 Archived-At: ping. Would someone please consider committing this patch? Thx. ------------------ diff -u minibuffer.el minibuffer-2018-12-03a-patched.el --- minibuffer.el=092018-12-03 09:23:45.858608200 -0800 +++ minibuffer-2018-12-03a-patched.el=092018-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))) =20 +(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