From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#74410: 31.0.50; completion-at-point doesn't work in custom buffers Date: Sun, 24 Nov 2024 19:35:28 +0200 Organization: LINKOV.NET Message-ID: <87ttbwee4n.fsf@mail.linkov.net> References: <871pz62v0o.fsf@mail.linkov.net> <87ttc181jp.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15817"; 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 Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 24 18:47:37 2024 Return-path: 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 ) id 1tFGhs-00040N-V2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Nov 2024 18:47:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFGhW-0005i5-VA; Sun, 24 Nov 2024 12:47:15 -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 ) id 1tFGhM-0005dH-NL for bug-gnu-emacs@gnu.org; Sun, 24 Nov 2024 12:47:05 -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 ) id 1tFGhK-00016I-PR for bug-gnu-emacs@gnu.org; Sun, 24 Nov 2024 12:47:03 -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=Y5lj8T+TVytjrkoGFIOXBVCJnV3/A1cc1//3HJDYSiQ=; b=Y8Ido7cY++hONIzTFe0kWWgYgZAtAR3FSveBDcqjh09tRVgGIjwYjPV97Bp8RffBBQ/ikwm2zVe1wDiYt37yYhkhNkb7GpWyPQonD/a0o8gZ3olWOAjJ4EfArUwuiC15NreNJ7BkV7qQNiqE4/p86XrpYfwbMWy4QLVYRcXK63oM6vtvGZW44DDApWBqHH0HDl4lie/kLQs/o5/gKxxe3TqVUT1DpRhcygZh8bbXf9bq9qi/7MaqpSrscMcfqF5ewTXt/tjiXXeL3blAqymBlnC65ItReEZGwirM6TGINVnsHzdf2kWtQDQ4TF1L6QuQ/iKUQeUT/+bWwJGL53vQeA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFGhK-0001yT-Jx for bug-gnu-emacs@gnu.org; Sun, 24 Nov 2024 12:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Nov 2024 17:47:02 +0000 Resent-Message-ID: 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.17324703937532 (code B ref 74410); Sun, 24 Nov 2024 17:47:02 +0000 Original-Received: (at 74410) by debbugs.gnu.org; 24 Nov 2024 17:46:33 +0000 Original-Received: from localhost ([127.0.0.1]:35937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFGgr-0001xQ-6B for submit@debbugs.gnu.org; Sun, 24 Nov 2024 12:46:33 -0500 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:36263) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFGgp-0001wz-H2 for 74410@debbugs.gnu.org; Sun, 24 Nov 2024 12:46:32 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id F27DD60002; Sun, 24 Nov 2024 17:46:21 +0000 (UTC) In-Reply-To: (Stefan Monnier's message of "Thu, 21 Nov 2024 11:28:19 -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" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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:295916 Archived-At: >> 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.