From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.orgmode,gmane.emacs.devel Subject: Re: [DISCUSSION] "quick-help" popup for org-columns (column view) Date: Mon, 08 Apr 2024 08:24:20 +0000 Message-ID: <87plv02rez.fsf@posteo.net> References: <87a5oayblv.fsf@gmail.com> <87jzlxro68.fsf@localhost> <87zfu6b4w3.fsf@gmail.com> <86jzl91zrd.fsf@gnu.org> <87frvwl2wv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36238"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , yantar92@posteo.net, emacs-orgmode@gnu.org, emacs-devel@gnu.org, stefankangas@gmail.com, larsi@gnus.org, hmelman@gmail.com, info@protesilaos.com To: =?utf-8?Q?S=C5=82awomir?= Grochowski Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Mon Apr 08 10:25:47 2024 Return-path: Envelope-to: geo-emacs-orgmode@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 1rtkK2-00096u-1o for geo-emacs-orgmode@m.gmane-mx.org; Mon, 08 Apr 2024 10:25:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtkIp-00022Q-6Z; Mon, 08 Apr 2024 04:24:31 -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 1rtkIn-000220-Ur for emacs-orgmode@gnu.org; Mon, 08 Apr 2024 04:24:29 -0400 Original-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 1rtkIj-00016k-HF for emacs-orgmode@gnu.org; Mon, 08 Apr 2024 04:24:29 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id CD892240028 for ; Mon, 8 Apr 2024 10:24:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1712564662; bh=dtk+TOkNhLCEyQOKvvU3SRmoo1KhEWGkzKRVQIHHBIM=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:From; b=PYTQBJsiuKDHbd64l7UyaDsWHmHiCSmyTd2tmnhvMJTemnSa+1WmO/yD4jMETTFYr u/KbGgcpdkdiKcpwvI8PpGmCd4ji87tzioITBgJqGf1Y2kU2oqLOlHnrIM33mzRkb0 a7HCh29j+AB9lh9/JPZWlfmJu9AhGLFjQYzYUAFuzdWx62a2sIcVSZ07ApCoX64DwV zLheUcVgCn0IHNWC6dwnlXFTlsmZphl8OF6kJQFWFsWSMZudckyQYeYp22+VPuXb1b iURhqXjBA4xCB0gA/7tQHWJQq9Tsno9lZuZgWY38SZZoX8JYlxiTZhCAdYMSYn+jnX 1pkFB97jXGrLQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VChvn1cQ2z9rxg; Mon, 8 Apr 2024 10:24:21 +0200 (CEST) In-Reply-To: <87frvwl2wv.fsf@gmail.com> (=?utf-8?Q?=22S=C5=82awomir?= Grochowski"'s message of "Mon, 08 Apr 2024 09:38:40 +0200") OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt 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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Original-Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.orgmode:160916 gmane.emacs.devel:317601 Archived-At: S=C5=82awomir Grochowski writes: > chad writes: > >> If you don't mind me asking: > > Thank you for sharing your views.=20 > >> What are your high-level goals and immediate needs for changing >> help-quick? > > I want to reuse quick-help for functionality in org-mode - column view > package. See first email in this thread - there is even a screenshot. > >> It looks like you may be trying to have multiple >> simultaneous quick-help buffers active at once? > > Philip Kaludercic writes: > >> 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. > > Yes you are right. There is no need to create multiple quick-help > buffers.=20 > >> 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). > > Is this really a good practice? It certainly is practice. > Relying on global variables instead of passing variables as a parameters? A lot of Emacs Lisp code uses dynamic scope. Examples include `default-directory' or a lot of search functionality. > I tried like this: > > +(defun org-columns-help-quick-toggle () > + (interactive) > + (let ((help-quick-sections org-columns-help-quick-sections)) > + (help-quick-toggle))) > > So passing a 'sections' data works. > But it doesn't read keymaps from `org-columns-map'. > Because as I understand it read keymaps available only in the created buf= fer > "*Quick Help*" not from the buffer with org-colview. > > This is the line from function: `help-quick' where it happens: > + (let* ((bind (where-is-internal (car ent) nil t)) > Signature: > (where-is-internal DEFINITION &optional KEYMAP FIRSTONLY NOINDIRECT NO-RE= MAP) > > So previously I was passing a keymap `org-columns-map' to function 'where= -is-internal'. > > Eli Zaretskii writes: >> In any case, we cannot change the signature of help-quick, since it's a >> public function. > > If I can't modify the function `help-quick' how can I make it work? We could add a `help-quick-use-map' variable and bind it to `global-map' by default. You can then re-bind it in your command. > I'm attaching the whole patch: > > From dcc5172c87f9f7acfc9ab3a72f7de8b363a05447 Mon Sep 17 00:00:00 2001 > From: Slawomir Grochowski > Date: Sun, 7 Apr 2024 01:13:27 +0200 > Subject: [PATCH] lisp/org-colview.el: add help-quick sections for org-col= view > > --- > lisp/org-colview.el | 41 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 41 insertions(+) > > diff --git a/lisp/org-colview.el b/lisp/org-colview.el > index d71c84a76..547f50df8 100644 > --- a/lisp/org-colview.el > +++ b/lisp/org-colview.el > @@ -169,6 +169,7 @@ See `org-columns-summary-types' for details.") > (org-cycle-overview) > (org-cycle-content)) >=20=20 > +(org-defkey org-columns-map "?" #'org-columns-help-quick-toggle) > (org-defkey org-columns-map "c" #'org-columns-content) > (org-defkey org-columns-map "o" #'org-overview) > (org-defkey org-columns-map "e" #'org-columns-edit-value) > @@ -231,6 +232,46 @@ See `org-columns-summary-types' for details.") > "--" > ["Quit" org-columns-quit t])) >=20=20 > +(defvar org-columns-help-quick-sections > + '(("Move" > + (org-columns-move-up . "up") > + (org-columns-move-down . "down") > + (org-columns-move-cursor-left . "left") > + (org-columns-move-cursor-right . "right")) > + ("Move column & row" > + (org-columns-move-row-up . "move row up") > + (org-columns-move-row-down . "move row down") > + (org-columns-move-left . "move column left") > + (org-columns-move-right . "move column right")) > + ("Add & delete column" > + (org-columns-new . "add column") > + (org-columns-delete . "delete column")) > + ("Edit column" > + (org-columns-narrow . "narrow") > + (org-columns-widen . "widen") > + (org-columns-edit-attributes . "attributes")) > + ("Edit values" > + (org-columns-edit-value . "edit value") > + (org-columns-edit-allowed . "edit allowed value") > + (org-columns-next-allowed-value . "next allowed value") > + (org-columns-previous-allowed-value . "previous allowed value") > + (org-columns-toggle-or-columns-quit . "toggle checkbox or quit") > + (org-columns-todo . "change TODO state")) > + ("View" > + (org-columns-content . "show content") > + (org-overview . "show overview") > + (org-columns-show-value . "show value")) > + ("Misc." > + (org-columns-open-link . "open link") > + (org-columns-redo . "redo") > + (org-columns-help-quick-toggle . "toggle this help") > + (org-columns-quit . "quit")))) > + > +(defun org-columns-help-quick-toggle () > + (interactive) > + (let ((help-quick-sections org-columns-help-quick-sections)) > + (help-quick-toggle))) > + > (defun org-columns--displayed-value (spec value &optional no-star) > "Return displayed value for specification SPEC in current entry. >=20=20 > --=20 > 2.30.2 > > > Regards, --=20 Philip Kaludercic on peregrine