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#74404: [PATCH] Give Completion Preview bindings higher precedence Date: Sun, 17 Nov 2024 18:31:03 +0100 Message-ID: References: <86ttc5vljy.fsf@gnu.org> 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="37633"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 74404@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 17 18:32:20 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 1tCj8E-0009ei-O3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Nov 2024 18:32:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tCj80-0006Ny-5v; Sun, 17 Nov 2024 12:32: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 ) id 1tCj7y-0006Nq-Dz for bug-gnu-emacs@gnu.org; Sun, 17 Nov 2024 12:32: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 1tCj7y-00077I-5b for bug-gnu-emacs@gnu.org; Sun, 17 Nov 2024 12:32: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=EuVg+bcrkGxoH5ZDbFIdgpEUSxCUZHd27OSwUBAjykQ=; b=YGkzzf8xcN/Y7gSoNicFEoLIpu/OJjl76wxogwhdmymO5G5SAJldCfcI3201cDdHptBiAWyB4pGHDnu1f6tNJnCnckbKJWEjRDOngrhbHBYRjTdYA370WTGUNW9zkooQC1Gl0dOIrGsZqQ33Xy52ug/L96ybhIIP9wI62Sc1fhF+CTgLIOZ+lto1ZiX3dXGQIMBkyJ6Py4AXhHEFuQazc7tzHkbRgRe1mCs/pX3igM4JEC+siJ6BcwFYeBQIc60S+3Ngpni0d1P2PciCFsjsekoFxBr+NRHGAQD9CUEhGADutiNMWO01BcyFI/gk36+tib66fjizLw1RxukwgixX8w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tCj7y-0005J7-0W for bug-gnu-emacs@gnu.org; Sun, 17 Nov 2024 12:32: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: Sun, 17 Nov 2024 17:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74404 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74404-submit@debbugs.gnu.org id=B74404.173186467020326 (code B ref 74404); Sun, 17 Nov 2024 17:32:01 +0000 Original-Received: (at 74404) by debbugs.gnu.org; 17 Nov 2024 17:31:10 +0000 Original-Received: from localhost ([127.0.0.1]:58446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCj78-0005Hi-3M for submit@debbugs.gnu.org; Sun, 17 Nov 2024 12:31:10 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:45166 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCj74-0005HY-P5 for 74404@debbugs.gnu.org; Sun, 17 Nov 2024 12:31:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1731864666; bh=FI3ZreQa9iajvJ3O6IeWvFFGbQSWnFIwjVc0uFpWvvo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=MGcWAMH4wwU3c3QfeHyYjQenF2wtZqcX4ZQNyY6Oe2fVxkZ8X2NzqmD44+PYDoJha nkEP9DgJhtJGFMpJmpbCEkoRvnCtapomrm8TwWW9bUOt+1H9XQf65WK0LvlwWQKegV KgwYPYyoEZDTlZ/TolEbkudW36MhL5JPKcCpaJyaOv+1upP3mNBci3LIpsV/EnaHe6 fUxS7oyNbQ4P7pHCQJWNhIGGMW7IhZ3ueqmrraAdcWJcyfAadg6onvBxsl1XZ3f2/M 7XyayCaefhPJEEMtyDfsHJndCA7JaPnnkdpAvnWmptXOfDnG7KH23BXmpGXL1Z6XjR AxUBd85EgxzwA== In-Reply-To: (Stefan Monnier's message of "Sun, 17 Nov 2024 12:16:29 -0500") 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:295552 Archived-At: Hi, Stefan Monnier writes: >>> To fix this issue, we need to give the active completion preview >>> bindings higher precedence than keymaps of minor modes that where >>> defined after loading completion-preview.el. The patch below does that >>> by using minor-mode-overriding-map-alist. Any thoughts? >> >> Can't you instead use the 'keymap' text or overlay property? That >> would avoid the "arms race" of precedences. I thought about that, but no, we can't easily use that, since the overlay is not necessarily at point: it is generally at the end of the symbol, and point may be at the middle of the symbol. >> Adding Stefan, in case he has comments or suggestions. > > Assuming the minor mode is disabled as soon as point moves away from the > completion, I wouldn't have a clear preference between `keymap` and > `minor-mode-overriding-map-alist`. Indeed, the minor mode is disabled as soon as the completion preview is dismissed for whatever reason, including moving point elsewhere. > BTW, maybe we should add some notion of minor mode precedence since such > problems are actually fairly common. We could do something similar to > what we do with `add-hook`, so `add-minor-mode` takes care of obeying > the ordering constraints. That'd be nice, I think. Thanks, Eshel