From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66948: [PATCH] Add Completion Preview mode Date: Mon, 06 Nov 2023 20:47:34 +0100 Message-ID: References: <87lebcqcof.fsf@posteo.net> <86a5rrcqd3.fsf@mail.linkov.net> <86zfzqeoix.fsf@mail.linkov.net> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1217"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Dmitry Gutov , Philip Kaludercic , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 66948@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 06 20:48:51 2023 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 1r05ac-00005h-4c for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Nov 2023 20:48:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r05aE-0004CQ-1V; Mon, 06 Nov 2023 14:48:26 -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 1r05aD-0004CG-4V for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2023 14:48:25 -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 1r05aC-0004dJ-Su for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2023 14:48:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r05ao-00016B-28 for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2023 14:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Nov 2023 19:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66948 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66948-submit@debbugs.gnu.org id=B66948.16993000983955 (code B ref 66948); Mon, 06 Nov 2023 19:49:02 +0000 Original-Received: (at 66948) by debbugs.gnu.org; 6 Nov 2023 19:48:18 +0000 Original-Received: from localhost ([127.0.0.1]:40740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r05a6-00011h-Ga for submit@debbugs.gnu.org; Mon, 06 Nov 2023 14:48:18 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:38488 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r05a3-00011I-QY for 66948@debbugs.gnu.org; Mon, 06 Nov 2023 14:48:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1699300057; bh=G9i7pXgpKQ578c4eVXkPN10QU2MLY/VQ/G1MsF4e1QU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Ns9ARR4viQLZ2hB+ThUsAeg+mbEyY0kM8H1EHKBDtYHZC1XwaQ8S1oztCKzT6S+jF fYf8nfsfgAMiFzl5wbSwh/LWhRaqhtCC3qssFiLHXJQXBtpD3OHaHsbIhv4Z5Yj/70 iS3adSYaELnUXwlThuYC7/qL9lRHPaMnUny7+HdyLWKDP6lLAKgv6qpECxP9sCne1U eZaRd/LiAUpKA2FIH0dPGGxFKpk2IqOiJw+54u1ZvM+UAyk8kfg2PtV2twpasrQUN8 5+v0JVGkKRgRXVmnKColj5Un1WpazEuSZwhyE1gRKWyIZZ2DQcRfF63niIpRtoa3Ru MHA+TVhIHNMeg== In-Reply-To: <86zfzqeoix.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 06 Nov 2023 20:05:50 +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:273896 Archived-At: Juri Linkov writes: >> If you try it out and have any other suggestions, please let me know. >> Here's the updated patch: > > Thanks, everything works nicely now. > Great. > Only one thing that I suggest is to add `backward-delete-char-untabify` > to `completion-preview-commands` since it's bound to DEL in Lisp buffers. > Or there is no way to generalize it for all modes? I too wonder if there's a good generalization we can make here. It seems impractical and inelegant to track all backward-deleting commands in `completion-preview-commands`. We could try to check if a command was invoked by pressing DEL, regardless of what command it actually is, but I don't think that's such a good solution because of course the DEL key itself is not the point--we want to recognize `delete-backward-char` even if it's bound to some other key, for example. The current solution, of providing a minimal list of commands in `completion-preview-commands`, basically delegates the decision of which further commands should keep the preview alive to major mode authors and to the users themselves. I think that's basically fine, but if we had some way to recognize backward-deleting commands without hard-coding them (perhaps a symbol property such as `delete-backward-command`) that would be even better IMO. > For example, in c-mode DEL is bound to `c-electric-backspace`, etc. Yes, and there's also Org mode's `org-delete-backward-char` and certainly a couple more...