unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: 74410@debbugs.gnu.org
Subject: bug#74410: 31.0.50; completion-at-point doesn't work in custom buffers
Date: Thu, 21 Nov 2024 11:28:19 -0500	[thread overview]
Message-ID: <jwviksgime0.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87ttc181jp.fsf@mail.linkov.net> (Juri Linkov's message of "Thu,  21 Nov 2024 09:54:18 +0200")

> Or to make the binding conditional with something like this:
>
> diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
> index ba99847f488..0701442447c 100644
> --- a/lisp/wid-edit.el
> +++ b/lisp/wid-edit.el
> @@ -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.


        Stefan






      reply	other threads:[~2024-11-21 16:28 UTC|newest]

Thread overview: 5+ 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 [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=jwviksgime0.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=74410@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --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).