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 21:57:13 +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> <87a6k2nlr6.fsf@mail.linkov.net> <83mto2rlyz.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="27612"; 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 To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 24 21:59:20 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 1mTrLq-0006xz-Q4 for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Sep 2021 21:59:19 +0200 Original-Received: from localhost ([::1]:38636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTrLp-0000KZ-JD for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Sep 2021 15:59:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTrJz-0006Tj-6r for emacs-devel@gnu.org; Fri, 24 Sep 2021 15:57:23 -0400 Original-Received: from mail-am6eur05olkn2029.outbound.protection.outlook.com ([40.92.91.29]:59744 helo=EUR05-AM6-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 1mTrJu-00012E-Ju; Fri, 24 Sep 2021 15:57:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ibk6Y1MiWAhui9ykK7S7AxPM/pqyBHqFPH4BezMP0BkkhT9dGreNvwRfoR+Oy3zz/rdVt189p6GPEKZy/o7MfSopJfVnWI6ShvNcO/zkpFH6axo0+1qKrQ6lAOcETvfH5wkuk9bwHpz0zlhm4r9fj6Vn37fCY4NGvsbY4FFtX2JyTdGt2IkwP7xZXpaYRCdxELjorzeTJtK1Mhl4BvBv348Eg4V8YnplZILGzN/ewCQX+DYt0sXco9xn0bPuh34PIv9lmy95cTsd1LCyprGMrl842rBF32mdCb12gM1XQjPXL8lucOUkXcg8BDVh0q4KlJHN62guYOKZ9J8IaS42jQ== 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=lIJayIlhAqtZUUFeaEThrrPZjl/wpNJ7QpysEPCaFWw=; b=VV5i9WWddzJMIU5TJtya6VgAdKrKZ4aVHO0Kcd8hG/dxlmMAQc9NB75eHp49hKwl6g9W3BemfrPwERkesBHuBZ7OIh6FMYUFIZD16K4Hc9donkq2KYKZntoowG7K91OHOqfZN9mcIjrk10T2LFOIyj9lsygW0WTh6G0sGneSXehhvOalMjS5mXGCdjg776bhj7JtXGFpdFGjUTUlhXXqUoHcjvibTHlwXNbGRCXLD7b2IFZJBa80EimfDZbfki50VE6rfUPle38lpDToZ8gaNpDhHtumHU1M/sIAtfXayxQp9p//kn1VbAvGDxgDuj0efUDt8cMApKABLGFCV/Xrpg== 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=lIJayIlhAqtZUUFeaEThrrPZjl/wpNJ7QpysEPCaFWw=; b=N+7CyFg07OPeGMAHgYxkxa11CoTAMtIT1TOvR2O1Y3isjeKCXYPntl163zxRMQ/cU+zkKmGu1vgfzN3oSvI8WQkM7xL9ChQNPWW89MnonS0UHeqJZRINz3UymzNwrj29Q/dsHlfHRvyJFICSaHLCPKglb+gN/116ZL3T+82oHeNq9K02CsfkUnU9urCfpSxNqyki7vWhKZzjdTCtu1x6pa0AZuYTmnlpqccHZ95q/Nq2faQjcBabPoH5o0sTCEv5IDF4DPk8hjya++vmpta+z0QhkPG9bwK6PEKwXrNkl6cxRzI1w2qOJlMhMPgGShSwcgSXzShtj5P499xiECkqHA== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB3410.eurprd09.prod.outlook.com (2603:10a6:208:16b::33) 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 19:57:15 +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 19:57:15 +0000 In-Reply-To: <83mto2rlyz.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 24 Sep 2021 19:12:52 +0300") X-TMN: [XEo75zrTCKQGLATci2s5e9k860n4AGiJ] X-ClientProxiedBy: HE1PR07CA0045.eurprd07.prod.outlook.com (2603:10a6:7:66::31) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87v92pbvc6.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by HE1PR07CA0045.eurprd07.prod.outlook.com (2603:10a6:7:66::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.8 via Frontend Transport; Fri, 24 Sep 2021 19:57:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e1412ac9-64cf-4fc5-d39f-08d97f958193 X-MS-TrafficTypeDiagnostic: AM0PR09MB3410: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: An5eYJ3zSa2sSeegPZ6VbXJ9Ny/JVKtLSta28QyHp9CIt6nItYRTogL0EvPtl42Y2PwNONOQYOPXL4GsKI/26cnA5FmUGUPAEvjwnkIQNpdhE3Q5v8rVRVQEoEZS72y6CKNQ2qq7uq5vQTQ0bwlcL8ISmCFCZ9yidGUgSKGO3Wi4o/70mvtRqh8VA5LYN4s/yIa/WI4ZQ0mXXrACB6gnKlbhiMX7T1uHTRXFUhlXzcpukV6evTF3dDhsZ1UD05XOt77rw3LkMD/WDxmVK6xHVm2sPVwDWPi0m3gBVqffq/OBYIVo3M1UsxdNLj4XVghmv7CZsFdp1r22kdFMTMPjsdGBY1wAr2QJK3FyQPV6fMs/wuXEXi/0CxfJ27dpAZZFxdcJ1ShIuax+2InMN3v8sY//a9NwzDsaSID9Pb/cmYFggA/chcrvaJwfEwey9yBa X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CH3xyEcWsE6HxG3+P4c61SDk1MSWV/NtB+ZpxNJtoLOzCupaDjJTR/xPqNJYBpiWURuqvcvcPcVOPzTTS0MSo87ya6VAYjxjJcjgv+bQFUfdTdH++ThQ+VltifeIHP6VaE8eEc8c2VcURWuTNPksuw== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-72e6e.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: e1412ac9-64cf-4fc5-d39f-08d97f958193 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2021 19:57:15.3336 (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: AM0PR09MB3410 Received-SPF: pass client-ip=40.92.91.29; envelope-from=arthur.miller@live.com; helo=EUR05-AM6-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, 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=ham 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:275426 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Juri Linkov >> Date: Fri, 24 Sep 2021 18:31:59 +0300 >> Cc: Eli Zaretskii , larsi@gnus.org, emacs-devel@gnu.org >> >> > am not sure if C-h M-h is the right, but that's just a detail. >> >> This would be a nice command. But why it's limited only to help-window? >> It could allow reading and running the key sequences in any next-window. > > Please, no unnecessary generalizations of this kind. Or at least not > to cater to this particular request. I want a _help_ command, not > just a prefix that runs any command in the other window. because, for > starters, what if the *Help* buffer is not currently on display at > all? Here is one updated without the unnecessary let statement. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Send-input-to-help-buffer-form-any-buffer.patch >From 58f8a59c9e93f081f76f8cf773d78be3b7d3740b Mon Sep 17 00:00:00 2001 From: Arthur Miller Date: Fri, 24 Sep 2021 21:54:31 +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 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 551cf7e1a3..94fce1e8ec 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -875,6 +875,21 @@ help-insert-string (with-output-to-temp-buffer (help-buffer) (insert string))) +(defun help-do-command () + "Execute a command in \"*Help*\" buffer while working in other buffer. + +If *Help* buffer is not visible, the HELP-DO-COMMAND will be aborted." + (interactive) + (if (get-buffer-window (help-buffer)) + (progn + (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 --=-=-=--