From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74410: 31.0.50; completion-at-point doesn't work in custom buffers Date: Thu, 21 Nov 2024 11:28:19 -0500 Message-ID: References: <871pz62v0o.fsf@mail.linkov.net> <87ttc181jp.fsf@mail.linkov.net> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21557"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74410@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 21 17:29:21 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 1tEA3U-0005SQ-Qx for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Nov 2024 17:29:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tEA3D-0003Pv-HB; Thu, 21 Nov 2024 11:29:03 -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 1tEA3C-0003Pj-BK for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2024 11:29: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 ) id 1tEA3C-0002K7-2q for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2024 11:29:02 -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=8Rga9UyORQbZFhYDlKp7Z6sU1X6J7x1FG/YXXUOGxxQ=; b=j1WyLoAphB1Agw4xrUxTYKn3j+a0NxtC5wQgsCaFsiVHimPXoQ8l/KwMDCbIPZtAQDxxMEsEJ8jUh9gcCp51zyUb+nXvgpr/R4V//IFnxw9sNtpbUmIqPeFhNiD+D941wACoEWf/rClE+/bdsSbuTGxyTyqSYUIO+Qne0AX9Zgr8ebFeqQ5V4cKr0Eh6CQRfvOHu2OsHypJcu6g6h3SKLa1FNfU52Wof9dVVRvXvH1jo5G4oLjysXzINa/29oVei8l4epSFBQLDZLUykxv26PsH/dqkSQLHeH9alyHelxg0BV/V9jEsJeOkk5jf371LAeBImccSljLVqhF8XkTfsVA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tEA3B-0002qF-OC for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2024 11:29:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Nov 2024 16:29:01 +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.173220651010876 (code B ref 74410); Thu, 21 Nov 2024 16:29:01 +0000 Original-Received: (at 74410) by debbugs.gnu.org; 21 Nov 2024 16:28:30 +0000 Original-Received: from localhost ([127.0.0.1]:51459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEA2g-0002pM-BO for submit@debbugs.gnu.org; Thu, 21 Nov 2024 11:28:30 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEA2d-0002p6-C7 for 74410@debbugs.gnu.org; Thu, 21 Nov 2024 11:28:28 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B692D8093F; Thu, 21 Nov 2024 11:28:20 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1732206499; bh=zC/TPKdPf/FOyxhfCBEGvcamA4x6ptkc6GOCS0loaa0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=cXnwP3oFgExAGBJo264oC8tJYYcLgPXR88MWeHWhwzhrV0lnfr3O3AmrcwY8Koe8q XoMpSC0CnEVJHyBqYdP2aEUIwtCpa33SqHI+olm1jn/jfmDRBo2txbgA0LH4Jo6rz9 fEPl5SFMZc8rTM3QaSe+SSRobaOED8gsFnvWKVcA7acKkI20P1i6z8G7CgKR8/xlD5 3KdjHbCEd+boGXLtoZGc2+caUS6Q3QRPFvF35AonFenMzM1NGYofHyyusWO2oUWRgT 97n5xQkac0vDEBbwtTlMbCdwKFnTs2q3PAINmbunOwS55ei/mFrr9dVbGLokki1ihg g2wWFqDSn+fhA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E11CB80135; Thu, 21 Nov 2024 11:28:19 -0500 (EST) Original-Received: from alfajor (unknown [192.197.121.90]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CD5D61204D5; Thu, 21 Nov 2024 11:28:19 -0500 (EST) In-Reply-To: <87ttc181jp.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 21 Nov 2024 09:54:18 +0200") 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:295735 Archived-At: > 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-fun= ctions > + 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 =F0=9F=99=82 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