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: Thu, 01 Jun 2023 10:50:36 +0200 Message-ID: References: <87h6ruf09e.fsf@ledu-giraud.fr> <861qixbum2.fsf@mail.linkov.net> <86wn0opgpi.fsf@mail.linkov.net> <86ilc78zc2.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29231"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Manuel Giraud , 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 11:49:23 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 1q4evq-0007Lq-39 for ged-emacs-devel@m.gmane-mx.org; Thu, 01 Jun 2023 11:49:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4etr-0005Hg-6H; Thu, 01 Jun 2023 05:47:19 -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 1q4e5y-000542-OA for emacs-devel@gnu.org; Thu, 01 Jun 2023 04:55:47 -0400 Original-Received: from mail-db8eur05olkn2082b.outbound.protection.outlook.com ([2a01:111:f400:7e1a::82b] 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 1q4e5w-0008Dr-M4 for emacs-devel@gnu.org; Thu, 01 Jun 2023 04:55:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M09kMA5wE+DNZ4QjjFbXsr1YuoUvkl/eYRimaP2ybAiLqlseC1rWuhLQKfxFeVQD1p/OyCiVZhNZpMmDiH58RHmNKNbrgnwzS+VUeVV173ZiW9Sfo+KHkaAgPK4bDmuNuQDZ/aVK08iileyfdPq8zS7eTW4rhteH0Aj8WkT78EVZudPHjesL6yRmKLmG88BBE6/+QVIF2KT5LdoksA7y0UlyDwVYMwfcUGBeVeOBslGMqgMM/F6Itk98qGEeZwr/giQf0GsDw1TmKGvzVy5feq/ROYL/4OVZebi+wS9yHLuU9vRNXqPy2LimcTOu5EMpsRG/fwCL4Wzw8yekrS8T4g== 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=EeBVq+ri9+nrZfhULkje6tD6wle3L4azzqmPYHJdlFo=; b=LwNjcrxr21hHUPW/oydYkwyx1suH4+4j3xIj4QhjBbaYH6OTER/JntFw8W6uF8PtXjVQydg1ThbOXsiSla9fyuJK+kayteBZKF5NFjWvbNVR6g8VimGkbj8izP/fq4EeafAZD6YVZpeT1q2cIvpMDCTUmlFL6uhyPXQRVBq6IhywX53NEhe4Oqq3iVl0MdXlsNKz2ZAhslE9QndqKoxlkEXJnuWf7Ea/JC3Sv3cg9OKHA2Yg5sGvO0WGLS3hvW1bMWHkMpeGBATfjxvbphPYjEFb4CT9e0NPWvnVcrYHUGZVD2YBsVcwQAFUBRRrHRB2W0JRQj0F78Y+soM7h0yucg== 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=EeBVq+ri9+nrZfhULkje6tD6wle3L4azzqmPYHJdlFo=; b=Hx0+fYekltQWPnp7oqiOwfqVIexoSklqhYWkc5i/XokcA1VCe2XnL43V6OkdMRpVRDCqR76g0XkXrj7c174dyTRE0BaBlcsXibCD7MdfxHR0axfS0wJIbQuh/N+61zHE+9sSNlq0PdSy4RS5nXXsJfZydV7MprJgWI7zlcW0HRZRbHDqHt13ZVzyy10FGmlB83jCxthzLrRLGKawOBBDD4Cj3ThpTdP4Z6Ca+FbRFcIGXUYoBYI6dwWspO2LBa6EmPf4jtx3smjk/yn2pQimQSX0+FhsP7LGvoPWASCPZufX6ao6IUS7lJMlpJvIxIdIGXSOcdTZXaWUMq0EnzZ6oA== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AS4PR09MB5527.eurprd09.prod.outlook.com (2603:10a6:20b:4c2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.24; Thu, 1 Jun 2023 08:50:39 +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; Thu, 1 Jun 2023 08:50:39 +0000 In-Reply-To: <86ilc78zc2.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 01 Jun 2023 09:35:09 +0300") X-TMN: [O90NJSW4RNDiyf670I1XF4MtsdnTC5kW] X-ClientProxiedBy: BE1P281CA0241.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:8b::16) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <82mt1jk1lv.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR09MB4977:EE_|AS4PR09MB5527:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ba32c7b-0ecc-483d-4466-08db627d4614 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gwslufZc0Z4LjVLk897yp8dlICSyxJEVDotc5ar/abmb9nXWi5LHdSq+zarPZiWvOBvlNqwaiIZ4+suMzwlAUGoihxXg8TRd7IlmaqRSeAWimJbykEKUcrhZc4qCM6pgutKd3BtfOaZIS7fKnTVUdc/LWxPtOTGI+wEH48zlrINKmxbt5reWldJ6Lx1H+IzGRTZTasLNtYDUWxwBYWkoeoRkM3FdXtmJeNcTf+BwGju3t94cDj1qwOLqXlanDW9RBZlR8soriEYme4cXqfhkiK3xf/Yl9UafXoj/k4y57RQYvdtH6b++/5TUvxX0KOL1x+HBa4wU3udtfiZiuOJhusFq2aVdXwdRrWHgvUxNBFRtMPFPb25Yni+BR7LdIKdaNfyVce/GRUQtrZONzyGkAmjPBMgH6TJ+Phjp5B6b3d8o7rZkS/yMWo99BV6llrryy1lZjcbfWZUl2YJ+F/bDBH7UjPWCc8G+izdgB7OAwOe112Diyu016m6Yv8VTZa4X326J8Rm/b+nu5jDtRlVdTPneN+8QdFjz2lOmY0BcMNYeXgxlc9wZuq3KYdnjCprs0m9Uptc7FGU4uHdf+h/4hTbAxqtjm6C5Cp3qkpmksL8= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?pYIxJM+H6G6R+bhzPe6V5F+9Qs0NfPcvffNxYLiHufwi0fVpaFVsKA/cbVsX?= =?us-ascii?Q?yEXXH5K0Z8FuC7glBiC8lzaz+WKkaJpWKOKBhpEZXvd+rKoVUVHQ2c5cmyP2?= =?us-ascii?Q?T0O0AjLplTK+clFask/EwX9LxVplbItClRQKyaRO8DmIhUEgVE2obo9YLhHr?= =?us-ascii?Q?sGNcdbHQegclx0hASjhyd+68o61p2Q9ZlOttb9WAsInhib9IqAAbVCgBBNqm?= =?us-ascii?Q?3IsaZjl3/dPo6EoQGXVXkfCMNS32CjOjo2whcMVyufWA1E7G/BeYUjUOO7YT?= =?us-ascii?Q?MeVEOlz5ay09d78HPHMZIBayFHHf1jtaMfo8sL+rSs3EB1xtVr6DMyWXx8bk?= =?us-ascii?Q?VrzkjRq/DJ8expWzSKca0Anfozty8dF4NFSpz+DTPUxUmt5IiwfFLFTP9vtJ?= =?us-ascii?Q?cDEX8u26kU6m+kS9mIXdra8wB5XBXT4/6+vYjnyW92LNvHSyCd0Ih9KFG/QA?= =?us-ascii?Q?7xOB9kNqAlj1nU5UaIRIMpLN8vZDdQ7vsQAf6nyntK+0bGYESr27QGaHpxtp?= =?us-ascii?Q?1Nx/63LHJZp3haP+RzbsaXYk2SpkFiCL2I8S6n9GjN6lOHHIVvm3m0RK0S/e?= =?us-ascii?Q?+yHzsiQdNKlzfZeYOriXpRhXjncwjLdIglP5P7ffw+cLEzQ/o2mSI5c/IH3W?= =?us-ascii?Q?Pt X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 0ba32c7b-0ecc-483d-4466-08db627d4614 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2023 08:50:39.7759 (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: AS4PR09MB5527 Received-SPF: pass client-ip=2a01:111:f400:7e1a::82b; 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, 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: Thu, 01 Jun 2023 05:47:17 -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:306498 Archived-At: Juri Linkov writes: >> Why can't we just invoke the command directly, via M-x, when anything >> bound to a key is an interactive command by definition? The reason is >> that commands are written with (or without) some assumptions. > > Because in this case you need to modify all commands to switch windows > explicitly. It was a rhetorical question, not something I really was asking you, and I gave the very same answer after that one :). Anyway, pre/post hook hack is very useful, and works with many commands, but not with all, so it is not 100% failsafe and general.Try to execute Info-mode from other window but Info (shortcut 'm'). In my Emacs it does not work. My point was that commands to be written with this in mind. Another problem with the above is that this will work only for 'other-window' for which Emacs has an algorithm to figure out which window it is. But what when you have more then two windows, and wish to switch to a different window than what Emacs considers as 'other-window'? You will have to prompt the user, to choose one. The help or info buffers are seldom the 'other-buffer' so constanly choosing the window would be just as annoying as constantly switching to and from, in my opinion. 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. I don't say you should not include the pre/post hack into Emacs if you want, it is better then what already is there for the similar purpose (don't remember longer the one included since I don't use it). I am just saying that we should perhaps write better commands in the future, so we don't need the hack :).