From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 0BKEApzPEWYYEwEA62LTzQ:P1 (envelope-from ) for ; Sun, 07 Apr 2024 00:41:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 0BKEApzPEWYYEwEA62LTzQ (envelope-from ) for ; Sun, 07 Apr 2024 00:41:32 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="fS0K/zrg"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712443291; a=rsa-sha256; cv=none; b=JEY0Dfc0ESFAQWwpcnhlfX1t8aYx241D0ZX28GyKwzqZtwAGm19pYJzcPhBIsydi57ZPsV eoCnstotNLAlBgRmUKQV4AhQtoxmIn5bmM9+mAIyYvWz55H0dXss22Kv9zbn0vojDiYs7/ 0jr1nPUSJQc709ZDJCjFtSGYGdoahVh/eFub94oFE1kOVk+eiwCzrhLXYMcD19r1zzq41A NU96KNWjgPoP/SNRRS2/S3NhiBQvY1W2UvGm3Fl+q3qB3b7vFF1w4DC80g+qwb3qCEgGEv 3uBJeeWxO58/JNjsdsdHFn/Hz6QHf/X3x2F8ihAUAn3mkY/oDvbZOOxiyGhb6w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="fS0K/zrg"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712443291; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=q7mMhNYvwuWDmds3KwFpYnGIy+0jubaCP3Bf2+JD91Y=; b=p9zDhQGapR9AGJINs4SuAYFH35iJJ2kri4AfpQVmW1dYGKQejE7qBH4rEZgQHfdGShJXqv X4+56VqwPCTTaS2OpoW5oviiyt+bnNfO6gseJhgzTTcNlSl8aYiLWq68v9BosRPnhxcPP5 RqU414uHzV6tINFort+Dqk+vj7tSNOJ076vpmilkYzSCE/W1DXoGM5bal1ak+dkfnlL3Hh 53YgeH334fakn2FfLBuvrX4dB+dmDB6uxq7Rw+5DjhyRCSveFQJsA51ZQ8tSL8sJFEf7pB 2CsJwhrBdPXqAQW33auwTpP3CZ1MZo+N38eI44QfQsykYHJ2s4F0mfGNz1aKCA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 93193765EA for ; Sun, 7 Apr 2024 00:41:31 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtEi9-0001Gz-Pl; Sat, 06 Apr 2024 18:40:33 -0400 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 1rtEi6-0001Gd-Eg for emacs-orgmode@gnu.org; Sat, 06 Apr 2024 18:40:30 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtEi3-0007yq-OC for emacs-orgmode@gnu.org; Sat, 06 Apr 2024 18:40:30 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0ACC824002A for ; Sun, 7 Apr 2024 00:40:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1712443224; bh=35vtQvmEP2TJ24h7O/h5XL87str3PKw0cp2xHmb97ms=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=fS0K/zrg2lbiCoQdwhusWILdrNC0m4RbQ5nH4DIRKHzbiNC1hU2pR5FaHsxqh8c+z 6hwpB1akNTN0IGi9Z6tkPZ0TLnMl6oZXS7NwOopV4HLiBRUNCN2URjVoHnLghj2/5t JBjKNPDBmlpgbzvhJjJhtXHc8ahOSbuKWe96AcpQ0E/YgFRyk7YQxAmHHp7hKNp53b 8bJ2nUT9y2ohLp8fdPRBviWGU5I0DL1VnH65unj1ksQ2VbeLerIoM1Xhgm7lBRbzxw qAIQsY/6lGFX2wZSGl6h434yZNCHvu+FQklZqzNxJJvMIeZIpuX/HOjy2GvaLkMzBY Ymw6Gtco1nOxw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VBr0P5wsBz9rxB; Sun, 7 Apr 2024 00:40:21 +0200 (CEST) From: Philip Kaludercic To: =?utf-8?Q?S=C5=82awomir?= Grochowski Cc: Ihor Radchenko , emacs-orgmode@gnu.org, emacs-devel@gnu.org, stefankangas@gmail.com, larsi@gnus.org, hmelman@gmail.com, eliz@gnu.org, info@protesilaos.com Subject: Re: [DISCUSSION] "quick-help" popup for org-columns (column view) In-Reply-To: <87zfu6b4w3.fsf@gmail.com> (=?utf-8?Q?=22S=C5=82awomir?= Grochowski"'s message of "Sat, 06 Apr 2024 22:41:32 +0200") References: <87a5oayblv.fsf@gmail.com> <87jzlxro68.fsf@localhost> <87zfu6b4w3.fsf@gmail.com> X-Hashcash: 1:20:240406:yantar92@posteo.net::gpXnyzqO/pGmig53:AIX X-Hashcash: 1:20:240406:info@protesilaos.com::04vNJT5mc2444Jc5:1bUz X-Hashcash: 1:20:240406:larsi@gnus.org::w61J9jJTiFxKgaQg:1a8m X-Hashcash: 1:20:240406:slawomir.grochowski@gmail.com::HeAjo6QNf2QwmXJC:0IhW X-Hashcash: 1:20:240406:stefankangas@gmail.com::blLhD0Y5Qd9KzEif:0dRI X-Hashcash: 1:20:240406:emacs-devel@gnu.org::yxZ9RQ4RBg0FOEW+:2lQl X-Hashcash: 1:20:240406:eliz@gnu.org::nCrVyW6q1m4Xly+4:1pEN X-Hashcash: 1:20:240406:hmelman@gmail.com::amRX3W9YD9yQt64s:4G/Y X-Hashcash: 1:20:240406:emacs-orgmode@gnu.org::aMis5pAODQh8UKi/:8ZqP Date: Sat, 06 Apr 2024 22:40:20 +0000 Message-ID: <87zfu6p12j.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -8.56 X-Migadu-Queue-Id: 93193765EA X-Migadu-Spam-Score: -8.56 X-Migadu-Scanner: mx10.migadu.com X-TUID: xXQcU6u4/ui7 S=C5=82awomir Grochowski writes: > Ihor Radchenko writes: > >> I see no downside supporting `help-quick' command in Org mode's column >> view. Generally, better integration with Emacs built-in functionality is >> welcome. > > Great. I'll be happy to take care of it. > > But first, we need to modify `help-quick' to be more reusable. > I tried to do it, but I'm not experienced in elisp. > I wanted to remove references to global variables, so I did a wrapper > function to pass arguments to `help-quick'. I understand it's not a lispy= way. > I would be grateful for your comment.=20 > > Patch in attachment. I have to admit that I am not entirely certain what the plan is, but I have a few concrete comments/questions on this patch > From 5f343fd15c53f5bc5e7515ef0cd3049b4e0ec388 Mon Sep 17 00:00:00 2001 > From: Slawomir Grochowski > Date: Sat, 6 Apr 2024 22:11:01 +0200 > Subject: [PATCH] lisp/help: make `help-quick-toggle' reusable for other > keymaps > > --- > lisp/help.el | 22 +++++++++++++--------- > 1 file changed, 13 insertions(+), 9 deletions(-) > > diff --git a/lisp/help.el b/lisp/help.el > index 1ef46e394f3..c32d1a2e943 100644 > --- a/lisp/help.el > +++ b/lisp/help.el > @@ -76,7 +76,7 @@ help-map > "C-n" #'view-emacs-news > "C-o" #'describe-distribution > "C-p" #'view-emacs-problems > - "C-q" #'help-quick-toggle > + "C-q" #'help-quick-toggle-wrapper > "C-s" #'search-forward-help-for-help > "C-t" #'view-emacs-todo > "C-w" #'describe-no-warranty > @@ -178,22 +178,22 @@ help-quick-sections > (declare-function prop-match-value "text-property-search" (match)) >=20=20 > ;; Inspired by a mg fork (https://github.com/troglobit/mg) > -(defun help-quick () > +(defun help-quick (name-for-buffer sections &optional keymap) > "Display a quick-help buffer showing popular commands and their bindin= gs. > The window showing quick-help can be toggled using \\[help-quick-toggle]. > You can click on a key binding shown in the quick-help buffer to display > the documentation of the command bound to that key sequence." > (interactive) > - (with-current-buffer (get-buffer-create "*Quick Help*") > + (with-current-buffer (get-buffer-create name-for-buffer) Is there a reason not to re-use the same buffer? I am not sure if we need multiple quick-help buffer to co-exist at the same time. > (let ((inhibit-read-only t) (padding 2) blocks) >=20=20 > ;; Go through every section and prepare a text-rectangle to be > ;; inserted later. > - (dolist (section help-quick-sections) > + (dolist (section sections) The idea here was that some other function could rebind `help-quick-sections' dynamically. That way you avoid the redundant arguments (which would all have to be documented). > (let ((max-key-len 0) (max-cmd-len 0) keys) > (dolist (ent (reverse (cdr section))) > (catch 'skip > - (let* ((bind (where-is-internal (car ent) nil t)) > + (let* ((bind (where-is-internal (car ent) keymap t)) > (key (if bind > (propertize > (key-description bind) > @@ -259,21 +259,25 @@ help-quick > (message > (substitute-command-keys "Toggle display of quick-help buffer using= \\[help-quick-toggle].")))) >=20=20 > -(defun help-quick-toggle () > +(defun help-quick-toggle-wrapper () The naming here is weird IMO, usually the other function should be called something like `help-quick-toggle-internal' and this would be `help-quick-toggle'. > + (interactive) > + (help-quick-toggle "*Quick Help*" help-quick-sections)) > + > +(defun help-quick-toggle (name-for-buffer sections &optional keymap) > "Toggle display of a window showing popular commands and their binding= s. > This toggles on and off the display of the quick-help buffer, which shows > popular commands and their bindings as produced by `help-quick'. > You can click on a key binding shown in the quick-help buffer to display > the documentation of the command bound to that key sequence." > (interactive) > - (if (and-let* ((window (get-buffer-window "*Quick Help*"))) > + (if (and-let* ((window (get-buffer-window name-for-buffer))) > (quit-window t window)) > ;; Clear the message we may have gotten from `C-h' and then > ;; waiting before hitting `q'. > (message "") > - (help-quick))) > + (help-quick name-for-buffer sections keymap))) >=20=20 > -(defalias 'cheat-sheet #'help-quick) > +(defalias 'cheat-sheet #'help-quick-wrapper) >=20=20 > (defun help-quit () > "Just exit from the Help command's command loop." > --=20 > 2.30.2 > > > > JD Smith writes:=20 > >> Also recall we had a discussion in bug#68236 >> >> about expanding quick-help to include mode-local >> personalized binding shortcuts (with org as a particular target of inter= est). > > Thank you for the link I haven't seen that topic. >=20=20 > Regards, --=20 Philip Kaludercic on icterid