unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Drew Adams <drew.adams@oracle.com>
Cc: 33595@debbugs.gnu.org
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	[thread overview]
Message-ID: <jwvva37smut.fsf-monnier+bug#33595@gnu.org> (raw)
In-Reply-To: <fb6c5be5-ef79-484e-a150-a62c7fe26ac1@default> (Drew Adams's message of "Sun, 2 Dec 2018 20:07:07 -0800 (PST)")

> 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).





  parent reply	other threads:[~2019-01-02  4:41 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
2019-01-02  1:23       ` Stefan Monnier
2019-01-02  4:41 ` Stefan Monnier [this message]
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='jwvva37smut.fsf-monnier+bug#33595@gnu.org' \
    --to=monnier@iro.umontreal.ca \
    --cc=33595@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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).