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: bug#36767: 26.1; request: add more quick keys to the *Help* buffer Date: Fri, 24 Sep 2021 09:16:08 +0200 Message-ID: References: <87mtrrq7t7.fsf@gnus.org> <87eed0nsez.fsf@mail.linkov.net> <83bl83zp5h.fsf@gnu.org> <83y27nvnb4.fsf@gnu.org> <83ilyrvgda.fsf@gnu.org> <83h7ebv39d.fsf@gnu.org> <838rznusle.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23345"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: larsi@gnus.org, emacs-devel@gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 24 09:18:50 2021 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 1mTfTt-0005qS-Rw for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Sep 2021 09:18:50 +0200 Original-Received: from localhost ([::1]:41900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTfTs-0005n2-MP for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Sep 2021 03:18:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTfRa-000310-MQ for emacs-devel@gnu.org; Fri, 24 Sep 2021 03:16:26 -0400 Original-Received: from mail-oln040092074071.outbound.protection.outlook.com ([40.92.74.71]:50307 helo=EUR04-DB3-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 1mTfRN-0001Ab-QE; Fri, 24 Sep 2021 03:16:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nYBdGecQBBeExtuI7v/NSc+tGEw9uGDoCSMiQ07dXHjmwZTfNk1VTZg4HK/AkWxT1KChlJMofGuEozeHBV9+FC8brf/HJ34574bccPNPUSon81WAriM2dwOESpet4eaH9Ck+BkHw+uqfGM5XHYZOmbZOYnhfg/zGsMY7VLTD+990R+9VXU1NgNrQo8BfwQ2QjCBtaT/UmYA+sZKV+kzNcRwQ718BPq9axcnRaVIyVa1g4rFR0R+UnttnDgJXIqI6TSfXROAD8IIq6sTm+51O2QwLB2ER6BDRhCK39Sxb9caW3Eh3NFTucqtc0GqTE6vfQ9ePuY0qXDOjzAx+qsDBwg== 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; bh=5A+QnUmdorTQco+OeoHJgTD4ByNw8gOnOGioz6Aog1Y=; b=B/dHvyy6OX691Ki5wRuAkHN0no0aEr47EO5zt2I8P1K0CnvnzNCRR7nvhYf0pCwzT7BrvNlZTLi1oD30rU+gKQbF+qWzqKYSCY3R6Dk/SiWm7uzfEgAWhqfR51fuH3GfUaIYRROOW9nPEmiO99ZbFlaGPwoT7BlyW5KhifRrnaDBL5ofI4XIjWm7KicY3R0wsAfA+fdGnnh+a9jKM7uI5JSCRAuG6AsvG6IGvRq6m/3LD8f2N5W+o5nmnd+XCplm7CVGeHbCzyv8Xg1KjYuLWVzuHR34bJdk4HyHzZFWVOUVxBppdlHLCMhmoh5SjnbfLWb3ejSvsKyteyU3zUfJ/w== 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=5A+QnUmdorTQco+OeoHJgTD4ByNw8gOnOGioz6Aog1Y=; b=Xg/y6PDpGwVCENd7r7WGx51deDOJzmQNO94p2AQzQQAplwimi6lVNAkGkfpNu2V8SXkG7DOfvBYKUnSzSwXAkdI3McO2iYpEFjEZN6Gh719iVHvxt5WajGQtGDwsDfY1jKnv5lNdmnA/Yx0xDe+kxYUSVdhiFgKeCsCvOqK4WD/eMKEDLmFc/Y44CpHmyFTShrcuS1xiQuJOE2QuCSYcBbBUqWFwRflculPVQBvuebgWt+6+1z6dZIs696215RD18CujksGR+WVW8Jl5eKk2d/DfTJYfczooMjsjnFGa/zwJOMUoY4+idc68TSMnfeIWy5FqVOA95NabSPgWxnROdA== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB3347.eurprd09.prod.outlook.com (2603:10a6:208:16d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Fri, 24 Sep 2021 07:16:10 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc%9]) with mapi id 15.20.4544.018; Fri, 24 Sep 2021 07:16:10 +0000 In-Reply-To: <838rznusle.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 23 Sep 2021 20:09:17 +0300") X-TMN: [Xkzy5bYiPBoIEgYFmwZNH/ISNviCxf8k] X-ClientProxiedBy: HE1PR09CA0051.eurprd09.prod.outlook.com (2603:10a6:7:3c::19) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87tuiacukn.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by HE1PR09CA0051.eurprd09.prod.outlook.com (2603:10a6:7:3c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Fri, 24 Sep 2021 07:16:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b0b3ced8-aa84-49d0-3a55-08d97f2b2ee8 X-MS-TrafficTypeDiagnostic: AM0PR09MB3347: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F9Xk7/2H3nt3GD7z1xiDef3rS63ZJ4B2tJ/ztTWam5H82PfaCuqQpEh0Cp30IoR/VLlFQlXkGFu9PEJy8EGcPIb7aOLdFQRM6NzteiroGUNJLVOkU9cBdpo4xMp+omPNgOY+sIJU5pbDSlbXZYIqLYFLQy1I2quYbq7p83KfXg8xSv8srYrYRYWV0CxT/JsZX6xEW6DHbmnhIFvS+ZSr3Wznd0VyujFvUCIXgoyLDbhXFXc6zFrIW1REBCdyDbLtS5CrZU4c8xdFY0an8S1UBX/va/Ds6vyYtJz6DT5x3QW8jBkLxS9DnYMNNgfcgtvxshTyMSGgcZtTcLd2/6IJWNk14mrxwzfF78ScK1Zgm7Q4cIa7zpZPheLSkWn17Fv3QDmxS8BPOhS0zyolx2gFKZx/nHQ5T5IU1gAGA39CTEHJOaO+qGScpfNpcASNwEBL X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: glw7+kqHRKOc55cmjgSkSeS+fAhH9UJwstzrffATAaPVWNVcauevIMZaGYfNhQOzVg35y75cSNXxt0eLR+CZHRJe+1lpYLM6fZBh4zs6wSSQfhYRxyOYbTCsavZcmi7XWuRCGUFqmK9zHV2vle+KvQ== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-72e6e.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: b0b3ced8-aa84-49d0-3a55-08d97f2b2ee8 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2021 07:16:10.0691 (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: AM0PR09MB3347 Received-SPF: pass client-ip=40.92.74.71; envelope-from=arthur.miller@live.com; helo=EUR04-DB3-obe.outbound.protection.outlook.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:275390 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Arthur Miller >> Cc: juri@linkov.net, 36767@debbugs.gnu.org, larsi@gnus.org, >> emacsuser@freemail.hu >> Date: Thu, 23 Sep 2021 18:05:29 +0200 >> >> Anyway that is one way; commands in help-mode.el need just a trivial hack to >> make them usable from other buffers outside help-buffer. And than remap them to >> global keys, or just remap entire map as I did in example in mail. > > Then by all means please submit a patch along these lines. I came up with another idea last night and sent a patch, but I am not sure if it got to right place, I don't see it myself. It was an answer longer in the thread to Lars. This one makes it possible to run any command in *Help* buffer, not just those defined in help-mode.el, and those not need any patching or wrapping of existing commands. I don't know if it is correct place to put define-key for the global map, and I am not sure if C-h M-h is the right, but that's just a detail. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Send-input-to-help-buffer-form-any-buffer.patch >From 77c404012dee603435b51b6a55be8700ce34a665 Mon Sep 17 00:00:00 2001 From: Arthur Miller Date: Fri, 24 Sep 2021 02:09:42 +0200 Subject: [PATCH] Send input to help-buffer form any buffer * help-mode.el (help-do-command): New command. Install help-do-command in global-map on C-h M-h key. --- lisp/help-mode.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 551cf7e1a3..a150cfa15b 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -875,6 +875,20 @@ help-insert-string (with-output-to-temp-buffer (help-buffer) (insert string))) +(defun help-do-command () + "Run a key-sequence in \"*Help*\" buffer from other buffers. + +If *Help* buffer is not visible, the HELP-DO-COMMAND will be aborterd." + (interactive) + (if (get-buffer-window (help-buffer)) + (let ((__key (read-key-sequence "Run command in *Help* buffer: "))) + (with-current-buffer (help-buffer) + (call-interactively + (key-binding + (kbd (edmacro-format-keys (vector last-input-event))))))) + (call-interactively (global-key-binding "\C-g")))) + +(define-key global-map (kbd "C-h M-h") 'help-do-command) ;; Bookmark support -- 2.33.0 --=-=-=--