From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#70577: [PATCH] New command other-project-prefix Date: Tue, 14 May 2024 23:02:51 +0300 Message-ID: <1b247d37-d1da-462a-9582-f7f7ff689d8f@gutov.dev> References: <86le501ykg.fsf@mail.linkov.net> <86jzkhe81b.fsf@mail.linkov.net> <208c7a05-6cfe-40c2-af54-187967348686@gutov.dev> <86le4tz88d.fsf@mail.linkov.net> <865xvsjklh.fsf@mail.linkov.net> <861q6esvhl.fsf@mail.linkov.net> <938582b5-0f86-4cb0-8bfe-afb26af0e8c9@gutov.dev> <86eda4hpyh.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14372"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 70577@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 14 22:04:30 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 1s6yNw-0003SO-DF for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 May 2024 22:04:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6yNW-0003Xm-Ik; Tue, 14 May 2024 16:04:03 -0400 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 1s6yNV-0003XL-Jj for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 16:04:01 -0400 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 1s6yNV-0001bu-A9 for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 16:04:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6yNW-0004Yf-Gf for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 16:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 May 2024 20:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70577 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70577-submit@debbugs.gnu.org id=B70577.171571698717454 (code B ref 70577); Tue, 14 May 2024 20:04:02 +0000 Original-Received: (at 70577) by debbugs.gnu.org; 14 May 2024 20:03:07 +0000 Original-Received: from localhost ([127.0.0.1]:41226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6yMb-0004XS-20 for submit@debbugs.gnu.org; Tue, 14 May 2024 16:03:07 -0400 Original-Received: from fout6-smtp.messagingengine.com ([103.168.172.149]:40285) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6yMX-0004Wr-TV for 70577@debbugs.gnu.org; Tue, 14 May 2024 16:03:04 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 76EBB138039B; Tue, 14 May 2024 16:02:55 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 14 May 2024 16:02:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1715716975; x=1715803375; bh=R6XMF+z/cXPuSdB8uPBgduzF0wFIc1MiHYZgAprZMIU=; b= M2F8eYZZi+aMQUL1tA0udVnhBrEjP35IJddeZW2m9EjeBRzAMtrfA5H8bdBZ3ecc ZZrdkGF1OLwcltjaJHyW6Zf6KIIxV1L5DW8nAJ0D/GCuug+UlQ6vZDs/a/N0peYf ub1jQriNe9DA+O2eMZE2NWwDtIkZ/I7Ss1dpw5TQoNwV7oYHxEUcHgIygOO3W7eI 25t+owHkHffZJApMeqdYDDQvzXkjVwA8vdSP4k214G0i8CJ+ENRbO5XhXVV5CPzL 1ESx/QJeUAw1luTi9PCiXJGu6ihjwlPczuXWHwei+JP/UufavLdR+WxtZVT9MKzY LtajWmHo6MPPGZl6gQLs1w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1715716975; x= 1715803375; bh=R6XMF+z/cXPuSdB8uPBgduzF0wFIc1MiHYZgAprZMIU=; b=N pVFf5MG1oJOiOxBT2IL5uoH5X7bpqXoZcpi9x90aDO7ATv9mEiIr2WopXLLSAx0x pp//QfpacareGOvNYSP0Ko9lWHbcl8AtCGw48i0ECiEYNP9lfuZQx8nQA6vavUSR 3+zM0SeoSpNdNHr1PYJN6cD9kDqH6Lc0o2l3RNs44a/oNhrNQCML6sdBs/f/EsmS JbGqnCLNIx8UKZBMPVXh48yirb+ZRGc3fa7dgJ8C+OB/a1MjM2nhaidKRhtc/OPP /R2xuMucFwRwkijuoDgBwGLDvIHuSEkOEAHki7TWdpJ4UdnfGzNDjZGyFQwaVadw TegVO0lF3ssGwrkAxd6Zw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdegiedgudegfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveeg udejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 May 2024 16:02:54 -0400 (EDT) Content-Language: en-US In-Reply-To: <86eda4hpyh.fsf@mail.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:285048 Archived-At: On 14/05/2024 09:23, Juri Linkov wrote: >>>> Speaking of the implementation strategy, though, I think the current >>>> other-project-prefix implementation still doesn't work well together >>>> with project-other-*-command. >>> I suppose we could just blacklist some known prefix commands (*) in the >>> same form where we now compare (eq this-command 'other-project-prefix), >>> but it would be nice to distinguish prefix commands from "real" ones >>> somehow. >>> (*) project-other-window-command, project-other-frame-command, >>> project-other-tab-command, some others? >> >> This can look like the attached. >> >> Though I suppose we would use some global registry, or symbol properties, >> or etc. >> >> +(defvar other-project-prefix-transient-commands '(project-other-window-command >> + project-other-frame-command >> + project-other-tab-command >> + other-window-prefix >> + other-frame-prefix >> + other-tab-prefix) >> + "List of commands that `other-project-prefix' does not apply to. > > This doesn't yet support such things as 'C-x 5 p p'? I'm not sure that other-project-prefix can do that. How does other-frame-prefix work? display-buffer-override-next-command sets up hooks in the very familiar fashion, so that the next command (and only the next command) is affected by a number of changed variables, which get restored after. I suppose other-project-prefix could learn all the new variables it needs to "carry on", look up their values, and set them additionally for the next command. But that seems very ad-hoc. It seems the "proper" way to fix that would be a cross-codebase change where all similar "prefix" commands themselves check whether the next command is a "prefix" command as well, and if so, keep the variables and hooks in place for the command after it. This would also mean moving the information from other-project-prefix-transient-commands to symbol properties (the alternative I've mentioned previously).