GNU bug report logs - #68236
[PATCH] help.el: allow help-quick to use local commands/quick-sections

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: JD Smith <jdtsmith@HIDDEN>; Keywords: patch; dated Thu, 4 Jan 2024 03:10:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 68236 <at> debbugs.gnu.org:


Received: (at 68236) by debbugs.gnu.org; 10 Jan 2024 22:49:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 17:49:42 2024
Received: from localhost ([127.0.0.1]:43513 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNhOI-0005YO-4e
	for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 17:49:42 -0500
Received: from mail-yw1-x1130.google.com ([2607:f8b0:4864:20::1130]:45446)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jdtsmith@HIDDEN>) id 1rNhOG-0005YA-Lm
 for 68236 <at> debbugs.gnu.org; Wed, 10 Jan 2024 17:49:41 -0500
Received: by mail-yw1-x1130.google.com with SMTP id
 00721157ae682-5e734d6cbe4so39368257b3.3
 for <68236 <at> debbugs.gnu.org>; Wed, 10 Jan 2024 14:49:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1704926976; x=1705531776; darn=debbugs.gnu.org;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=MbhR2rucY4KO0BJ+gckbbP+kCrPCYBa/ikZAs85//tY=;
 b=R39aul7JuXsH3WH55UVxcVax8Spn2tbpcWt41peoOvSho3M8LfFGtrNnp8Ltjp2duR
 w0vObKFXWnfs8DoBFAgMRFcAX0ZpJEMIZbyFA8acYumEvtc8PE8myWlkrEcONEzlrYA6
 Nlcy9wZjlbsSKhHfPA13I0iEz2NODPnyCfK0I416txDZDcDcQDCcm3cflNP1drPYosRS
 Yk1Qt/P0FzJdOJcunw46lproNfYbOaNm9hzj1NL3hG7BmznhA6eFWg1KbqtQjtXRPK5G
 UzinUzaZc+3x33XRqgANiMGykRcLNfXx3i2V5Ztcv0I6U6QqHqQnnubky4eFCR67dPxE
 vDEA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1704926976; x=1705531776;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=MbhR2rucY4KO0BJ+gckbbP+kCrPCYBa/ikZAs85//tY=;
 b=RSmznP/eV2jCJcyj5yVHK57PrKMRmInjXmut9cmAUrnY9lENWOyQcquxtVq7ESBvUx
 7hzGR1ZHNU5V81IMI6aNlo/RY+hBBA8s9x+iFIPxfi8Ic5kAPjl3ANVm+5DGs74gNbNt
 Ev8cd12llyRUmU/YO3bQJZx7epXTfVpTxJ1ZpjUwSVqCETHueF7SzCg1WDGCprTwgojI
 2ntsKfFXCI2BHTOFH8AxrNVLqKINrB+Y+u2j4Mly7Iv3ZVCn1UvR3IgmZCdhKIfTvyly
 2DX+Mkee0+3OeAT82SaGFn08/tXd2dEsMgoiIaBJ8CFgOqUo85EaPzCktwrti4cRE+Sj
 NjDg==
X-Gm-Message-State: AOJu0YwKly4gxRdcRRF+WMFvDxWg3dE0Gqeuqn7MFkITrt1cDQnGvqSY
 y3rqdDI3Zsu01TQIUxXU3EM=
X-Google-Smtp-Source: AGHT+IH+hBEBHUfSUMG2WxFAKb1/Cw6gnPH4v9yye/ZBLid+GjpM4OI5JAjxlKw+uunHQgB9woORTg==
X-Received: by 2002:a05:690c:24a:b0:5f1:2c90:405a with SMTP id
 ba10-20020a05690c024a00b005f12c90405amr325957ywb.53.1704926976115; 
 Wed, 10 Jan 2024 14:49:36 -0800 (PST)
Received: from smtpclient.apple ([131.183.131.33])
 by smtp.gmail.com with ESMTPSA id
 q67-20020a0de746000000b005869ca8da8esm1926750ywe.146.2024.01.10.14.49.35
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 10 Jan 2024 14:49:35 -0800 (PST)
From: JD Smith <jdtsmith@HIDDEN>
Message-Id: <4731097C-D870-439C-B012-98ADA2AEB330@HIDDEN>
Content-Type: multipart/alternative;
 boundary="Apple-Mail=_A633408E-8741-4CFC-987B-DD7B446D5F07"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\))
Subject: Re: bug#68236: [PATCH] help.el: allow help-quick to use local
 commands/quick-sections
Date: Wed, 10 Jan 2024 17:49:24 -0500
In-Reply-To: <83sf35mb8g.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
References: <CADwFkm=D0FdxoiUi3Q5VfT2rz8uD-TrvXDf_7y5cKG9UYOc54w@HIDDEN>
 <FFDE0EB0-66B8-48EA-97AE-02E512CEAACE@HIDDEN> <83sf35mb8g.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3774.300.61.1.2)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68236
Cc: Philip Kaludercic <philipk@HIDDEN>, 68236 <at> debbugs.gnu.org,
 Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--Apple-Mail=_A633408E-8741-4CFC-987B-DD7B446D5F07
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

With my original fix of just allowing buffer-local binding to appear in =
help-quick, I fully intended to disable most of the global bindings (I =
don=E2=80=99t need a reminder of C-x C-f) and expected it to be =
therefore  a smaller and easier to parse mode-specific list. =20

Since the user has to take the initiative to modify =
`help-quick-sections=E2=80=99 in my simple approach, I do not see =
=E2=80=9Closs of global bindings=E2=80=9D as a concern; that=E2=80=99s a =
feature, not a bug, from my perspective.


> On Jan 10, 2024, at 10:58=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>=20
>> From: JD Smith <jdtsmith@HIDDEN>
>> Date: Wed, 10 Jan 2024 10:46:22 -0500
>> Cc: Eli Zaretskii <eliz@HIDDEN>, 68236 <at> debbugs.gnu.org,
>> Philip Kaludercic <philipk@HIDDEN>
>>=20
>> But what about instead of a separate command to remember, just =
creating an (optional) section in the existing help-quick popup, for =
local commands?  where-is-internal would consult the global keymap for =
the global commands, and the current buffer=E2=80=99s keymap for the =
locals.
>=20
> I think we should be careful not to add too much to what these
> commands display, since otherwise we'd reinvent "C-h b" again.
>=20
> The whole purpose of help-quick is to present a small list of the most
> useful commands and their bindings, and do it in a small window.  As
> soon as the buffer is long enough to require scrolling, I think we
> will have lost.


--Apple-Mail=_A633408E-8741-4CFC-987B-DD7B446D5F07
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;">With my =
original fix of just allowing buffer-local binding to appear in =
help-quick, I fully intended to disable most of the global bindings (I =
don=E2=80=99t need a reminder of C-x C-f) and expected it to be =
therefore &nbsp;a smaller and easier to parse mode-specific list. =
&nbsp;<div><br></div><div>Since the user has to take the initiative to =
modify `<font color=3D"#000000">help-quick-sections=E2=80=99 in my =
simple approach, I do not see =E2=80=9Closs of global bindings=E2=80=9D =
as a concern; that=E2=80=99s a feature, not a bug, from my =
perspective.</font><div><br></div><div><br><div><blockquote =
type=3D"cite"><div>On Jan 10, 2024, at 10:58=E2=80=AFAM, Eli Zaretskii =
&lt;eliz@HIDDEN&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div><div><blockquote =
type=3D"cite">From: JD Smith &lt;jdtsmith@HIDDEN&gt;<br>Date: Wed, 10 =
Jan 2024 10:46:22 -0500<br>Cc: Eli Zaretskii &lt;eliz@HIDDEN&gt;, =
68236 <at> debbugs.gnu.org,<br> Philip Kaludercic =
&lt;philipk@HIDDEN&gt;<br><br>But what about instead of a separate =
command to remember, just creating an (optional) section in the existing =
help-quick popup, for local commands? &nbsp;where-is-internal would =
consult the global keymap for the global commands, and the current =
buffer=E2=80=99s keymap for the locals. <br></blockquote><br>I think we =
should be careful not to add too much to what these<br>commands display, =
since otherwise we'd reinvent "C-h b" again.<br><br>The whole purpose of =
help-quick is to present a small list of the most<br>useful commands and =
their bindings, and do it in a small window. &nbsp;As<br>soon as the =
buffer is long enough to require scrolling, I think we<br>will have =
lost.<br></div></div></blockquote></div><br></div></div></body></html>=

--Apple-Mail=_A633408E-8741-4CFC-987B-DD7B446D5F07--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 68236 <at> debbugs.gnu.org:


Received: (at 68236) by debbugs.gnu.org; 10 Jan 2024 15:58:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 10:58:51 2024
Received: from localhost ([127.0.0.1]:42546 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNayh-0003fS-Jy
	for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 10:58:51 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:60074)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rNayf-0003fB-4b
 for 68236 <at> debbugs.gnu.org; Wed, 10 Jan 2024 10:58:49 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rNayb-0008QD-13; Wed, 10 Jan 2024 10:58:45 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=UJ/S7VP1ThWtwCkqPEJjfayeiSw7RIWtUGVdLJyYy5M=; b=IfhNOyEzygRxo4wLwKER
 cLURzdetNsXKVkhLr8u1b8SIE00CGZP1kfbmprC5G6F4Aph/CSad23Eebd4Pf0KsdCgGDjH5uOjGB
 Ah2TlVEuHz+ehgueROEyo5kNJrs3bWm228HetbpBxl1S9TmC6JPX+GqAKFe1uVS74zm9c65Jv/15/
 8oEd3GWJE9UeiIlnmCphFM78+dtjjYYOW4KrthKHfy/AB/dYeieZFvsTnfi2kUKBelEGrGyAqtTTp
 +lrsUkaxZX6BwGsIZ1dvrMcj+gieiYUqiOPQlaAGj9cv5eaUOhbsOrI7xr0hR4+ZEeiB54jb1jxCr
 v7mtgWn4ElFnTA==;
Date: Wed, 10 Jan 2024 17:58:23 +0200
Message-Id: <83sf35mb8g.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: JD Smith <jdtsmith@HIDDEN>
In-Reply-To: <FFDE0EB0-66B8-48EA-97AE-02E512CEAACE@HIDDEN> (message from JD
 Smith on Wed, 10 Jan 2024 10:46:22 -0500)
Subject: Re: bug#68236: [PATCH] help.el: allow help-quick to use local
 commands/quick-sections
References: <CADwFkm=D0FdxoiUi3Q5VfT2rz8uD-TrvXDf_7y5cKG9UYOc54w@HIDDEN>
 <FFDE0EB0-66B8-48EA-97AE-02E512CEAACE@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68236
Cc: philipk@HIDDEN, 68236 <at> debbugs.gnu.org, stefankangas@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: JD Smith <jdtsmith@HIDDEN>
> Date: Wed, 10 Jan 2024 10:46:22 -0500
> Cc: Eli Zaretskii <eliz@HIDDEN>, 68236 <at> debbugs.gnu.org,
>  Philip Kaludercic <philipk@HIDDEN>
> 
> But what about instead of a separate command to remember, just creating an (optional) section in the existing help-quick popup, for local commands?  where-is-internal would consult the global keymap for the global commands, and the current buffer’s keymap for the locals. 

I think we should be careful not to add too much to what these
commands display, since otherwise we'd reinvent "C-h b" again.

The whole purpose of help-quick is to present a small list of the most
useful commands and their bindings, and do it in a small window.  As
soon as the buffer is long enough to require scrolling, I think we
will have lost.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.

Message received at 68236 <at> debbugs.gnu.org:


Received: (at 68236) by debbugs.gnu.org; 10 Jan 2024 15:50:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 10:50:53 2024
Received: from localhost ([127.0.0.1]:42537 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNaqz-0003Ta-51
	for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 10:50:53 -0500
Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]:45387)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1rNaqx-0003TO-Ui
 for 68236 <at> debbugs.gnu.org; Wed, 10 Jan 2024 10:50:52 -0500
Received: by mail-lj1-x22d.google.com with SMTP id
 38308e7fff4ca-2cca8eb0509so49322581fa.3
 for <68236 <at> debbugs.gnu.org>; Wed, 10 Jan 2024 07:50:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1704901847; x=1705506647; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=x3MW5Wby/mK6aYzlYkP/Koqg+ScaluW6OkRyKy+b21M=;
 b=P9Pp1cpaDBTyEbnKhN/DOY7N6qpi1L2Wj7UmYdJnTm3mLsV7r/0M1lQcCXtCOQoMEe
 UbUXfFJrtNS6j2s3mJA2d282QDprLHJrY8HAZsTdRq4+NhgS12vda4evJxMEDzg4Mw0c
 fL63JPDBi0E6VLGfvYOH8Ii2seN89oBxt42fy1llJCzTb8TmwsL+5i8DL58dh1M+3WAr
 r6lf+5SQU5Ks6VMDA0oi4v/8zVqm86jUsF8GfdSZOwzSYQtZm+WQv0BvqennayF/0qN5
 gyzpQZXTZgwdFkqQlOgz8SgnZNTY6Io/bgeEkF0Q/+6aKgbsx73UAiT3+5YUHy0gTysG
 Xasw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1704901847; x=1705506647;
 h=content-transfer-encoding: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=x3MW5Wby/mK6aYzlYkP/Koqg+ScaluW6OkRyKy+b21M=;
 b=gTY9RjK+66Irub+1+XQpE03kYGTzKrY1SnqazA2LRn9yu7fdj3V55qTbR1ODfwIwgf
 7iM/iUdtSi96dMfjL8RLltD7K7wBEr6EhZuixjYuGzz2GYFH441pXD2/r4eI7iZN6qCz
 ZXJvk89zJHK4JBoM+yHNcfiMFzX+HE5t0UieseYUFeKVzLes8rW1EOjKK0psl2ZSRFqI
 gsP+h0pI74d9rgdW2pjcPEzqrTFBQ/UTzkq0gP1sbFjygLoYuxUkhUXMa1JUaZ4qzoS1
 /HIu3dJnYBm2HhtfU/WdloHPa5nVj2YpZJh8HyHZOA6hVQLV3G5wMmvEyNhtZcw+Hv+G
 i7HQ==
X-Gm-Message-State: AOJu0Yy/9W4wcv91H/1Wfxx9O0H4ValX5rfFdP8cL27IFGWjGPsBbhRP
 C/WAQDTxPdQX5pFYRErVEvWs1f3bLrk8yesow0g=
X-Google-Smtp-Source: AGHT+IFBg7zmVbI0V1NrAKA1Vb9AmdV/lh6+iS98sjOtQpv5rn5qUc+g3ngraejtp0dGo+YpGxvTnPPS5znTqQh0res=
X-Received: by 2002:a2e:9c96:0:b0:2cc:6e47:6215 with SMTP id
 x22-20020a2e9c96000000b002cc6e476215mr649549lji.57.1704901846997; Wed, 10 Jan
 2024 07:50:46 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Wed, 10 Jan 2024 07:50:46 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <FFDE0EB0-66B8-48EA-97AE-02E512CEAACE@HIDDEN>
References: <CADwFkm=D0FdxoiUi3Q5VfT2rz8uD-TrvXDf_7y5cKG9UYOc54w@HIDDEN>
 <FFDE0EB0-66B8-48EA-97AE-02E512CEAACE@HIDDEN>
MIME-Version: 1.0
Date: Wed, 10 Jan 2024 07:50:46 -0800
Message-ID: <CADwFkmmRpYh4p-EM-afYic3N0ga1nk2=Vi3v-+mMr1PEpBUBAA@HIDDEN>
Subject: Re: bug#68236: [PATCH] help.el: allow help-quick to use local
 commands/quick-sections
To: JD Smith <jdtsmith@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68236
Cc: Eli Zaretskii <eliz@HIDDEN>, 68236 <at> debbugs.gnu.org,
 Philip Kaludercic <philipk@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

JD Smith <jdtsmith@HIDDEN> writes:

>> On Jan 10, 2024, at 7:51=E2=80=AFAM, Stefan Kangas <stefankangas@HIDDEN=
om> wrote:
>>
>> We could also add a separate command to show only those commands
>> somehow in a similar way to `help-quick-toggle'.
>
> One advantage of this approach is you can craft your *own* short
> command description, if the docstring or command name is not clear to
> you (things like org-ctrl-return being prime examples).  But what
> about instead of a separate command to remember, just creating an
> (optional) section in the existing help-quick popup, for local
> commands?  where-is-internal would consult the global keymap for the
> global commands, and the current buffer=E2=80=99s keymap for the locals.

That might make sense, yes.  In that case, perhaps we could also add an
option to disable the global keybindings, for advanced users, so that
only the mode specific ones were displayed.

But I would separate this into two changes:
- A "cheatsheet" module
- Support for the cheatsheet module in help-quick-toggle

Because I can then imagine other ways of displaying and using the
cheatsheets (such as the way I proposed).  IOW, I would avoid tightly
coupling the cheatsheet functionality to help-quick-toggle.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.

Message received at 68236 <at> debbugs.gnu.org:


Received: (at 68236) by debbugs.gnu.org; 10 Jan 2024 15:46:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 10:46:41 2024
Received: from localhost ([127.0.0.1]:42533 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNamv-0003HU-Hd
	for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 10:46:41 -0500
Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]:43101)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jdtsmith@HIDDEN>) id 1rNamu-0003Ef-1l
 for 68236 <at> debbugs.gnu.org; Wed, 10 Jan 2024 10:46:40 -0500
Received: by mail-il1-x132.google.com with SMTP id
 e9e14a558f8ab-3606f8417beso15170865ab.0
 for <68236 <at> debbugs.gnu.org>; Wed, 10 Jan 2024 07:46:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1704901595; x=1705506395; darn=debbugs.gnu.org;
 h=to:in-reply-to:cc:references:message-id:date:subject:mime-version
 :from:content-transfer-encoding:from:to:cc:subject:date:message-id
 :reply-to; bh=kzV0fHbjsuMdRMvHaKhj+OPxaKIJN1xg3YcLsCcypK4=;
 b=JOcMKQKD+NfuF3DoNNp7aKUB+36fLdN4wVRYGmRoeHck/I6zlBBsss5E1pCU9mAOXB
 kXr01C4HAQCMAzKPsh3PB58ipz+W3nfbAHI+6qvvoNvCXyascIzaYYdykRsxP0Y9QDe/
 KA/QQJ4NcxE8vzsrwDCmmETJC4+gETK0NsmK1oa7a8r24Owp8SovEH350v8GGLEQqWnT
 zJBmqsiLF8GfDcIYWisnP7sJUlCAE1LEg2fCrZsAR2Kwp6+cQDv9NGMB8Z4cK5HYSNMm
 FMhq4qQnkWkqlHX+t1rnFwovjYckiLC4RzcSYxxYds2TY+tfKkGakctNYRnnxyBN9+5J
 3wMQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1704901595; x=1705506395;
 h=to:in-reply-to:cc:references:message-id:date:subject:mime-version
 :from:content-transfer-encoding:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=kzV0fHbjsuMdRMvHaKhj+OPxaKIJN1xg3YcLsCcypK4=;
 b=hVvHfXgB8fCJQ3yNxExj9y/Awq7O6xSgaAoFx8FGKvVOCzIJRD7Cdc2crk0yiB9BdV
 PyPHt2LB7JGuS7za2wCTbLm7wDPMWMSG1SrgCp6RsSy6tKdDVbT2+PHQ5erUa93BhVY9
 cYAiBtbW7FEX8i7Zjqgko2qfVzim+BKm6aX2qweFRoogS7xfpLsQw9zeeywXDLC8Z54J
 rKM9ExR/qcjAKkMzQ3V4vVMS2dxDgFVcVMsnlbwW3wuWrWltNtVdoTS4EEog5JlHKQ9p
 aO2yniNFJQuxDFGjYpBRP/yvaLbAIQxZWmQozEr8UTPto0B9MwwnPRypSwsOP+L2cogz
 z8Rw==
X-Gm-Message-State: AOJu0YyA/pdo2aLV+PBJSSyXg8nHRJw8lrmwRXiqCQE7UMeIhYAXPEa+
 tT3Q/on5V1HqRemHNq24YEe7841s502YvA==
X-Google-Smtp-Source: AGHT+IE9eXqYp+Wkx3dmz8I4wk+vy5BC0sNLZj6S9hchH1tl8TeC5jcsUzRwIU51h0t+9kNPM/oZ8w==
X-Received: by 2002:a05:6e02:1745:b0:35f:b387:40ab with SMTP id
 y5-20020a056e02174500b0035fb38740abmr206086ill.1.1704901594721; 
 Wed, 10 Jan 2024 07:46:34 -0800 (PST)
Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net.
 [24.53.187.34]) by smtp.gmail.com with ESMTPSA id
 bs20-20020a056638451400b0046e2ce45dafsm1361453jab.165.2024.01.10.07.46.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 10 Jan 2024 07:46:33 -0800 (PST)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
From: JD Smith <jdtsmith@HIDDEN>
Mime-Version: 1.0 (1.0)
Subject: Re: bug#68236: [PATCH] help.el: allow help-quick to use local
 commands/quick-sections
Date: Wed, 10 Jan 2024 10:46:22 -0500
Message-Id: <FFDE0EB0-66B8-48EA-97AE-02E512CEAACE@HIDDEN>
References: <CADwFkm=D0FdxoiUi3Q5VfT2rz8uD-TrvXDf_7y5cKG9UYOc54w@HIDDEN>
In-Reply-To: <CADwFkm=D0FdxoiUi3Q5VfT2rz8uD-TrvXDf_7y5cKG9UYOc54w@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
X-Mailer: iPhone Mail (21C66)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68236
Cc: Eli Zaretskii <eliz@HIDDEN>, 68236 <at> debbugs.gnu.org,
 Philip Kaludercic <philipk@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)




> On Jan 10, 2024, at 7:51=E2=80=AFAM, Stefan Kangas <stefankangas@HIDDEN=
> wrote:
>=20
> We could also add a separate command to show only those commands somehow
> in a similar way to `help-quick-toggle'.

One advantage of this approach is you can craft your *own* short command des=
cription, if the docstring or command name is not clear to you (things like o=
rg-ctrl-return being prime examples).  But what about instead of a separate c=
ommand to remember, just creating an (optional) section in the existing help=
-quick popup, for local commands?  where-is-internal would consult the globa=
l keymap for the global commands, and the current buffer=E2=80=99s keymap fo=
r the locals.=20=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.

Message received at 68236 <at> debbugs.gnu.org:


Received: (at 68236) by debbugs.gnu.org; 10 Jan 2024 14:05:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 09:05:17 2024
Received: from localhost ([127.0.0.1]:39365 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNZCn-0006LD-A7
	for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 09:05:17 -0500
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 <stefankangas@HIDDEN>) id 1rNZCm-0006Kk-0K
 for 68236 <at> debbugs.gnu.org; Wed, 10 Jan 2024 09:05:16 -0500
Received: by mail-wm1-x334.google.com with SMTP id
 5b1f17b1804b1-40e4d515c9aso28264795e9.0
 for <68236 <at> 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)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Wed, 10 Jan 2024 04:51:48 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <835y08w4v1.fsf@HIDDEN>
References: <1B0F351A-C393-4C1B-B883-814F2C33E802@HIDDEN>
 <83a5ply2ca.fsf@HIDDEN> <721ABC11-E691-43F9-9034-F375240C2E20@HIDDEN>
 <83sf3dw699.fsf@HIDDEN> <4CB34A88-87DE-4347-A886-4BF8D4998E67@HIDDEN>
 <835y08w4v1.fsf@HIDDEN>
MIME-Version: 1.0
Date: Wed, 10 Jan 2024 04:51:48 -0800
Message-ID: <CADwFkm=D0FdxoiUi3Q5VfT2rz8uD-TrvXDf_7y5cKG9UYOc54w@HIDDEN>
Subject: Re: bug#68236: [PATCH] help.el: allow help-quick to use local
 commands/quick-sections
To: Eli Zaretskii <eliz@HIDDEN>, JD Smith <jdtsmith@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68236
Cc: Philip Kaludercic <philipk@HIDDEN>, 68236 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> 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'.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.

Message received at 68236 <at> debbugs.gnu.org:


Received: (at 68236) by debbugs.gnu.org; 10 Jan 2024 13:53:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 08:53:56 2024
Received: from localhost ([127.0.0.1]:39292 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNZ1n-0003IT-IY
	for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 08:53:55 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:40344)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rNZ1l-0003I6-FK
 for 68236 <at> debbugs.gnu.org; Wed, 10 Jan 2024 08:53:53 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rNZ1e-0006w1-1k; Wed, 10 Jan 2024 08:53:47 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=3wV+/pz5ZtqajousGu5GCR3my2JXjpdgN5D6sh+Qkxg=; b=gAZLaRewfm7C
 ghixhuPYSnvm6XBc+TG41JJFIsZ+s1t1hcM49j+uaePZ9HvRYdKKI1Ea8mvfk8ZHbfO9MOBlEw4Zs
 nqTIOCr98CrFUAYMj0aPlTYiFo5rN5/OuZnVbF9YWh1/pL8W0PJgaUOwDvnTgQ7+K1TFJVF9c44Qv
 OmplXofQ/2nbM/50UBosivOaOOAAsWE8ohSgIWKWpdpQfXwFnGFkilhH4GyRPBDPDq1O6gpHOswM3
 vjTxXhqXeC16LLa5jjS9PpgH9PpcQIKPuBKut9hm+ArO5dVlqZ/f7/zq+VcyE3wt3Vfu94/ac7aQ6
 bh8QcNW/5d5ZQRF2Ah9d7g==;
Date: Wed, 10 Jan 2024 15:53:26 +0200
Message-Id: <83zfxdmh0p.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <CADwFkm=D0FdxoiUi3Q5VfT2rz8uD-TrvXDf_7y5cKG9UYOc54w@HIDDEN>
 (message from Stefan Kangas on Wed, 10 Jan 2024 04:51:48 -0800)
Subject: Re: bug#68236: [PATCH] help.el: allow help-quick to use local
 commands/quick-sections
References: <1B0F351A-C393-4C1B-B883-814F2C33E802@HIDDEN>
 <83a5ply2ca.fsf@HIDDEN> <721ABC11-E691-43F9-9034-F375240C2E20@HIDDEN>
 <83sf3dw699.fsf@HIDDEN> <4CB34A88-87DE-4347-A886-4BF8D4998E67@HIDDEN>
 <835y08w4v1.fsf@HIDDEN>
 <CADwFkm=D0FdxoiUi3Q5VfT2rz8uD-TrvXDf_7y5cKG9UYOc54w@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68236
Cc: philipk@HIDDEN, 68236 <at> debbugs.gnu.org, jdtsmith@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Stefan Kangas <stefankangas@HIDDEN>
> Date: Wed, 10 Jan 2024 04:51:48 -0800
> Cc: 68236 <at> debbugs.gnu.org, Philip Kaludercic <philipk@HIDDEN>
> 
> 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'.

Something along these lines, yes.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.

Message received at 68236 <at> debbugs.gnu.org:


Received: (at 68236) by debbugs.gnu.org; 5 Jan 2024 17:01:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 05 12:01:00 2024
Received: from localhost ([127.0.0.1]:57755 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rLnZ5-0000e2-ED
	for submit <at> debbugs.gnu.org; Fri, 05 Jan 2024 12:01:00 -0500
Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]:42257)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jdtsmith@HIDDEN>) id 1rLnZ1-0000Ov-Cs
 for 68236 <at> debbugs.gnu.org; Fri, 05 Jan 2024 12:00:58 -0500
Received: by mail-qk1-x72c.google.com with SMTP id
 af79cd13be357-78104f6f692so57426985a.1
 for <68236 <at> debbugs.gnu.org>; Fri, 05 Jan 2024 09:00:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1704474045; x=1705078845; darn=debbugs.gnu.org;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=//3rDSWoXosCOamgu6gWPDrQXqSZO5Rv/4XKBn50nSI=;
 b=LBRJ5WsfJzeW21WMdAjXPYaBAIAaxS+c2wbw8imSGGTnOAzdRHP4IDHRLnz5r3Te5a
 2Nlci7FJBTpMC+y8Q7aKRmpCtBJRdlt7C+D7FExVPd5NMVTbBLyrri31Fw2PjuGXiUid
 jy7UjLtyGNsuGtIdPnNKPw0KeBbmUjz0v+0Yx1iGmuT9XgDwXK+zUGGO1tjbgHyxkdDm
 MVm6PZXdw1vY+B9UytUw/1N2oB+GX50NcL/iKk/Odq2EqCjmM2ynXDnJqJbIAQhu4Kok
 2sLxhvGY5c2apldpdnGuDfHKoXntfOwsh4H7+XZccABeOt8qhxv0aMGQttT3AR3LAufv
 9riw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1704474045; x=1705078845;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=//3rDSWoXosCOamgu6gWPDrQXqSZO5Rv/4XKBn50nSI=;
 b=gV8a88WssXcduPW8bMyjgdO3CPUGcgguV3a3cVxKnd6H/wZ2ZZdw9Fkm92vFF024Jc
 4Bbgtk3hoSIa7Nv0gsddN3ew/ziqoDZKP64vzUqTUlBSalPEr9Jm9rKqu7BD/GIaMw6W
 G2nVjY+l9SyciBzro0PIpR05/KxwsRNQCqhAka6/4bqsuN9UGphfup9Fo1M6+d+MKdzi
 kgTgneguXg7P79Lf4DYGrQtPqRt6pQnNK6lUnQeX6Gt739RVUwG6C8czjP/iFAAtASxf
 aBkLslExUPCh1eeS4BMGq+C+EQUgbEOIGnBWCjrNxdXxMAMBTy2mSPhUREq9wYIf3dNr
 bypQ==
X-Gm-Message-State: AOJu0Yxa/7shtA1YVOAhIHkF9F5GrsxjMpLpeN5oPu7Jcy7eMvMGrWaf
 47OWGWif9RWsaIA6pc20SW0=
X-Google-Smtp-Source: AGHT+IFB4f/06NVNyECAmw89cay+tDjBlL6vhgjH6aR0/y0WgREwmPwROKSz8RYY8fSYDdkH/zqtvQ==
X-Received: by 2002:a05:620a:468f:b0:783:bf8:7f82 with SMTP id
 bq15-20020a05620a468f00b007830bf87f82mr1284037qkb.70.1704474044811; 
 Fri, 05 Jan 2024 09:00:44 -0800 (PST)
Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net.
 [24.53.187.34]) by smtp.gmail.com with ESMTPSA id
 c27-20020a05620a11bb00b007816cf21f7asm711852qkk.76.2024.01.05.09.00.43
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 05 Jan 2024 09:00:43 -0800 (PST)
From: JD Smith <jdtsmith@HIDDEN>
Message-Id: <F4B94E6F-8841-4AE6-B123-02B89EE22DAE@HIDDEN>
Content-Type: multipart/alternative;
 boundary="Apple-Mail=_E7F07FC7-5300-4430-9253-F145EF9BB797"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\))
Subject: Re: bug#68236: [PATCH] help.el: allow help-quick to use local
 commands/quick-sections
Date: Fri, 5 Jan 2024 12:00:32 -0500
In-Reply-To: <835y08w4v1.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
References: <1B0F351A-C393-4C1B-B883-814F2C33E802@HIDDEN>
 <83a5ply2ca.fsf@HIDDEN> <721ABC11-E691-43F9-9034-F375240C2E20@HIDDEN>
 <83sf3dw699.fsf@HIDDEN> <4CB34A88-87DE-4347-A886-4BF8D4998E67@HIDDEN>
 <835y08w4v1.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3774.300.61.1.2)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68236
Cc: 68236 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--Apple-Mail=_E7F07FC7-5300-4430-9253-F145EF9BB797
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On Jan 5, 2024, at 3:40=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>=20
>> From: JD Smith <jdtsmith@HIDDEN>
>> Date: Thu, 4 Jan 2024 20:28:27 -0500
>> Cc: 68236 <at> debbugs.gnu.org
>>=20
>>> On Jan 4, 2024, at 8:57=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>>>=20
>>> If we are going to expose help-quick-sections as a defcustom, then I
>>> don't understand why we need to change the code at all.  Is the idea
>>> that sections will depend on the current buffer?  If so, then we =
just
>>> need to add an element to the list members which will store the
>>> major-mode for which the member is relevant.
>>>=20
>>> Or what am I missing?
>>=20
>> Right now the code does
>>=20
>>  (with-current-buffer (get-buffer-create "*Quick Help*")
>>=20
>> 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 =
(=3Dhave no bindings) in some buffer is not a problem. =20
>=20
> 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.

The current disadvantage is related, but much worse than this: you =
currently cannot configure quick help to show any bindings other than =
global and help-mode bindings.  It might be nice to see e.g. =
org-bindings from anywhere, but to me it=E2=80=99s an advantage to show =
=E2=80=9Cquick help for this mode=E2=80=9D.

> 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. =20

I=E2=80=99d probably disable most of the global bindings, since I =
already know those.  But some are useful (e.g. I often forget the =
project bindings). =20

> 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.)

Agree, this is a real problem for discoverability.  Also command names =
are not always informative enough to find what you are actually looking =
for (org is terrible for this).

> 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 do like this idea.  Perhaps mode authors could add a =E2=80=9Cstarter =
pack=E2=80=9D of this information themselves, if they are suitably =
admonished to keep this information brief, high level, and with clear =
few-word command descriptions.  Perhaps adding a =E2=80=98help-quick =
property to the mode command symbol? =20

One guiding principle I suggest: users in the end should be able to =
decide what quick help they need; what=E2=80=99s memorable for some may =
be frequently forgotten for others.=20


--Apple-Mail=_E7F07FC7-5300-4430-9253-F145EF9BB797
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;"><br =
id=3D"lineBreakAtBeginningOfMessage"><div><br><blockquote =
type=3D"cite"><div>On Jan 5, 2024, at 3:40=E2=80=AFAM, Eli Zaretskii =
&lt;eliz@HIDDEN&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div><meta =
charset=3D"UTF-8"><blockquote type=3D"cite" style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;">From: JD Smith =
&lt;jdtsmith@HIDDEN&gt;<br>Date: Thu, 4 Jan 2024 20:28:27 =
-0500<br>Cc: 68236 <at> debbugs.gnu.org<br><br><blockquote type=3D"cite">On =
Jan 4, 2024, at 8:57=E2=80=AFAM, Eli Zaretskii &lt;eliz@HIDDEN&gt; =
wrote:<br><br>If we are going to expose help-quick-sections as a =
defcustom, then I<br>don't understand why we need to change the code at =
all. &nbsp;Is the idea<br>that sections will depend on the current =
buffer? &nbsp;If so, then we just<br>need to add an element to the list =
members which will store the<br>major-mode for which the member is =
relevant.<br><br>Or what am I missing?<br></blockquote><br>Right now the =
code does<br><br>&nbsp;(with-current-buffer (get-buffer-create "*Quick =
Help*")<br><br>right away, then checks `where-is-internal' for each =
listed command in `help-quick-sections'. &nbsp;So only global bindings =
(and bindings available in help-mode) are accessible for display. =
&nbsp;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. &nbsp;Note that help-quick omits any bindings =
that are nil, as well as any empty sections. &nbsp;So adding sections to =
the defcustom that do not apply (=3Dhave no bindings) in some buffer is =
not a problem. &nbsp;<br></blockquote><br style=3D"caret-color: rgb(0, =
0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">Your =
proposal has the disadvantage that the user must switch to a</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">buffer under some major mode to see the =
entries for that mode in the</span><br style=3D"caret-color: rgb(0, 0, =
0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline =
!important;">quick-help window. &nbsp;It could be an annoyance; e.g., =
consider a user</span><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">who =
wants to see this while in a *Help* buffer. &nbsp;And I don't =
think</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;"><span style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;">being in the buffer =
under the major mode is the only way of getting</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">mode-specific bindings; for example, =
where-is-internal can accept a</span><br style=3D"caret-color: rgb(0, 0, =
0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">KEYMAP =
argument, which will be used to find key bindings.</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: =
none;"></div></blockquote><div><br></div><div>The current disadvantage =
is related, but much worse than this: you currently cannot configure =
quick help to show&nbsp;<i>any </i>bindings other than global and =
help-mode bindings. &nbsp;It might be nice to see e.g. org-bindings from =
<i>anywhere</i>, but to me it=E2=80=99s an advantage to show =E2=80=9Cquic=
k help for this mode=E2=80=9D.</div><br><blockquote =
type=3D"cite"><div><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">Or =
maybe we should have a separate command for cheat sheets =
specific</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;"><span style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;">to a major mode. =
&nbsp;The window we pop up cannot be too large, so if the</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">user only wants a quick help for the =
current mode, she might consider</span><br style=3D"caret-color: rgb(0, =
0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">global =
bindings an annoying waste of screen estate. =
&nbsp;</span></div></blockquote><div><br></div><div>I=E2=80=99d probably =
disable most of the global bindings, since I already know those. =
&nbsp;But <i>some</i> are useful (e.g. I often forget the project =
bindings). &nbsp;</div><br><blockquote type=3D"cite"><div><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">Moreover, the</span><br style=3D"caret-color:=
 rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant-caps: normal; font-weight: 400; letter-spacing: =
normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">current =
quick help shows "popular commands", which are likely to be</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">already known to some users, whereas when =
the user works in a major</span><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">mode =
that is new to the user, one is likely to be in the need of =
the</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;"><span style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;">cheat sheet for that one =
mode. &nbsp;(Yes, we do already have "C-h b", but</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">the output of that could be overwhelming: =
for example in an Org buffer</span><br style=3D"caret-color: rgb(0, 0, =
0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">I get =
almost 1400 lines in the *Help* buffer showing the =
Org-specific</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;"><span style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;">bindings.)</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: =
none;"></div></blockquote><div><br></div><div>Agree, this is a real =
problem for discoverability. &nbsp;Also command names are not always =
informative enough to find what you are actually looking for (org is =
terrible for this).</div><br><blockquote type=3D"cite"><div><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">IOW, if we want to consider mode-specific =
quick help, we should</span><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">perhaps =
discuss more about the goals before we consider code tricks to</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">implement it.</span><br style=3D"caret-color:=
 rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant-caps: normal; font-weight: 400; letter-spacing: =
normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"></div></blockquote><div><br></div><div>I do like =
this idea. &nbsp;Perhaps mode authors could add a =E2=80=9Cstarter =
pack=E2=80=9D of this information themselves, if they are suitably =
admonished to keep this information brief, high level, and with clear =
few-word command descriptions. &nbsp;Perhaps adding a =E2=80=98help-quick =
property to the mode command symbol? &nbsp;</div><div><br></div><div>One =
guiding principle I suggest: users in the end should be able to decide =
what quick help they need; what=E2=80=99s memorable for some may be =
frequently forgotten for others.&nbsp;</div></div><br></body></html>=

--Apple-Mail=_E7F07FC7-5300-4430-9253-F145EF9BB797--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.

Message received at 68236 <at> debbugs.gnu.org:


Received: (at 68236) by debbugs.gnu.org; 5 Jan 2024 08:40:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 05 03:40:37 2024
Received: from localhost ([127.0.0.1]:56341 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rLfkr-0000b9-3a
	for submit <at> debbugs.gnu.org; Fri, 05 Jan 2024 03:40:37 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:43598)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rLfkl-0000al-E3
 for 68236 <at> debbugs.gnu.org; Fri, 05 Jan 2024 03:40:35 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rLfkb-0007QP-QJ; Fri, 05 Jan 2024 03:40:21 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=zQvp67e1O6SybjSfzeuVAafwpNTbMUqC/jJL/Jmoraw=; b=Zu3tycmQZZvoQhQl31+z
 j7fKRpZr1bLQwUP/cJmYmpYLVFYoVNNB3cRe+ZbWrRexa3n7zZFyYejRtSbxLK7jnlTSPTv/puqLp
 OCptOezFx1bIKyGZ4BRDFp3/QhuRhC171Pk/DnpebtRDoC6zFhMdnRM/aHACyMpi6vUdBOu2soFib
 sFncyKn6ynkzMFcZhjFmLUsvE7/Nt9fDJQl97ubAj0Ri2hIZRakWbnFqNc1jU0VDcu1saXIcLvjxy
 sflnTGig2lDHEjp+IkB5ChDPnSycui+ctaR0C7Kt4D6MPDX/RkuQao+AowB2/1sA8EVtqYffS0Lvk
 eNVqeCtVhchZ0g==;
Date: Fri, 05 Jan 2024 10:40:02 +0200
Message-Id: <835y08w4v1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: JD Smith <jdtsmith@HIDDEN>,
 Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <4CB34A88-87DE-4347-A886-4BF8D4998E67@HIDDEN> (message from JD
 Smith on Thu, 4 Jan 2024 20:28:27 -0500)
Subject: Re: bug#68236: [PATCH] help.el: allow help-quick to use local
 commands/quick-sections
References: <1B0F351A-C393-4C1B-B883-814F2C33E802@HIDDEN>
 <83a5ply2ca.fsf@HIDDEN> <721ABC11-E691-43F9-9034-F375240C2E20@HIDDEN>
 <83sf3dw699.fsf@HIDDEN> <4CB34A88-87DE-4347-A886-4BF8D4998E67@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68236
Cc: 68236 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: JD Smith <jdtsmith@HIDDEN>
> Date: Thu, 4 Jan 2024 20:28:27 -0500
> Cc: 68236 <at> debbugs.gnu.org
> 
> > On Jan 4, 2024, at 8:57 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
> > 
> > If we are going to expose help-quick-sections as a defcustom, then I
> > don't understand why we need to change the code at all.  Is the idea
> > that sections will depend on the current buffer?  If so, then we just
> > need to add an element to the list members which will store the
> > major-mode for which the member is relevant.
> > 
> > Or what am I missing?
> 
> 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.

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.

Stefan, WDYT?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.

Message received at 68236 <at> debbugs.gnu.org:


Received: (at 68236) by debbugs.gnu.org; 5 Jan 2024 01:28:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 04 20:28:55 2024
Received: from localhost ([127.0.0.1]:56045 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rLZ13-0006Cc-JZ
	for submit <at> debbugs.gnu.org; Thu, 04 Jan 2024 20:28:55 -0500
Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]:46542)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jdtsmith@HIDDEN>) id 1rLZ0y-0006CM-7M
 for 68236 <at> debbugs.gnu.org; Thu, 04 Jan 2024 20:28:52 -0500
Received: by mail-qv1-xf2a.google.com with SMTP id
 6a1803df08f44-6808c3938afso5151436d6.1
 for <68236 <at> debbugs.gnu.org>; Thu, 04 Jan 2024 17:28:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1704418118; x=1705022918; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=bkYDG3UIjmTCr0s5PUHH24rcLg71xCAClnYfTOnqwmw=;
 b=WaRlFo45IVStk2bfCP3fbumZRXq0IFrwehOLhUYXv5cN3i8Q4ZcPLu4JPOKdX2xR5+
 HRQcFlIXLbDCg4+9bXvbJryEVD1DxSXhoWvLTMp8ZBY0oco9S0uj79tp4GqIHPzW6bXZ
 zr3pCvTu32Pn8umuGjyho20mYQ1cFLOPZGMfouc7pbXeDuUDqUnWX/29d2AQhr9EbYSg
 f9uIN28uWNb5kC3YEdAxG+HCvTk4v43bARL55j9LXw4fOSwTiqL8JZ7NsJ6q6tYA3Qy/
 /g3ixoqGsFjiJ8GsGzllqNJF3sza14HIxrxEvKpjCi2rkbET2nQJSO3CVvAYUK1XbdZz
 kxUQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1704418118; x=1705022918;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=bkYDG3UIjmTCr0s5PUHH24rcLg71xCAClnYfTOnqwmw=;
 b=ShY9DemO3de3ghOskKNLN1jzsdT95PvIEYrBGeR+OrlpfKiQJzpDdNZWfm2bu90HHY
 ZK66u+AT+806gJNNsb2tuAsvQg3K7T/wAqcIDC+q6afxgIhN1PWiL6uCiyUKNhCiCLse
 go8kzWAta4xZjVj77+2ECDB0Sl2Gi8Ud99lu4UtOMyVT8fYIFTt2sLHD8FbUOnj5TkfQ
 52ZvboPV9bR/DHk0ot3e16nJkGCo8SwAn8Bf7wVizFMiRp0xMB2vT+ltmsJRiH/ps1SP
 kzYDuZ1R6D+DH/L0VawK92v4qTEjaCuZZDPaSYWeZbFRa2zT71UUDQyWamZ9NJw1HO9B
 q2hg==
X-Gm-Message-State: AOJu0YxHD5EvDXFK3mz04fRRI4wEwGvroTsDbM0M/NrJtEIHqFbh7Jqu
 4vZbUR7/8tYQoaASFebgA+p+KAYTo/z+sg==
X-Google-Smtp-Source: AGHT+IF1ispmZqOTmhkx9HoBLWowM6n3Zzum7ogiGJWWp+8AMtgEn+wpvd9pXfbtmG57JRqN/jzWYQ==
X-Received: by 2002:a05:6214:2388:b0:680:bf47:632d with SMTP id
 fw8-20020a056214238800b00680bf47632dmr1332714qvb.59.1704418118526; 
 Thu, 04 Jan 2024 17:28:38 -0800 (PST)
Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net.
 [24.53.187.34]) by smtp.gmail.com with ESMTPSA id
 mz6-20020a0562142d0600b0067f8953f78fsm234309qvb.41.2024.01.04.17.28.37
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 04 Jan 2024 17:28:37 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\))
Subject: Re: bug#68236: [PATCH] help.el: allow help-quick to use local
 commands/quick-sections
From: JD Smith <jdtsmith@HIDDEN>
In-Reply-To: <83sf3dw699.fsf@HIDDEN>
Date: Thu, 4 Jan 2024 20:28:27 -0500
Content-Transfer-Encoding: quoted-printable
Message-Id: <4CB34A88-87DE-4347-A886-4BF8D4998E67@HIDDEN>
References: <1B0F351A-C393-4C1B-B883-814F2C33E802@HIDDEN>
 <83a5ply2ca.fsf@HIDDEN> <721ABC11-E691-43F9-9034-F375240C2E20@HIDDEN>
 <83sf3dw699.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3774.300.61.1.2)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68236
Cc: 68236 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Jan 4, 2024, at 8:57=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>=20
>> From: JD Smith <jdtsmith@HIDDEN>
>> Date: Thu, 4 Jan 2024 08:45:50 -0500
>> Cc: 68236 <at> debbugs.gnu.org
>>=20
>> On Jan 4, 2024, at 2:39=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>>=20
>> Please describe in more detail how would people use this for their
>> personal "quick help", because I don't think I understand well enough
>> what you have in mind.
>>=20
>> For example, an org user may
>>=20
>> (add-to-list 'help-quick-sections
>>             '("Org"
>>      (org-ctrl-c-star . "Compute table/change heading ")
>>      (org-ctrl-c-ret . "Table hline/insert heading")))
>>=20
>> so that from org-buffers, C-h C-q adds a new section:
>>=20
>> Org                                 =20
>> C-c *   Compute table/change heading=20
>> C-c RET Table hline/insert heading  =20
>>=20
>> Most likely users willing to customize `help-quick-sections=E2=80=99 =
would remove existing sections with
>> commands they know well. =20
>>=20
>> In any case, such a change will need suitable changes for
>> documentation.
>>=20
>> Do you mean documentation for the `help-quick-sections' variable?  =
How about turning this into a
>> defcustom?  This would allow more advanced users to fully customize =
what =E2=80=9Cquick help=E2=80=9D they want.
>=20
> If we are going to expose help-quick-sections as a defcustom, then I
> don't understand why we need to change the code at all.  Is the idea
> that sections will depend on the current buffer?  If so, then we just
> need to add an element to the list members which will store the
> major-mode for which the member is relevant.
>=20
> Or what am I missing?

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 (=3Dhave =
no bindings) in some buffer is not a problem. =20=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.

Message received at 68236 <at> debbugs.gnu.org:


Received: (at 68236) by debbugs.gnu.org; 4 Jan 2024 13:58:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 04 08:58:07 2024
Received: from localhost ([127.0.0.1]:53908 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rLOEZ-0002tu-I2
	for submit <at> debbugs.gnu.org; Thu, 04 Jan 2024 08:58:07 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:53932)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rLOEU-0002tK-M1
 for 68236 <at> debbugs.gnu.org; Thu, 04 Jan 2024 08:58:05 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rLOEL-000483-Kw; Thu, 04 Jan 2024 08:57:53 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=2pl5KubNjGb8HorVVGdjY3jqnPO2metXzrOjxytGksQ=; b=WZ/i2iI4t16wULcFqoP5
 i/I5YJ2gb7rWZc2l0fy5OfgH6hbippO3YhG5LpPUVPwS50snx2a/ONXibkxP6NGOQWXFmBE0cKlZl
 7VQwz99c9y2wpylOHQdy0RI50lziwHQ33PRlR1e9m9gDA8xUsqXUUk3VdsoksMOMWS/zWRniyV2yo
 rVbLlxKVnTVRwH/x8jV58jQDpP7DRkXS1n8D/84NwFxikSESFVSePlRf+4fLoohRmTX51D9ozs5TD
 Ygwnwb7Xiq1oa0vubYSyG8I1TmvjX/9n/ssU1+gEVxpb9KO+oO9ftWhLpAiYz2FQP39Hgvc+ZMOVo
 3jP0nZHdPr/d9Q==;
Date: Thu, 04 Jan 2024 15:57:38 +0200
Message-Id: <83sf3dw699.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: JD Smith <jdtsmith@HIDDEN>
In-Reply-To: <721ABC11-E691-43F9-9034-F375240C2E20@HIDDEN> (message from JD
 Smith on Thu, 4 Jan 2024 08:45:50 -0500)
Subject: Re: bug#68236: [PATCH] help.el: allow help-quick to use local
 commands/quick-sections
References: <1B0F351A-C393-4C1B-B883-814F2C33E802@HIDDEN>
 <83a5ply2ca.fsf@HIDDEN> <721ABC11-E691-43F9-9034-F375240C2E20@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68236
Cc: 68236 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: JD Smith <jdtsmith@HIDDEN>
> Date: Thu, 4 Jan 2024 08:45:50 -0500
> Cc: 68236 <at> debbugs.gnu.org
> 
>  On Jan 4, 2024, at 2:39 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
> 
>  Please describe in more detail how would people use this for their
>  personal "quick help", because I don't think I understand well enough
>  what you have in mind.
> 
> For example, an org user may
> 
> (add-to-list 'help-quick-sections
>              '("Org"
>       (org-ctrl-c-star . "Compute table/change heading ")
>       (org-ctrl-c-ret . "Table hline/insert heading")))
> 
> so that from org-buffers, C-h C-q adds a new section:
> 
> Org                                  
> C-c *   Compute table/change heading 
> C-c RET Table hline/insert heading   
> 
> Most likely users willing to customize `help-quick-sections’ would remove existing sections with
> commands they know well.  
> 
>  In any case, such a change will need suitable changes for
>  documentation.
> 
> Do you mean documentation for the `help-quick-sections' variable?  How about turning this into a
> defcustom?  This would allow more advanced users to fully customize what “quick help” they want.

If we are going to expose help-quick-sections as a defcustom, then I
don't understand why we need to change the code at all.  Is the idea
that sections will depend on the current buffer?  If so, then we just
need to add an element to the list members which will store the
major-mode for which the member is relevant.

Or what am I missing?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.

Message received at 68236 <at> debbugs.gnu.org:


Received: (at 68236) by debbugs.gnu.org; 4 Jan 2024 13:46:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 04 08:46:14 2024
Received: from localhost ([127.0.0.1]:53901 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rLO34-0002Ev-5W
	for submit <at> debbugs.gnu.org; Thu, 04 Jan 2024 08:46:14 -0500
Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]:58665)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jdtsmith@HIDDEN>) id 1rLO32-000265-HZ
 for 68236 <at> debbugs.gnu.org; Thu, 04 Jan 2024 08:46:13 -0500
Received: by mail-qt1-x829.google.com with SMTP id
 d75a77b69052e-427f000385bso2408731cf.1
 for <68236 <at> debbugs.gnu.org>; Thu, 04 Jan 2024 05:46:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1704375963; x=1704980763; darn=debbugs.gnu.org;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=+OoHXik6AlcaAN5lYbOupOGVGSiAgAncUukIywcNgRg=;
 b=apEey3WoMxYDdrNfM3iJzo9+y6eORoJRG0HCRpbBZx+z7t2PN+vlL97tWsMiVpjgwF
 r1Ba5qDMBK2GjtmmcGD1uf9ase/vxziOxtogEwHS7uEK6gwBsIP7nKiTXPg0BJUi7GO0
 WZBr2JDTLfF2Gd/pRKN9LDaKPtLRkaKIV0fMMxCvWtIbQi0RDoSrrq1tBfJW9soZzJKq
 0Cn9M3/+wO1BhGcipt8ELegat7aJMWhUfloCTvgjn/Wje7o8hI8MZCHFPdn2U7pSIrKm
 0bK0KPEJp1VtXASxAuUW4q/BSHW5Hq9B49inoWC6ZhbU49cyEq5+R5njmZrzBZkkjgQg
 g4Xg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1704375963; x=1704980763;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=+OoHXik6AlcaAN5lYbOupOGVGSiAgAncUukIywcNgRg=;
 b=umDL4GpDO8pWUmqPgMx2LO43DB0Q1xbHOKr04zXiNacFLDRpiINjVgUekMOHoucZcr
 2FJwal7eDRO7b1NfD0yix+S16iWlMVL4GRGskI5XMPJlajzdalOoacfPWttmi3FlD5qW
 ZL84sa9bbQFsTcJCkqN9OFijpdrWPPe0cbJCKz8+j8uc1wsy4xiQbvPWYDbPN2So62kz
 lkV9wQGBmN4DMS0nXrLFSUIGYvvp0YS7xeDRqSZ4RIgyVR1FGQx00yatDMn53Ze1Qiin
 BNlPGDTae5HQdj7o54ce19UJZebYMg+nHDpojm2pXWoff1SN4OJKMA6ZjyQw+QBnYarP
 yhOg==
X-Gm-Message-State: AOJu0YxjS0VUVG4b0hN1pd3Wu0D7HIzNyopIvam/6PszKYqHRhmJxJuQ
 4G6Huw40zisxRqbznbAGskhf5izqd9dbGA==
X-Google-Smtp-Source: AGHT+IEoJw7Ng/iKdrg3F8WTmIgvGWBzgmP21/9Hp3mP+tyKOqhrDPox8VDBDOkffV7MzYltDxeMFg==
X-Received: by 2002:a05:622a:1a1b:b0:429:7102:4db with SMTP id
 f27-20020a05622a1a1b00b00429710204dbmr711053qtb.129.1704375963052; 
 Thu, 04 Jan 2024 05:46:03 -0800 (PST)
Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net.
 [24.53.187.34]) by smtp.gmail.com with ESMTPSA id
 bv14-20020a05622a0a0e00b0042835859362sm2190272qtb.50.2024.01.04.05.46.01
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 04 Jan 2024 05:46:01 -0800 (PST)
From: JD Smith <jdtsmith@HIDDEN>
Message-Id: <721ABC11-E691-43F9-9034-F375240C2E20@HIDDEN>
Content-Type: multipart/alternative;
 boundary="Apple-Mail=_BA2E0AC0-2B62-4174-AF56-0BA1F746360E"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\))
Subject: Re: bug#68236: [PATCH] help.el: allow help-quick to use local
 commands/quick-sections
Date: Thu, 4 Jan 2024 08:45:50 -0500
In-Reply-To: <83a5ply2ca.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
References: <1B0F351A-C393-4C1B-B883-814F2C33E802@HIDDEN>
 <83a5ply2ca.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3774.300.61.1.2)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68236
Cc: 68236 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--Apple-Mail=_BA2E0AC0-2B62-4174-AF56-0BA1F746360E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On Jan 4, 2024, at 2:39=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>=20
> Please describe in more detail how would people use this for their
> personal "quick help", because I don't think I understand well enough
> what you have in mind.

For example, an org user may

(add-to-list 'help-quick-sections
             '("Org"
	       (org-ctrl-c-star . "Compute table/change heading ")
	       (org-ctrl-c-ret . "Table hline/insert heading")))

so that from org-buffers, C-h C-q adds a new section:

Org                                 =20
C-c *   Compute table/change heading=20
C-c RET Table hline/insert heading  =20

Most likely users willing to customize `help-quick-sections=E2=80=99 =
would remove existing sections with commands they know well. =20

> In any case, such a change will need suitable changes for
> documentation.

Do you mean documentation for the `help-quick-sections' variable?  How =
about turning this into a defcustom?  This would allow more advanced =
users to fully customize what =E2=80=9Cquick help=E2=80=9D they want.=

--Apple-Mail=_BA2E0AC0-2B62-4174-AF56-0BA1F746360E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;"><br =
id=3D"lineBreakAtBeginningOfMessage"><div><br><blockquote =
type=3D"cite"><div>On Jan 4, 2024, at 2:39=E2=80=AFAM, Eli Zaretskii =
&lt;eliz@HIDDEN&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div><span style=3D"caret-color: =
rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant-caps: normal; font-weight: 400; letter-spacing: =
normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">Please =
describe in more detail how would people use this for their</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">personal "quick help", because I don't =
think I understand well enough</span><br style=3D"caret-color: rgb(0, 0, =
0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">what =
you have in mind.</span><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"></div></blockquote><div><br></div><div>For =
example, an org user may</div><div><br></div><div><div>(add-to-list =
'help-quick-sections</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;'("Org"</div><div><span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span> &nbsp; &nbsp; &nbsp; =
(org-ctrl-c-star . "Compute table/change heading ")</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> &nbsp; =
&nbsp; &nbsp; (org-ctrl-c-ret . "Table hline/insert =
heading")))</div><div><br></div><div>so that from org-buffers, C-h C-q =
adds a new section:</div><div><br></div><div><div>Org &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>C-c * &nbsp; Compute =
table/change heading&nbsp;</div><div>C-c RET Table hline/insert heading =
&nbsp;&nbsp;</div><div><br></div><div>Most likely users willing to =
customize `help-quick-sections=E2=80=99 would remove existing sections =
with commands they know well. &nbsp;</div></div></div><br><blockquote =
type=3D"cite"><div><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;">In any =
case, such a change will need suitable changes for</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">documentation.</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: =
none;"></div></blockquote></div><br><div>Do you mean documentation for =
the `help-quick-sections' variable? &nbsp;How about turning this into a =
defcustom? &nbsp;This would allow more advanced users to fully customize =
what =E2=80=9Cquick help=E2=80=9D they want.</div></body></html>=

--Apple-Mail=_BA2E0AC0-2B62-4174-AF56-0BA1F746360E--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.

Message received at 68236 <at> debbugs.gnu.org:


Received: (at 68236) by debbugs.gnu.org; 4 Jan 2024 07:39:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 04 02:39:43 2024
Received: from localhost ([127.0.0.1]:53558 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rLIKM-0003sX-Lp
	for submit <at> debbugs.gnu.org; Thu, 04 Jan 2024 02:39:42 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:58748)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rLIKL-0003sK-AT
 for 68236 <at> debbugs.gnu.org; Thu, 04 Jan 2024 02:39:42 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rLIKB-0006Ym-T2; Thu, 04 Jan 2024 02:39:32 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=hsZpE+l+6lU4bBhJ4NTgsoH/bdGUUFgqIJaZHq5Faqg=; b=Mnu16Iq9mkwYyBxvsI4I
 YocKLGA9WVQg4DqQKvXtHUxmTqpO3BFu1j29ftVBHWJcw8v0QUsZP6ebfO6YHHxkYlcz3/BqEPUJl
 JtqXgZ5k0qJY/hYWYTAaKUsXtQ6TBOwLxSjZ63CPYcq7Kbco4btVZTBDXGhVc7MCyTyGbpsr9jn2L
 lBQact0v1H5+ec2+Tm89H1AW/h8tirZghTvy8wyVvqAOqOKEN0FBAjbQqRN+NHpcHgi38TRZ6QAy7
 j62y+/C2OlniydrWPmcLQgMQXXZeQWfy8Bmdfu6UJP/RbSJNfhS77B8j7mFszqFw5n4NiGX5AxAkS
 vYK16nkTrnI0zA==;
Date: Thu, 04 Jan 2024 09:39:17 +0200
Message-Id: <83a5ply2ca.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: JD Smith <jdtsmith@HIDDEN>
In-Reply-To: <1B0F351A-C393-4C1B-B883-814F2C33E802@HIDDEN> (message from JD
 Smith on Wed, 3 Jan 2024 22:08:56 -0500)
Subject: Re: bug#68236: [PATCH] help.el: allow help-quick to use local
 commands/quick-sections
References: <1B0F351A-C393-4C1B-B883-814F2C33E802@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68236
Cc: 68236 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: JD Smith <jdtsmith@HIDDEN>
> Date: Wed, 3 Jan 2024 22:08:56 -0500
> 
> Someone came up with the great idea of using help.el’s `help-quick' command for a personal “scratch pad” of useful/hard-to-remember bindings, and then to bind `help-quick-sections' locally in various modes.  Unfortunately, `help-quick' first sets the buffer to *Quick Help* and then builds its list of command bindings and descriptions.  This means that only the default value of `help-quick-sections’ will ever be consulted, and no local key bindings can be expressed.  
> 
> The fix is simple; build the list of quick help information first in the current buffer (from which C-h C-q is called) and then displaying it in the *Quick Help* buffer.  With this, people can use quick help and its handy binding to prompt with their own personal hard-to-remember key bindings/command info.  What’s cool is that help-quick omits “empty” sections, so you could even add a variety of sections, and they will appear if and only if bindings are actually available in the buffer where quick help is invoked.

Please describe in more detail how would people use this for their
personal "quick help", because I don't think I understand well enough
what you have in mind.

In any case, such a change will need suitable changes for
documentation.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Jan 2024 03:09:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 03 22:09:26 2024
Received: from localhost ([127.0.0.1]:53383 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rLE6n-0000FZ-Ha
	for submit <at> debbugs.gnu.org; Wed, 03 Jan 2024 22:09:26 -0500
Received: from lists.gnu.org ([2001:470:142::17]:59144)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jdtsmith@HIDDEN>) id 1rLE6k-0000FJ-CX
 for submit <at> debbugs.gnu.org; Wed, 03 Jan 2024 22:09:23 -0500
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 <jdtsmith@HIDDEN>)
 id 1rLE6a-0004ib-Tv
 for bug-gnu-emacs@HIDDEN; Wed, 03 Jan 2024 22:09:13 -0500
Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jdtsmith@HIDDEN>)
 id 1rLE6Y-0002LL-Ew
 for bug-gnu-emacs@HIDDEN; Wed, 03 Jan 2024 22:09:12 -0500
Received: by mail-qt1-x82d.google.com with SMTP id
 d75a77b69052e-427f4407624so476501cf.3
 for <bug-gnu-emacs@HIDDEN>; Wed, 03 Jan 2024 19:09:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1704337748; x=1704942548; darn=gnu.org;
 h=to:date:message-id:subject:mime-version:content-transfer-encoding
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=mmL6jv4KCuK2GtYn3wydPJAuNl8RlD0YajhFpkejIys=;
 b=GIEc+JjX9hquVl45sZOBsvaMfTjzyrltZ6p0feMVOPe67aHAQKG7Mli3l13jT9o6Bl
 xj4YxeQ8LtxZzUMdvIT0fqpymZ4CiKVjZV5qcpLyE+Zhkn84yIyWxl500vTqHxYLTt9z
 y6GyurjR0oawUbLo5ztrGxmy4nCTfJVfGOH4dY/YdbQVMedGXwi9IlqskxBFxw9uznV4
 F2PdHqa0Kk1/uu7kLWpmDR3czs6O3WDpsiDzEfeCRYDdiUUVZL9V26pfI7Vis6voNdl1
 ekOOhSnUXlOGTNxG25G3fdoJxhzPIXwWFZIHV41nEa/rDsTABYDi6sQVk13nPF3nLNeR
 diQw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1704337748; x=1704942548;
 h=to:date:message-id:subject:mime-version:content-transfer-encoding
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=mmL6jv4KCuK2GtYn3wydPJAuNl8RlD0YajhFpkejIys=;
 b=vqbKrjIVwn3DPE/UQrxtyb00FDKMAs3RkseoH2RoXPnWtPdUrWtwXeKHOxM59Jwo4Q
 n1ZXteK5a2fGD0APsA6cNnkycqPCPNE++B2+0l//UvTJSdJuzQpekP8y1RrGDivl0s5F
 G4KPRGYyBA4UbrnKwcc5eZGnQ0n67maYrv0eb/KnUyFZxBziyyE5cZCKW6zmSZcXyA9M
 8QA8ZYVg6kcvvcHfhcZeHHqX9n/1unGKpBhizmYqZZcuqO6BR8XcP7afIbevJPebafTC
 wyc1QfE934iTqcW2jSymltaJjYsYmVwXEkb8oGF2ot58xVWfELfP0qvMf1gyKXYt3HXp
 zB9A==
X-Gm-Message-State: AOJu0Yx8DlCkkD6CwQ6lRbUT7jVsuTIIeb9LB6244EzUPBCcV4Rqrfhw
 AshCnd49HaomJEkCwCLKwc6xML9Arlrbbg==
X-Google-Smtp-Source: AGHT+IEBWAR1FstEZs25FVxoSaQxTUD/ArgT45mZ2YxcMrFat4Md4jBasfvzouRYzaDDM6/c6vjKlQ==
X-Received: by 2002:ac8:5705:0:b0:428:2654:eac1 with SMTP id
 5-20020ac85705000000b004282654eac1mr11436qtw.107.1704337748062; 
 Wed, 03 Jan 2024 19:09:08 -0800 (PST)
Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net.
 [24.53.187.34]) by smtp.gmail.com with ESMTPSA id
 fv22-20020a05622a4a1600b00427f0fdcd44sm8021820qtb.1.2024.01.03.19.09.07
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 03 Jan 2024 19:09:07 -0800 (PST)
From: JD Smith <jdtsmith@HIDDEN>
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\))
Subject: [PATCH] help.el: allow help-quick to use local commands/quick-sections
Message-Id: <1B0F351A-C393-4C1B-B883-814F2C33E802@HIDDEN>
Date: Wed, 3 Jan 2024 22:08:56 -0500
To: bug-gnu-emacs@HIDDEN
X-Mailer: Apple Mail (2.3774.300.61.1.2)
Received-SPF: pass client-ip=2607:f8b0:4864:20::82d;
 envelope-from=jdtsmith@HIDDEN; helo=mail-qt1-x82d.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, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Someone came up with the great idea of using help.el=E2=80=99s =
`help-quick' command for a personal =E2=80=9Cscratch pad=E2=80=9D of =
useful/hard-to-remember bindings, and then to bind `help-quick-sections' =
locally in various modes.  Unfortunately, `help-quick' first sets the =
buffer to *Quick Help* and then builds its list of command bindings and =
descriptions.  This means that only the default value of =
`help-quick-sections=E2=80=99 will ever be consulted, and no local key =
bindings can be expressed. =20

The fix is simple; build the list of quick help information first in the =
current buffer (from which C-h C-q is called) and then displaying it in =
the *Quick Help* buffer.  With this, people can use quick help and its =
handy binding to prompt with their own personal hard-to-remember key =
bindings/command info.  What=E2=80=99s cool is that help-quick omits =
=E2=80=9Cempty=E2=80=9D sections, so you could even add a variety of =
sections, and they will appear if and only if bindings are actually =
available in the buffer where quick help is invoked.

+++
diff -u lisp/help.el lisp/help_fix_quick.el
--- lisp/help.el	2024-01-03 21:54:46
+++ lisp/help_fix_quick.el	2024-01-03 21:52:46
@@ -173,78 +173,79 @@
 (defun help-quick ()
   "Display a quick-help buffer."
   (interactive)
-  (with-current-buffer (get-buffer-create "*Quick Help*")
-    (let ((inhibit-read-only t) (padding 2) blocks)
+  (let ((buf (get-buffer-create "*Quick Help*"))
+	(inhibit-read-only t) (padding 2) blocks)
=20
-      ;; Go through every section and prepare a text-rectangle to be
-      ;; inserted later.
-      (dolist (section help-quick-sections)
-        (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))
-                     (key (if bind
-                              (propertize
-                               (key-description bind)
-                               'face 'help-key-binding)
-                            (throw 'skip nil))))
-                (setq max-cmd-len (max (length (cdr ent)) max-cmd-len)
-                      max-key-len (max (length key) max-key-len))
-                (push (list key (cdr ent) (car ent)) keys))))
-          (when keys
-            (let ((fmt (format "%%-%ds %%-%ds%s" max-key-len =
max-cmd-len
-                               (make-string padding ?\s)))
-                  (width (+ max-key-len 1 max-cmd-len padding)))
-              (push `(,width
-                      ,(propertize
-                        (concat
-                         (car section)
-                         (make-string (- width (length (car section))) =
?\s))
-                        'face 'bold)
-                      ,@(mapcar (lambda (ent)
-                                  (format fmt
-                                          (propertize
-                                           (car ent)
-                                           'quick-help-cmd
-                                           (caddr ent))
-                                          (cadr ent)))
-                                keys))
-                    blocks)))))
+    ;; Go through every section and prepare a text-rectangle to be
+    ;; inserted later.
+    (dolist (section help-quick-sections)
+      (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))
+                   (key (if bind
+			    (propertize
+			     (key-description bind)
+			     'face 'help-key-binding)
+                          (throw 'skip nil))))
+              (setq max-cmd-len (max (length (cdr ent)) max-cmd-len)
+		    max-key-len (max (length key) max-key-len))
+              (push (list key (cdr ent) (car ent)) keys))))
+        (when keys
+          (let ((fmt (format "%%-%ds %%-%ds%s" max-key-len max-cmd-len
+			     (make-string padding ?\s)))
+                (width (+ max-key-len 1 max-cmd-len padding)))
+	    (push `(,width
+		    ,(propertize
+                      (concat
+                       (car section)
+                       (make-string (- width (length (car section))) =
?\s))
+                      'face 'bold)
+		    ,@(mapcar (lambda (ent)
+                                (format fmt
+                                        (propertize
+                                         (car ent)
+                                         'quick-help-cmd
+                                         (caddr ent))
+                                        (cadr ent)))
+                              keys))
+                  blocks)))))
=20
-      ;; Insert each rectangle in order until they don't fit into the
-      ;; frame any more, in which case the next sections are inserted
-      ;; in a new "line".
+    ;; Insert each rectangle in order until they don't fit into the
+    ;; frame any more, in which case the next sections are inserted
+    ;; in a new "line".
+    (with-current-buffer buf
       (erase-buffer)
       (dolist (block (nreverse blocks))
-        (when (> (+ (car block) (current-column)) (frame-width))
+	(when (> (+ (car block) (current-column)) (frame-width))
           (goto-char (point-max))
           (newline 2))
-        (save-excursion
+	(save-excursion
           (insert-rectangle (cdr block)))
-        (end-of-line))
+	(end-of-line))
       (delete-trailing-whitespace)
=20
       (save-excursion
-        (goto-char (point-min))
-        (while-let ((match (text-property-search-forward =
'quick-help-cmd)))
+	(goto-char (point-min))
+	(while-let ((match (text-property-search-forward =
'quick-help-cmd)))
           (make-text-button (prop-match-beginning match)
                             (prop-match-end match)
                             'mouse-face 'highlight
                             'button t
                             'keymap button-map
                             'action #'describe-symbol
-                            'button-data (prop-match-value match)))))
+                            'button-data (prop-match-value match))))
=20
-    (help-mode)
+      (help-mode))
=20
     ;; Display the buffer at the bottom of the frame...
-    (with-selected-window (display-buffer-at-bottom (current-buffer) =
'())
+    (with-selected-window (display-buffer-at-bottom buf '())
       ;; ... mark it as dedicated to prevent focus from being stolen
       (set-window-dedicated-p (selected-window) t)
       ;; ... and shrink it immediately.
-      (fit-window-to-buffer))
-    (message
-     (substitute-command-keys "Toggle the quick help buffer using =
\\[help-quick-toggle]."))))
+      (fit-window-to-buffer)))
+  (message
+   (substitute-command-keys "Toggle the quick help buffer using =
\\[help-quick-toggle].")))
=20
 (defun help-quick-toggle ()
   "Toggle the quick-help window."






Acknowledgement sent to JD Smith <jdtsmith@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#68236; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 20 Jan 2024 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.