GNU bug report logs - #74410
31.0.50; completion-at-point doesn't work in custom buffers

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Sun, 17 Nov 2024 23:17:01 UTC

Severity: normal

Found in version 31.0.50

Full log


Message #20 received at 74410 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 74410 <at> debbugs.gnu.org
Subject: Re: bug#74410: 31.0.50; completion-at-point doesn't work in custom
 buffers
Date: Sun, 24 Nov 2024 19:35:28 +0200
>> 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.




This bug report was last modified 204 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.