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: Info-mode patch Date: Tue, 04 Jul 2023 00:24:39 +0200 Message-ID: References: <86fs6ertto.fsf@mail.linkov.net> <86wmzpqva6.fsf@mail.linkov.net> <867cropyh3.fsf@mail.linkov.net> <86mt0kulli.fsf@mail.linkov.net> <86wmzmzs1s.fsf@mail.linkov.net> <86edluyxhl.fsf@mail.linkov.net> <86bkgxfm34.fsf@mail.linkov.net> <86zg4gddtf.fsf@mail.linkov.net> <86v8f2xkr4.fsf@mail.linkov.net> <86v8f04yws.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="18331"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 04 04:25:21 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 1qGVjD-0004aq-P3 for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Jul 2023 04:25:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGViI-00047H-Px; Mon, 03 Jul 2023 22:24:22 -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 1qGS3I-0007rM-Fv for emacs-devel@gnu.org; Mon, 03 Jul 2023 18:29:48 -0400 Original-Received: from mail-vi1eur04olkn0803.outbound.protection.outlook.com ([2a01:111:f400:fe0e::803] helo=EUR04-VI1-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 1qGS3G-0001uL-CF for emacs-devel@gnu.org; Mon, 03 Jul 2023 18:29:48 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e07Imp31rNO0ksOz03dS2jFPdfJ4CTSjV2kuPoJr4h9/2rH1LpmjdknmiN1JAgP+T30mpLR97X1IG5JNHBbx8lX3VjnxzP8UL/bLBVa7x8EeRlMhY7e5xHJnkXnWzn+205MGOTEq5w2k53p2prTOBCTv9Ot8KO7jCgRHxVz7LZ4hrftRZiP9gtPCQtSsOKngLNNu80Gk3ou8z2y3C0cW0EPeAYx2VY7daf31k3bs5jaXhaEy5Cysy0STrC+LbfCqpd7YERMamioUT/9P0Rsxq3nOHJp5MReXaXSuNXhiNscBWnPaiofKcJ09bQ1TGKPSSomRnDN/VAJ6Hl+bpl9VIw== 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=qp5yWuFCVeSCDgbbgPpR+DQazNAG+l9BtRfYEGvKt6A=; b=lWmPwh+2fhH4bAGmUNY15TbKpqR19PBnAyYy4YSi7Uacl8SwugNd1FTHX7Z/udL+8xA1GWTuWhZRixHrAVakJXXC7GJix1FOVFLYduvzs468G7k1Pat3ZgBTuxNY+zOJjqzqZqGnwQuFq7Yn+ensQYhy1sdqQQsjK6FXX89Ge79kGCwH3WSiGA5tD+aGcis4g25iBW7hmN26TqVWdBP4Wx2TuKzhhYBufeFYeVkCDPoM23TgySyw7IqDgk99Xf+iKGneThA/dQYzTr+u2MhY97MNMGRxIR0sKFuIiaprGsuJsH2zyHi7AGiCY4vfdc1zswJGquruW10KXcyolz/gNA== 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=qp5yWuFCVeSCDgbbgPpR+DQazNAG+l9BtRfYEGvKt6A=; b=LS8r5BDE6akJecGOdEDZ3vWK0QtQmJDF0ED+X/HIAiPVCUdNuhZTgfz4znIWun8946hFVONeLt+nB6qiOTiZmxjkejq1C00m82/GWkKz9CHhd8bhmiy5PJA4YC1mXuOuC2nyMhmoc4zM22nZeS+VNkHERJbdpjzAfg8NVmqh1XYqkWcjaPlAOYa2Jzzg5K67WsiNENvHqGK0uPjh5sYt6U846rOd78fnGZ6yDyq8j8EDT0Kyf7lkFo7BPRmj00vCTC/uYvbr0GrUwK6jsoeXG+SW/PyS37KQLQ3UAQRSo81+aXZYJbUcZ0pGM3fd6kL/zvBSGYOBtg2+RuDr9rvlPQ== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB3987.eurprd09.prod.outlook.com (2603:10a6:208:19a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 22:24:41 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::4a5f:42f9:d78f:2021]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::4a5f:42f9:d78f:2021%4]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023 22:24:41 +0000 In-Reply-To: <86v8f04yws.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 03 Jul 2023 21:45:23 +0300") X-TMN: [poSMYNWXq3X1Bbgu1yPZ2lAYmRNxkmTl] X-ClientProxiedBy: BE1P281CA0086.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:78::10) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <82bkgs63bs.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR09MB4977:EE_|AM0PR09MB3987:EE_ X-MS-Office365-Filtering-Correlation-Id: 00ab2058-576c-413a-ba83-08db7c144b5d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3yjHSmjfbdQPDHFbXTmUzLbJocAQafqOksIevi3SOLNjGKoqxNq1WIm0s+Ij3GEGOA/Ue0zLahJw0ZxV9SrB7a4hEcszgNrPltppAtJtRMskSNT8Su+s79iVzuTn7/VmzmPsSPbpxIajceReoeBaYKpERHyyqou5dEC7GAKot+L9nqhwc/3dYZE+XUdxiyg7n7RhAwbWY11NSNUxSqmfSzjZ4jLiKfQ5tShBjr1JgN4PLl0XeFPoGM1UKsjxi77vTk1GVVZ8d4nSBwqsNH8BxdfzbaopPhjIAXmB5pNz4RUxICOLfqYldkWLlxTOsuE0STdWCG1YNZ1EJvqMi8WuedfJt05AKUUcZtxui8WLrnXN2ykJ/6uOHKKUeams2yf11B8OPXTM04SzO6Ft5mW169WbInZOQUB1F7or4FTOT1+qVYiki583bNUGN8xHeJbVliEWKGwHQOSiYHytkWR4aj0g3FkK1oImDsxLIawFcriwG/5pTpTy81yP4VEcqCtFB1KOsagAMijThx2sLleLt1YQ0faRfLbtnq+wO1ttSkyMp4vAIOqCdcVzGk14+i0o X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?5hkM0OUiPgJ9Tis5HGAsblhLwLbXsbDtwKq+8F5XhrGEXQkRvMqIeAqR9+Uy?= =?us-ascii?Q?3lFl8zG3y/3cTWExSgsOgLp/Y+Qa2dzv4BkrhCZc+awJr75ShWX9nIMOQkJx?= =?us-ascii?Q?//xYjBHkyd1wC2O/PDaFmv2SzHmdrTJ0BS5t3aHtXRdnXGcmytZ0IxqB+HtT?= =?us-ascii?Q?ZeZvTbT7Xqeazkjm07GVJeRhNvwGrZg/kpFwWbt4RD60pU5RJdXsYMUDf5RU?= =?us-ascii?Q?abt1fE4ddgl2X8beN/VMqaNsozff3nK53y462l36xlPDZwe2QLeptLxa8Rgv?= =?us-ascii?Q?fVqUS75ZKwD1RVGeQ11mQ0cJ9PKcMTVT03Vfx/KhFOh6ePCPAP4aFhk/no8r?= =?us-ascii?Q?m3zVHQC7fCrJWBHbifw2uEaGQaX/ik4kii4YWHIw8XG4kV+Ohw9wwCFImMQG?= =?us-ascii?Q?DOSVw1xugDLKsWa76ytK9sFM7WEyZOo/yswf+8uYrjr1JPm8YvtP5R3/4f62?= =?us-ascii?Q?wTxlpFQqiOu3WhcU9qCcY6dTPOXId2fD573BZTTUarbPSp2poSs1DDEAjPOQ?= =?us-ascii?Q?eMUA4uDlB8hS0NBYNp15ibK55NuDca6M26l7glYGYduxil0lUreVZtR3fRUO?= =?us-ascii?Q?wlNET8q5/RA7usOqdYXzlZJAZJG4Wld4VtAtTgyci+bQF85LYo7pj2EenGbC?= =?us-ascii?Q?7n X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 00ab2058-576c-413a-ba83-08db7c144b5d X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 22:24:41.3903 (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: AM0PR09MB3987 Received-SPF: pass client-ip=2a01:111:f400:fe0e::803; envelope-from=arthur.miller@live.com; helo=EUR04-VI1-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: Mon, 03 Jul 2023 22:24:18 -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:307397 Archived-At: Juri Linkov writes: >>>> Is there some way to tell interactive where all propts will be placed, without >>>> parsing interactive form and checking strings for interactive codes or something >>>> similar awkward? >>> >>> Yes, there is such way by using the variable 'minibuffer-follows-selected-frame'. >> >> So at least in theory, by let-bidinging it to nil, it should keep prompt >> on the original frame. I did just quick naive test, and ended up in debugger: >> >> (defun info-menu-wrapper () >> (interactive) >> (let ((minibuffer-follows-selected-frame nil)) >> (with-selected-window (info-window) >> (call-interactively #'Info-menu)))) >> >> but perhaps there are more tweacks to it which I am not familiar with, so I'll >> leave it at that. > > What happens when you customize minibuffer-follows-selected-frame > to a third possible value that is not nil and not t. From docs: > > Any other value means the minibuffer will move onto another frame, but > only when the user starts using a minibuffer there. The very same. I used a symbol 'something as the third value. > I guess this variable is not intended to do what you expected. What should I have expected? :) > But AFAIU, what you need is only to use with-current-buffer > wrapped around the interactive spec? There is no need > to select another window/frame while reading from the minibuffer? As said earlier, that highly depends on the work done in the interactive form; but for the majority of commands, and those in info.el specifically, it should be enough I believe. This works: (defun info-menu-wrapper () (interactive) (let ((window (info-window))) (with-current-buffer (window-buffer window) (let ((args (eval (cadr (interactive-form 'Info-menu))))) (with-selected-window window (apply #'Info-menu args)))))) I would still take it with a grain of salt that it will do in all cases, you should test each and every, but in majority cases it should work I think. >> About wrapping; I agree that it is messy to go through each and every command as >> I did to modify them, so for old existing commands, it is definitely easier to >> do the wrapping, if possible. I just hope we get a better way for future command >> writing. > > I don't like creating wrapper commands too, but it seems there is no > better way, at least no one proposed anything better. You were against wrapping everything into with-selected-window, now you everything wrapped into another function :). The positive about wrappers is they will work with old commands, and if you turn that into a:core package in Elpa, then even users of older Emacsens can use it. So I am definitely not against wrappers per se; nor do I believe we should rewrite each and every user command. But for writing new commands, I do suggest to implement better macro; because all this can abstracted away, so we don't double all the commands in the future.