From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#68236: [PATCH] help.el: allow help-quick to use local commands/quick-sections Date: Wed, 10 Jan 2024 04:51:48 -0800 Message-ID: References: <1B0F351A-C393-4C1B-B883-814F2C33E802@gmail.com> <83a5ply2ca.fsf@gnu.org> <721ABC11-E691-43F9-9034-F375240C2E20@gmail.com> <83sf3dw699.fsf@gnu.org> <4CB34A88-87DE-4347-A886-4BF8D4998E67@gmail.com> <835y08w4v1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4623"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic , 68236@debbugs.gnu.org To: Eli Zaretskii , JD Smith Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 10 15:06:30 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rNZDy-0000ue-Jk for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Jan 2024 15:06:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNZDe-00071H-Qd; Wed, 10 Jan 2024 09:06:10 -0500 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 1rNZDZ-00070s-Ba for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 09:06:05 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNZDX-0004FT-6V for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 09:06:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rNZDV-0006NA-Mm for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 09:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jan 2024 14:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68236 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 68236-submit@debbugs.gnu.org id=B68236.170489551724383 (code B ref 68236); Wed, 10 Jan 2024 14:06:01 +0000 Original-Received: (at 68236) by debbugs.gnu.org; 10 Jan 2024 14:05:17 +0000 Original-Received: from localhost ([127.0.0.1]:39365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNZCn-0006LD-A7 for submit@debbugs.gnu.org; Wed, 10 Jan 2024 09:05:17 -0500 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:52442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNZCm-0006Kk-0K for 68236@debbugs.gnu.org; Wed, 10 Jan 2024 09:05:16 -0500 Original-Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40e4d515c9aso28264795e9.0 for <68236@debbugs.gnu.org>; Wed, 10 Jan 2024 06:05:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704895505; x=1705500305; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=N2/jHo6xiQCbmS9VPFjsIFRF2UbFVwUB/TyCa5nx1P4=; b=Bs3sB8eZdvWRPuqokHAzq7YoGwrHj2vO/y+eSqzUWKrg5c5Ft//6MuKBzn4VJAQ3V9 +j+Pl5ELVtYoqMt54pp5QD5sJ44UPlWMR2v/erVqB7HtI4SgvXN+feie0vLzETw6Xriy qEBlwcw9pY9Bh5GWdigefTyjbHm261obDRrqXcYx1b/3uDYOx/4iVGcfo1zGBJN6hF9L 525ySHDy6LKtUGqwNkdzXJ3vw5FwngH56remlXeyynmoI9Tm5I3uUqWsVqWmm6qrOnh5 60H8T2++B0OSnSWdB/KCik1D+UvlNVqb3MDOSB3tdozcgHes0mDY2bKEu4naG15lhUU2 BSPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704895505; x=1705500305; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=N2/jHo6xiQCbmS9VPFjsIFRF2UbFVwUB/TyCa5nx1P4=; b=sBbCk5rc0Qj5XlhrR5lzh2Tmxq8kvoNo2Z2eRjS21qjYvKIcYAKlpi1HRHam0nzu/d fgh9i6Fls4Rh5vZ6LTKcqlyJG5e4LRW7mYfezhjSMb74+izDD7Ykms3fvqhkcR1/SasU Dil8IdK5QeeL46ioGW1pJeoDnty0DZA+5vMWkk3VmqpT+BnpBnbfq4svYoHznwlhnNT2 Gvc0zkFCVBkX0wJJ9G+NhC2VyOiFjhnAuycwii7dc1BZ7qClvSHzQf62lVIFxN4Q7PnK K9AlqKCMHD3AmQX4vfoCgFdA9s1pLdvyx433FVZFtP5wkLzNHOa4hUAP0/bEF53uhc3v m2dQ== X-Gm-Message-State: AOJu0YwM4aPEs7taW20UY5KfI1IF2ofytyLWw64vlIqZeEl4wPPy0VSv Yy8F8qtTlq/N103ZWeyrWF4ewP2xf0fKeqqkxkn5F1A/q36AJg== X-Google-Smtp-Source: AGHT+IE/HB84lMWoIaoJrsMBhc0o26R/eZLuW5L4wo8L6CmX7I8lcgaIRQgOhV91VyE/FJDcq0w3IWdUInPa1GjBjRo= X-Received: by 2002:a50:8e09:0:b0:557:3c7a:4000 with SMTP id 9-20020a508e09000000b005573c7a4000mr406021edw.20.1704891108944; Wed, 10 Jan 2024 04:51:48 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 10 Jan 2024 04:51:48 -0800 In-Reply-To: <835y08w4v1.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277749 Archived-At: Eli Zaretskii writes: >> Right now the code does >> >> (with-current-buffer (get-buffer-create "*Quick Help*") >> >> right away, then checks `where-is-internal' for each listed command >> in `help-quick-sections'. So only global bindings (and bindings >> available in help-mode) are accessible for display. My patch simply >> delays switching to *Quick Help* buffer, so that binding information >> can be gathered from the local buffer from which quick help was >> summoned. Note that help-quick omits any bindings that are nil, as >> well as any empty sections. So adding sections to the defcustom that >> do not apply (=have no bindings) in some buffer is not a problem. > > Your proposal has the disadvantage that the user must switch to a > buffer under some major mode to see the entries for that mode in the > quick-help window. It could be an annoyance; e.g., consider a user > who wants to see this while in a *Help* buffer. And I don't think > being in the buffer under the major mode is the only way of getting > mode-specific bindings; for example, where-is-internal can accept a > KEYMAP argument, which will be used to find key bindings. Yes, this is a problem. I see the quick help as basically intended for global Emacs keys, so I think they should display the global ones always. Let's not break that. > Or maybe we should have a separate command for cheat sheets specific > to a major mode. The window we pop up cannot be too large, so if the > user only wants a quick help for the current mode, she might consider > global bindings an annoying waste of screen estate. Moreover, the > current quick help shows "popular commands", which are likely to be > already known to some users, whereas when the user works in a major > mode that is new to the user, one is likely to be in the need of the > cheat sheet for that one mode. (Yes, we do already have "C-h b", but > the output of that could be overwhelming: for example in an Org buffer > I get almost 1400 lines in the *Help* buffer showing the Org-specific > bindings.) > > IOW, if we want to consider mode-specific quick help, we should > perhaps discuss more about the goals before we consider code tricks to > implement it. I think a more specific cheat sheet for major modes would be more suitable, yes. Here's an idea that I've had: Typically, I only want to remember a few commands in each major mode. It would be useful to be able to mark them for highlighting or somesuch in the general describe-mode *Help* buffer (preferably using keys, and not using M-x customize, though they could persist by saving the result to the custom file). Then, the next time I display `describe-mode', they would be highlighted, in this or future sessions. How about something like that? We could also add a separate command to show only those commands somehow in a similar way to `help-quick-toggle'.