From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Juri Linkov <juri@linkov.net>
Newsgroups: gmane.emacs.bugs
Subject: bug#74410: 31.0.50; completion-at-point doesn't work in custom buffers
Date: Wed, 20 Nov 2024 09:57:59 +0200
Organization: LINKOV.NET
Message-ID: <871pz62v0o.fsf@mail.linkov.net>
References: <jwvplmtjwc8.fsf-monnier+@gnu.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="19811"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
Cc: 74410@debbugs.gnu.org
To: Stefan Monnier <monnier@iro.umontreal.ca>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 20 09:05:11 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1tDfi3-00050R-MV
	for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Nov 2024 09:05:11 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1tDfhv-0002fg-S3; Wed, 20 Nov 2024 03:05:04 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1tDfhu-0002fB-6p
 for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2024 03:05:02 -0500
Original-Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1tDfht-0003g6-UO
 for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2024 03:05:01 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=debbugs.gnu.org; s=debbugs-gnu-org; 
 h=MIME-Version:Date:References:In-Reply-To:From:To:Subject;
 bh=wWFEj8UFsRIhdoOnGsHFXi3QNEklmsn594vHqhtLEuU=; 
 b=LF2LrkpkL18zlNBOpoT04TUxS/teUZDyxfP5sXt1gOYQpHSHmIJU8DQCalP0dA6aMw5Wy8oEscjoW4Csng/1bjMnhn05bPEZgoLN0JbnRIyVsNC2tTWWFwrH8msrIC3znuWn+dBGzGaYnu2Vxv8N3A6rL8f5wlbyd/5UeQ3a+60ndVjFgYpKv99VUlhE4+/j7kkSjeqUGiVAkFVcV94qaxDaYueXxcEm0rxtQZTB6d1JqoL6rrScb4S3C+Ek++CqIjUxLct6+PMJ+BSKWHcWjQn0Nxa9J49GUO3GHQnUq0SumlvYzEGCMob5Ts1hGGZqX/J85qY/Xw1rBSWeEc3lGQ==;
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tDfht-00068M-O1
 for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2024 03:05:01 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Juri Linkov <juri@linkov.net>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Wed, 20 Nov 2024 08:05:01 +0000
Resent-Message-ID: <handler.74410.B74410.173208987523538@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 74410
X-GNU-PR-Package: emacs
Original-Received: via spool by 74410-submit@debbugs.gnu.org id=B74410.173208987523538
 (code B ref 74410); Wed, 20 Nov 2024 08:05:01 +0000
Original-Received: (at 74410) by debbugs.gnu.org; 20 Nov 2024 08:04:35 +0000
Original-Received: from localhost ([127.0.0.1]:45104 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1tDfhT-00067Y-Hc
 for submit@debbugs.gnu.org; Wed, 20 Nov 2024 03:04:35 -0500
Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:37337)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@linkov.net>) id 1tDfhR-00067J-5o
 for 74410@debbugs.gnu.org; Wed, 20 Nov 2024 03:04:34 -0500
Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id BB8F860003;
 Wed, 20 Nov 2024 08:04:03 +0000 (UTC)
In-Reply-To: <jwvplmtjwc8.fsf-monnier+@gnu.org> (Stefan Monnier via's message
 of "Sun, 17 Nov 2024 18:15:36 -0500")
X-GND-Sasl: juri@linkov.net
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Xref: news.gmane.io gmane.emacs.bugs:295669
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/295669>

> For example:
>
>     src/emacs -Q --eval '(customize-face `fixed-pitch)'
>     ... move point to the font family field ...
>     ... delete the "space" from "Monospace" then do:
>     M-x completion-at-point RET
>
> This will presumably do nothing at all.
> `widget-complete` completes it back to "Monospace" (at least on
> `master` where I installed a patch for that).
>
> The problem is that cus-edit doesn't setup
> `completion-at-point-functions`.  Instead it sets up a special keymap to
> remap M-TAB to `widget-complete` instead of relying on the
> global binding.
>
> It works OK for a default config, but it doesn't interact well with
> setups that use different keybindings or different completion UIs based
> on `completion-at-point-functions`.  E.g. `corfu-mode` partly works but
> not fully (e.g. `corfu-auto` doesn't have any effect).
>
> The patch below leaves the key remapping for now, but adds an
> appropriate function to `completion-at-point-functions` so that
> other UIs such as `completion-at-point` can do their job properly.
>
> Comments/objection?

Now finally it's possible to select a completion using arrow keys
like for in-buffer completions, thanks.

Currently this works only when typing 'M-x completion-at-point RET',
not by 'M-C-i' that is bound to 'widget-complete'.  Maybe
'M-C-i' should be rebound to 'completion-at-point' in widgets?