From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Control help- and Info-mode buffers from other buffers Date: Thu, 01 Jun 2023 22:15:39 +0300 Message-ID: <83zg5jat9g.fsf@gnu.org> References: <87h6ruf09e.fsf@ledu-giraud.fr> <861qixbum2.fsf@mail.linkov.net> <86wn0opgpi.fsf@mail.linkov.net> <86ilc78zc2.fsf@mail.linkov.net> <86mt1j16ht.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27347"; mail-complaints-to="usenet@ciao.gmane.io" Cc: arthur.miller@live.com, manuel@ledu-giraud.fr, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 01 21:15:20 2023 Return-path: Envelope-to: ged-emacs-devel@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 1q4nlX-0006sM-Fa for ged-emacs-devel@m.gmane-mx.org; Thu, 01 Jun 2023 21:15:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4nlA-0001Ga-Bz; Thu, 01 Jun 2023 15:14:56 -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 1q4nl9-0001GO-4a for emacs-devel@gnu.org; Thu, 01 Jun 2023 15:14:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4nl8-0002lV-5I; Thu, 01 Jun 2023 15:14:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=VDf9ToyNQ7z/F2UktlOyJ2KRnNZE2BkoIk5mKVPTEfo=; b=J6cVPxzGalcL dGBjz+Zkp5Fze6toKIDohs8C0nOJKyg1N3RbuW4dPfaH0HSKG1FhfEbH/WraA808mdFw8QAg0aqTP 8qvEYfVhnxDq55TyDa35ulolHXlYa1EwOnRh5piY24jAexP9JKEvK+3I0PH1gTJqMePtyBvMA1Bv2 DPipLhyP9O2hf6hb3lwfTAV2PydJOD+gAg0v06mLEKrH8zus7CPYLkd9Xl36rJItB49BQiMXo7Fhq 64H0k9qCzr50sFbspG0nmWWwbouOpWXaBkyhmvNU8Q/gjeYu6CuFgYBtW/DWpZqbwk5rMJ/cGpmGu 5lxD90OjmmF7oHj9ag6eJw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4nl7-0006Ji-LW; Thu, 01 Jun 2023 15:14:53 -0400 In-Reply-To: <86mt1j16ht.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 01 Jun 2023 19:39:58 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306528 Archived-At: > From: Juri Linkov > Cc: Manuel Giraud , emacs-devel@gnu.org > Date: Thu, 01 Jun 2023 19:39:58 +0300 > > > I would prefer if there was a code gen in form of a macro, as suggested, similar > > to define-minor-mode, that does this switching on pre-defined prefixes so that > > we get uniformity, and helps people write commands so they work from > > anywhere. Since it is not possible to completely automate it, perhaps lisp > > manual could mention how to write commands so they are callable from other > > windows then just selected one. > > The downside is that every command needs to be modified and its body > wrapped with a macro. An alternative would be to put a new property > on the command symbol with a function that selects a window to redirect > input to. Implementation-wise this is like repeat-mode works. I don't think we need to come up with a generic way of making any command work on "the other window". That would be over-engineering, IMO. This is only needed in cases when the user is unlikely to have the window be the selected one. The number of commands for which this makes sense is not too large, so I'm not convinced a general-purpose infrastructure for that is needed. with-selected-window seems more than enough to me.