From: Juri Linkov <juri@linkov.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 74410@debbugs.gnu.org
Subject: bug#74410: 31.0.50; completion-at-point doesn't work in custom buffers
Date: Sun, 24 Nov 2024 19:35:28 +0200 [thread overview]
Message-ID: <87ttbwee4n.fsf@mail.linkov.net> (raw)
In-Reply-To: <jwviksgime0.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 21 Nov 2024 11:28:19 -0500")
>> Or to make the binding conditional with something like this:
>>
>> @@ -1079,7 +1079,10 @@ widget-global-map
>> (defvar widget-field-keymap
>> (let ((map (copy-keymap widget-keymap)))
>> (define-key map "\C-k" #'widget-kill-line)
>> - (define-key map "\M-\t" #'widget-complete)
>> + (define-key map "\M-\t" `(menu-item "" 'widget-complete
>> + :filter ,(lambda (cmd)
>> + (unless completion-at-point-functions
>> + cmd))))
>> (define-key map "\C-m" #'widget-field-activate)
>> ;; Since the widget code uses a `field' property to identify fields,
>> ;; ordinary beginning-of-line does the right thing.
>
> Cute 🙂
> I really like the fact that Emacs can do this, but we shouldn't abuse
> it, because it makes it more difficult for users to figure out
> what's going on.
Indeed, this was just an example. But it would be nice to do the same
one way or another. Maybe 'widget-complete' itself should check for
'completion-at-point-functions', or something like this.
prev parent reply other threads:[~2024-11-24 17:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-17 23:15 bug#74410: 31.0.50; completion-at-point doesn't work in custom buffers Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-20 7:57 ` Juri Linkov
2024-11-20 23:31 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-21 7:54 ` Juri Linkov
2024-11-21 16:28 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-24 17:35 ` Juri Linkov [this message]
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=87ttbwee4n.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=74410@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/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).