all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Augusto Stoffel <arstoffel@gmail.com>,
	"48073@debbugs.gnu.org" <48073@debbugs.gnu.org>
Cc: "joaotavora@gmail.com" <joaotavora@gmail.com>
Subject: bug#48073: [External] : bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?
Date: Tue, 27 Apr 2021 21:01:01 +0000	[thread overview]
Message-ID: <SA2PR10MB4474E358313B6D5D25899B26F3419@SA2PR10MB4474.namprd10.prod.outlook.com> (raw)
In-Reply-To: <871rav4jri.fsf@gmail.com>

> Binding `completion-styles' buffer locally can lead to problems on
> alternative completion UIs, say if the minibuffer is involved (this
> used to happen with Consult's compeltion in region until recently).
> 
> It seems that a more appropriate way to override the completion style
> would be to include a category in the completion table metadata, and
> add a corresponding entry to `completion-category-defaults', which can be
> done globally.

1. I can't speak to what you say in your first paragraph,
other than to say that I'm not surprised that this can
cause problems.

I expect (but will be relieved if it's not the case)
that making global minibuffer variables buffer-local to
the minibuffer will break behavior in my "alternative
completion UI", which, I think, relies on not only code
but users interactively to be able to access, and even
change, the values of such variables (that is, without
having to wrap such access in `with-current-buffer' for
the current minibuffer buffer).

2. But I think I disagree with what you say in your 2nd
paragraph.  It should be possible for not only an
"alternative completion UI" to change `completion-style'
without recourse to modifying the completion table
(metadata or in any other way), but also for a user to
modify `completion-style' on the fly.

The completion table should, in general, define the
domain of possible completions, which are matchable
by user input.  In general, that domain can remain
constant even when `completion-style' is changed.
The domain defines what can be matched; the style
defines how domain elements can be matched.

It's true that a "completion table" can be a function
that, in effect, performs matching of user input as
well as defining the set of possible matches - together
in one operation.  But that's only one case.  (It's
general, because the function can also make use of a
non-varying domain.  But it need not do so.)

In my "alternative completion UI" users can, in general,
switch among `completion-styles' interactively, anytime
during completion.  If a `completion-style' gets, in
effect, baked into a given completion table for the
duration then that feature becomes impossible (I think,
but at least not easy) to make available.

Just one, non-expert, opinion.





  parent reply	other threads:[~2021-04-27 21:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 19:20 bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally? Augusto Stoffel
2021-04-27 19:31 ` João Távora
2021-04-27 20:37   ` Stefan Monnier
2021-04-27 21:10     ` João Távora
2021-04-27 22:37       ` Stefan Monnier
2021-04-27 22:42         ` João Távora
2021-04-27 23:13           ` Stefan Monnier
2021-04-28  7:00             ` Augusto Stoffel
2021-04-28 12:03               ` João Távora
2021-04-27 21:01 ` Drew Adams [this message]
2021-04-27 21:53   ` bug#48073: [External] : " João Távora
2021-04-27 22:06     ` Drew Adams
2021-04-27 22:10       ` João Távora
2021-04-27 22:12         ` João Távora
2021-04-28 16:10         ` Drew Adams
2021-04-28 16:13           ` João Távora

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=SA2PR10MB4474E358313B6D5D25899B26F3419@SA2PR10MB4474.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=48073@debbugs.gnu.org \
    --cc=arstoffel@gmail.com \
    --cc=joaotavora@gmail.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 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.