From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#33595: 26; Have `try-completion' or `completion--done' run abnormal hook if sole completion Date: Tue, 01 Jan 2019 23:41:06 -0500 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1546404346 19986 195.159.176.226 (2 Jan 2019 04:45:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 2 Jan 2019 04:45:46 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 33595@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 02 05:45:42 2019 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 1geYPU-00056d-Lz for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Jan 2019 05:45:40 +0100 Original-Received: from localhost ([127.0.0.1]:41895 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1geYRb-0001O7-HP for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Jan 2019 23:47:51 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1geYM2-00047X-IE for bug-gnu-emacs@gnu.org; Tue, 01 Jan 2019 23:42:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1geYLy-0001z6-GZ for bug-gnu-emacs@gnu.org; Tue, 01 Jan 2019 23:42:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35276) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1geYLy-0001yh-BK for bug-gnu-emacs@gnu.org; Tue, 01 Jan 2019 23:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1geYLx-0001zA-Sp for bug-gnu-emacs@gnu.org; Tue, 01 Jan 2019 23:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Jan 2019 04:42:01 +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.15464040707573 (code B ref 33595); Wed, 02 Jan 2019 04:42:01 +0000 Original-Received: (at 33595) by debbugs.gnu.org; 2 Jan 2019 04:41:10 +0000 Original-Received: from localhost ([127.0.0.1]:44238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1geYL7-0001y5-Uk for submit@debbugs.gnu.org; Tue, 01 Jan 2019 23:41:10 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:48671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1geYL6-0001xy-I7 for 33595@debbugs.gnu.org; Tue, 01 Jan 2019 23:41:08 -0500 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id x024f7ZH022535; Tue, 1 Jan 2019 23:41:07 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 12444AE92F; Tue, 1 Jan 2019 23:41:07 -0500 (EST) In-Reply-To: (Drew Adams's message of "Sun, 2 Dec 2018 20:07:07 -0800 (PST)") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6451=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6451> : inlines <6990> : streams <1808879> : uri <2773497> 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:154080 Archived-At: > Enhancement request: When `try-completion' returns `t' there is a > "unique match which is exact". Please add an abnormal hook at this > point, which accepts that sole completion as argument. I'm not sure exactly what's the intention behind this: would it be an option that influences the UI or the completion table? More concretely, do you expect a hook function places on this variable to apply for "any completion table" or would it be specific to a particular completion table? The example you give in `my-describe-function` gives me the impression that those would inevitably be tightly linked to the completion table. So instead of a hook variable, it would probably make more sense to add a new `completion-extra-properties` alongside to :exit-function. Do you have other example applications than `my-describe-function` (to be honest, I found this example not very compelling). > no exit function. `try-completion' is the logical place to do this, I Definitely not: try-completion can be used in lots of other non-completion uses, can be called many times for a single completion operation, etc... try-completion should be renamed to `find-common-prefix`. Stefan PS: I'm not sure I completely understand the intended behavior of `my-describe-function`, but I get the impression that for this particular example, a maybe even better approach is to use minibuffer-with-setup-hook to set a post-command-hook that calls describe-function whenever the minibuffer names a valid function (whether we get there via completion or plain typing, and regardless if it's the sole completion).