From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Control help- and Info-mode buffers from other buffers Date: Fri, 02 Jun 2023 03:26:26 +0200 Message-ID: References: <87h6ruf09e.fsf@ledu-giraud.fr> <861qixbum2.fsf@mail.linkov.net> <86wn0opgpi.fsf@mail.linkov.net> <86ilc78zc2.fsf@mail.linkov.net> <834jnrek7w.fsf@gnu.org> <86v8g77iof.fsf@mail.linkov.net> <83o7lzcxm8.fsf@gnu.org> <837csncfz1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40326"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: juri@linkov.net, manuel@ledu-giraud.fr, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 02 07:20:00 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 1q4xCg-000ADl-Fr for ged-emacs-devel@m.gmane-mx.org; Fri, 02 Jun 2023 07:19:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4xBc-0007bS-0A; Fri, 02 Jun 2023 01:18:52 -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 1q4tYm-0001uY-Ha for emacs-devel@gnu.org; Thu, 01 Jun 2023 21:26:32 -0400 Original-Received: from mail-db8eur05olkn2072.outbound.protection.outlook.com ([40.92.89.72] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4tYk-0007lG-7r; Thu, 01 Jun 2023 21:26:32 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZjZNk29jcwD1sEIoTgprh9m5fZ/qZC8WkSab6yoegv62JBH7f0KCbiiB+swGhW60nL7M5hoMM94znqWHeFZkZnSe77t79DE3A2bVPWqomsbhXkwgpkGIR3hizH7xBJN7H/omrSGqCIu1wmJvNy+5uA3EIfaN6IilCJ4B//g8BzrITLWQ87yvmG8pR6zZmwrp2XomCUEcL6+2NGChzYp2nD5JaXZyl+FG6YmCLWiUNYuwMwLxI2csJ9aB7cCsiW9RzvG+bva0vRsEBjqJh/FFBvzl7GA/nGtOYyIUwinT6ACQHmr3pJjN01TlEek7sswnRM2/Bke/OID4Vvok4IQlIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8nMEvrMsNyEdOnbvWpXhzqdtWT8KAGG+ajTNBPK1Uns=; b=LI7ygMENWXQ2fAVEta/YMz+HMObWUlY1xLlwAng5Wf5KP9ADKTixW/K1Z4SPp0T9xUOu6+oeEhQz7BU6dsXDbMFYk0Q4ihYKyo8g/A1yiW5XVB3OuQLVY6+lyqGDa1z/oZe3gREmHChFPKW/VCZCXQSN1VPCzmezYHUL2gkUqT6d/Smy+oZDXtyZ1++NnTTrJ/v+fzwcog12kHyK2bdEXen39bjanfaodyLESdk8630BeMFkuS788+t1vFqb/+wMiXOnz7FH/t1imBtmK2Ebo8myRtCSK44xZbfhzcwF4wUrk+SZ2afehmEPmP/5ZOS/MIittfvH4iPuB4by2nEL8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8nMEvrMsNyEdOnbvWpXhzqdtWT8KAGG+ajTNBPK1Uns=; b=q4vRGU1dFtSY5RKJ4VA91p4qqa4rgVwtVOLFTO42R5U9WkRv6OEniCnxbT5svh3nf1s3jaueoxNpodm+KY/Dc52+1Zs33J+IlIHhkf9JDXGo9GQb53xIO+zmWBN65Qys/Ydscqa2zfomw/EwNwFcUhK+2741VK/LO3D5tLf1lMUHumi348vWrTyKZ9zTl6CjJq/y73zFdFQGTgUOVQ/uFuNSdH6/2idheUZJcLVc2q2xMIda3SiKs5j7L8n82v1U3//GrFHUu2NAy4v569MdwyN9yNBOnQYMWfAYwFAh9ODbUBzhCNe8K+RxI8hHkHH+mbnnQcKXuhdNlCAvaCcWDA== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by VI1PR09MB4334.eurprd09.prod.outlook.com (2603:10a6:800:15b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.23; Fri, 2 Jun 2023 01:26:27 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6983:1def:fb14:21bf]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6983:1def:fb14:21bf%6]) with mapi id 15.20.6455.020; Fri, 2 Jun 2023 01:26:27 +0000 In-Reply-To: <837csncfz1.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 01 Jun 2023 12:19:01 -0400") X-TMN: [ARt+gKkw6Og1KaLnWj9Nx3ZroqobNY39] X-ClientProxiedBy: BE1P281CA0200.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:89::16) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <82wn0mejst.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR09MB4977:EE_|VI1PR09MB4334:EE_ X-MS-Office365-Filtering-Correlation-Id: febc1be5-fb59-4f99-a48c-08db63086297 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zpIxbflpEAocOa/hizgoBJa+SUYgd3ycWcvlF8xV4SUjAnbsOm3nG5mxDcG+vSZeJS597iwMWqjUPX+96Bs0a4Do8X6k/X4WIoO8KAP1kHsZOvslltfTnj/VEopNs1MhXDaY7oxENrQxUqqQCC09h8VnhVXUXvO5CJelHL5hO2nvWf44z7YTu5E/vdiO4FpSBExplYJv4woXxxIxntElm5xKd3cpOSfroRtl7lDfZZMTtV2+AZiGJeAhh6hpHm5iBAE73oB7RQFlDWJvzbKhCc7ZVNh7S0VR++dncL/H2iO3JOkoWNABPPZo4bVGZMWjbn8QXOfJUHu3EFBErZ/eJ1qDaJSbCvFy8OLk81yJ4Pfa7ouspc+YSvdjKeatNsh+Z4ShF4RZaescJG4gJqxWbGLefF2+O+L+dMCmCM0nVojt0iHbGtKOp5QRzARY6xkq/vALGO8yBkJ2uh0DMLGDUghKphu1z+QMYJnC+91d5pMP8biK2GzTaqcQYt7Ac4ejuBpgl9FFwyxFLpGNVneCu6qwm2qqHLzlpXPSRdhOgwi3lF9IjhOuGDRLTUMIew2/vy5akrQO0fh4jupZyOxYDFnKiQiA786wsiLZkPH3zuUFFZMlOuo4CmP9J1Wtbkd/ X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?mjWobICVpOlALjwVKZW0fI5UatoJ1A1c5pK3JIc3gyo0JXWntecvN6b71FXJ?= =?us-ascii?Q?rnWlVfoa7NPtiVkAWF7EiIscZsTfCK2wMNK7SI5mw0PWrQKWUlnPyvQEtwjs?= =?us-ascii?Q?GX15a3OGWV6u8g5GWh2DVi4XSI6/LfrgatXc2jS6N/olzvfnOmu4Cm5lDtvY?= =?us-ascii?Q?48UzVUGz5Z5H4NlVhvt/Y4TOvOEGVGSE+bDQp4+0wFcK4yMwBgkimMD4TQE2?= =?us-ascii?Q?X5UbIQQY5dkEiRBtoRvgtqVA/jCpUTPNZ+ISKHCwduBZG0smhPcnV8EeMClB?= =?us-ascii?Q?scQlejZPsJD9RU5Jj83CioWF+PISakjgse2KVV76Fuc2ozLzlWkQkUJu+/mj?= =?us-ascii?Q?wGlp2VinE1nFIe93MZHrWDU4Pu/+qqXH24P7xFTSTM65CYKVSLPM9zlpwe3L?= =?us-ascii?Q?PlglKKmTh6LK8kC0mfQ3sfzDhKTAve1mtha4VnwmP/r0AO2bT3XlciEef1oZ?= =?us-ascii?Q?UMM4EkD9NFjBgIuvpB4S2ZXQaa/swLW/AnrHaTlN3QZ6tNHDcDwnp9KHenKk?= =?us-ascii?Q?h6sU0m2yp3lQhlKC5F5muNoI9IRz+NYQJ+zPtSGBZkZuqDjirJabghzkr58T?= =?us-ascii?Q?tZiAXw00CN9G8Sz+t+W8NBOG5WIlaaa2k4DQBjWcc7RM2A4UTHqg249m2RAr?= =?us-ascii?Q?7F X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: febc1be5-fb59-4f99-a48c-08db63086297 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2023 01:26:27.2748 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR09MB4334 Received-SPF: pass client-ip=40.92.89.72; envelope-from=arthur.miller@live.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 02 Jun 2023 01:18:49 -0400 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:306540 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Cc: juri@linkov.net, manuel@ledu-giraud.fr, emacs-devel@gnu.org >> Date: Thu, 01 Jun 2023 15:45:53 +0200 >> >> If I try to illustrate with an example: consider a two-window setup with scratch >> buffer in first and info buffer in second window. If presses a key to execute >> next command in other window and then 'm'the system will choose commands from >> selected window (self-insert command in scratch buffer) and try to execute that >> command in other window which is info buffer. Tbat is obviously wrong since user >> probably meant to execute Info-menu, by default bound to 'm' in Info-mode. >> >> I don't know if that can be fixed by perhaps manipulating unrread-key-events >> list or in some other way, perhaps by putting input key back, or by some other >> means. I haven't managed to get it correctly and have given up and instead tre >> to address the problem in more fundamental way by making those functions aware >> of the context they execute in. Also, even if problems could be fixed, I see no >> point of using such method in this particular patch. > > I don't understand why you see such complexity. All we need is a > command that will do > > (with-selected-window (get-buffer-window "*info*") > BODY... No you need a bit more than that sometimes. In case that interactive is doing some prompting and buffer dependent setup, you will have to wrap interactive body for itself, and function body for itself. See Info-mode or Info-find (I think) in patch, but conceptually, yes that is about it. If you can live with wrapping commands in with-selected-window. Due to fact that interactive form must be the first form in a function body. > and then we need to bind it to, say, "C-x 4 h m". Did I miss > something important? Basically that these were two discussions, one where Juri asked me about my experiences about running commands in other windows, and one about the patch. Juri dislike the idea of wrapping all commands into with-selected-window and is trying to find a way to transfer command execution to other window without need to wrap commands explicitly as I understand him, which I hope he will find. The above is discussion about that general command that will send input to other windows. Btw, as I understand it, if commands are wrapped in with-selected-window then yes, they would work with pre/post hack, but it is probably more user friendly if instead put mode-map on the prefix key, since tools lke which-key will display a nice pop-up of available stuff in the mode-map, which won't happen in case of pre/post hook. >> But for the suggested patch for help and info, I see no reason to use pre/post >> hook to switch windows, I can just use with-selected-window which does >> exactly the same switching for me in 90% of cases, and manually fix the few >> cases which needed some extra care. > > I didn't say anything about any hooks. As I understand the confusion: two discussions in one. Perhaps I am just confused myself :).