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.help Subject: Re: `other-window-prefix' command, running anything in the other window Date: Tue, 23 Jan 2024 01:39:08 +0200 Message-ID: <2c8cd4b4-1fd6-43b4-a06b-1e8a6f60d53b@gutov.dev> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2180"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: help-gnu-emacs@gnu.org To: Psionic K Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 23 00:39:52 2024 Return-path: Envelope-to: geh-help-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 1rS3tP-0000NV-A2 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 23 Jan 2024 00:39:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rS3sr-0001rt-Jf; Mon, 22 Jan 2024 18:39:17 -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 1rS3sp-0001rP-K6 for help-gnu-emacs@gnu.org; Mon, 22 Jan 2024 18:39:15 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rS3sn-0004Xb-3o for help-gnu-emacs@gnu.org; Mon, 22 Jan 2024 18:39:15 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 84C905C027C; Mon, 22 Jan 2024 18:39:11 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 22 Jan 2024 18:39:11 -0500 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=fm1; t=1705966751; x=1706053151; bh=zqrXvSKlgPBoWYnuVKwjsZqEs1uH3ZH9Mc9bju61kr4=; b= XDcuwDjNSrEU/wqnrM0hpp0tw2fIHPFnd8CGLkunNMLETNuaGAYoK9t/PMowcKDE GyyVC0W9ozry75v4GaIa3k1WtOd2JY220ao5YGGkiHgnf0berv4d9W/JJn9dCIbp 9KNsaDvSB2CwEDgrEtAzHmpGTmTvJZmJW8mtgHE16GOaUwNoh63klAIoX0Oz2ki8 LWTjOYhLfh7On+H8ZaczMEoCGk4kWKAOdGwI9VHZp+8XBRE8cxyFbioDnY3Yq3f4 eXfsbJUes0Wd60uy6Ig2AgEWAwHN1zaEQwoON0VlIvlN5KFKlhKSOI1naDlGjUeV GcbRhphdZoOH+ypAGz4PNA== 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=1705966751; x= 1706053151; bh=zqrXvSKlgPBoWYnuVKwjsZqEs1uH3ZH9Mc9bju61kr4=; b=t yc35iI/xEtRgJNaxM78vcebktRZDvBTdxH6L3NQT8Fqm1Ly5eYhK70xdGPSZ8w1L 18W+YrKqUxYrmxWPk/FE1iaADVa3hAuyDnHAXM/CfZ/hAmLOYkPYosheuZPofwYa rvUzZOwb6ol5YZIJwY+aZU9S49Kr51XIXM+6uzXJnqlX+3qVJnHLKeVacx/cI2FA jIFdMspVL2NKmResSk0KURfxgTLxE3aXMOmbkB8AACuV77GVt/dD8OJcqVVEUDif VXWzt2gCGe0ULdpcq6V0RUinGhKH59q1yxqvy1itcVE1RpskHqAcUR7xtWVU357o no0uOQVmlEIA747HhKHLA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdekjedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeetveegtedthefhudekteehffeu keeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 Jan 2024 18:39:10 -0500 (EST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=66.111.4.28; envelope-from=dmitry@gutov.dev; helo=out4-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145787 Archived-At: On 23/01/2024 00:21, Psionic K wrote: > Oh yikes.  The `other-window-prefix' we have already is pretty limited. > No go.  The behavior I want to achieve is: `other-window-prefix' + > `scroll-window' -> `scroll-other-window' > > Second draft: > > 1. Switch window if there is another window.  If there is no other > window, run other-window-prefix to be sure we get a new one. > 2. In post command hook, switch back to the previous window > > I think it should work this way anyway, although not using a hook if > written  for Emacs. You can make your version based on this one. E.g. implement it on top of the existing function, or just look at the implementation and tweak as necessary.