From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?S=C5=82awomir?= Grochowski Newsgroups: gmane.emacs.orgmode,gmane.emacs.devel Subject: Re: [DISCUSSION] "quick-help" popup for org-columns (column view) Date: Mon, 08 Apr 2024 09:38:40 +0200 Message-ID: <87frvwl2wv.fsf@gmail.com> References: <87a5oayblv.fsf@gmail.com> <87jzlxro68.fsf@localhost> <87zfu6b4w3.fsf@gmail.com> <86jzl91zrd.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="12085"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, emacs-orgmode@gnu.org, emacs-devel@gnu.org, philipk@posteo.net, stefankangas@gmail.com, larsi@gnus.org, hmelman@gmail.com, info@protesilaos.com To: Eli Zaretskii Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Mon Apr 08 09:39:44 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 1rtjbU-0002u8-Ay for geo-emacs-orgmode@m.gmane-mx.org; Mon, 08 Apr 2024 09:39:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtjah-0006nG-Q6; Mon, 08 Apr 2024 03:38:55 -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 1rtjag-0006ma-D6; Mon, 08 Apr 2024 03:38:54 -0400 Original-Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rtjab-0002Kh-4s; Mon, 08 Apr 2024 03:38:54 -0400 Original-Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-516d47ce662so4323172e87.1; Mon, 08 Apr 2024 00:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712561926; x=1713166726; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=GU/jF2Rn1+fnkOk1MihJQE888B3P58K0asA+2E5ABGk=; b=fAmuljl/bgYWYt4M2JTQ7A2niSOd7SbqBCOgdB2m6gdSS9tfUiRcrhfR2bpGUYgL9n M3z9GRGgGAUj6AQmF3BB6vzwgAtirFpOHMaOFr4V6yxBXrCtUcNVGwQxfPLgE3HzvD31 2RUL/PfDvmxR/RTG9lW0Eobcmc4+vT9N06bjB0Xt0OGdvOG+/0a8ulsU2sgfefe/lumQ IEOsG6eqIe9seHFaTz/MafG6CW3H+AOUSpQzxk4Y50KaAN9qzP3lvglTRZqev3NyaJbY ALjN4LGjWhCwu79m/AeqH4XPmv0GJxaBCp9lVItkTeovkR9+ofNnF2UM8PUpmKzW2l8T kjZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712561926; x=1713166726; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GU/jF2Rn1+fnkOk1MihJQE888B3P58K0asA+2E5ABGk=; b=rYHy42tF2ZhJVQxvl/4T0LPLkhISfoBMlk0S43hEEWwLvfJ90SEGLMEUcDHxPcQm28 j0kqGTH/CQnO7Jgl+VGxn7/KFBY+S0Mh3LJ6W8P7yN0yRLOWivK4WidngDjD+mw8HGQK sdJlmKFduvUY4ZcV/MwodMdIEdE0/u0N1q0YYH80Eh8Gz7goaZhZiIrtwSXWbP3vJM8e c+2vUq07yRhE/PfrPQpyM8UppY0B59PxMVKn0R3P3mWUcu1wzImHHTREJTGMdMAH4axN DQKKHXeRCKpqyZLQJNyTxDheN5q2hC0hDEEm45P8WrFnDnLlR2Ab27AoCE/vOjZqCAbf oXOw== X-Forwarded-Encrypted: i=1; AJvYcCVTbeffjMJV8+9iVQD7Qfr929v4MfuxcHxZtvWylZZN5cnvEmfq1Sx2MrVtM3+aFHmUIHGhkSQeLikMUqWEN/tEkGznNvWl14SmX0Vf/UpLvPNvNl4SbAqseaE= X-Gm-Message-State: AOJu0YwA18qqQzgipc202Em2iT5gpLbDVUQbph56Taxghi/VGbTYoMXB Ql94oLtNpgYFjQM3m7VTPK99lRydtTaZs+P0rQ1xG64Z/iJpBmyX X-Google-Smtp-Source: AGHT+IHYT8xo20swSIG+Ex2cds4Y/E966CYI2BJJLOLf06dmsLsq+mw3CWwaYMY7gP2eZEmX6GFDyg== X-Received: by 2002:a05:6512:3e17:b0:516:d250:91a7 with SMTP id i23-20020a0565123e1700b00516d25091a7mr9323378lfv.12.1712561925697; Mon, 08 Apr 2024 00:38:45 -0700 (PDT) Original-Received: from windows (83.6.111.246.ipv4.supernova.orange.pl. [83.6.111.246]) by smtp.gmail.com with ESMTPSA id jg29-20020a170907971d00b00a518bcb41c1sm4042323ejc.126.2024.04.08.00.38.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 00:38:45 -0700 (PDT) In-Reply-To: <86jzl91zrd.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=slawomir.grochowski@gmail.com; helo=mail-lf1-x12f.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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+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:160915 gmane.emacs.devel:317600 Archived-At: --=-=-= Content-Type: text/plain chad writes: > If you don't mind me asking: Thank you for sharing your views. > 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. > 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? Relying on global variables instead of passing variables as a parameters? 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 buffer "*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-REMAP) 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? I'm attaching the whole patch: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-lisp-org-colview.el-add-help-quick-sections-for-org-.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-colview --- 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)) +(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])) +(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. -- 2.30.2 --=-=-= Content-Type: text/plain Regards, -- Slawomir Grochowski --=-=-=--