Subject: bug#68929: [PATCH] Copy which-key from GNU ELPA into core

From: Justin Burkett <[email-masked]>
Date: Thu, 8 Feb 2024 10:42:15 -0500

Hi all,

I appreciate the feedback. I have no doubt there are improvements to
be made. To the extent that I reinvented the wheel, it was because I
wasn't aware that particular wheel existed at the time. When I get
time, I will work on the things that have been mentioned here. I do
have a few questions and comments:

1. I think replacing third-party support with hooks that will allow
whatever package to insert code where needed is a good idea, although
some of these packages (like evil) have some pretty idiosyncratic
needs if I remember correctly.

2. I would like to depend as much as possible on built-in functions,
but I am probably unaware of all of the possibilities here, so any
suggestions would be appreciated. There might also be libraries in
emacs that have been written/improved since I wrote many of these
functions.

3. There were some oddities that we ran into early on around computing
the width of unicode characters that I did not fully understand, which
is why there are some clunky options for those. The main issue was
some characters came out wider than anticipated, breaking the width
calculations for the table shown by which-key. I would be happy to
improve those with guidance.

4. I never really liked the timer mechanism either, but I didn't find
an alternative to detecting when emacs was in the middle of reading a
key sequence. I like the idea of which-key as simply being a different
describe-prefix-bindings function, but my sense is that novices
appreciate the automatic popup. I'm wondering if anyone has any other
ideas. In principle, one could have a hook that emacs uses to notify
which-key that emacs is waiting on a key sequence, but maybe that is
overkill.

Thanks,
Justin

On Thu, Feb 8, 2024 at 1:16 AM Eli Zaretskii <[email-masked]> wrote:
>
> > From: Jeremy Bryant <[email-masked]>
> > Cc: [email-masked], [email-masked], [email-masked]
> > Date: Wed, 07 Feb 2024 22:01:05 +0000
> >
> >
> > Eli Zaretskii <[email-masked]> writes:
> > > Two spaces between sentences in comments and doc strings, here and
> > > elsewhere.
> >
> > OK.  Related point - This is not in the Elisp manual "Tips for
> > documentation strings", is it worth a patch for this?
>
> That section is not specific to the Emacs development.  Our
> conventions, which are specific to the Emacs development project, are
> in CONTRIBUTE.
>
> > > Please add a :version tag to all defcustom's and defface's.
> >
> > I cannot locate this in the elisp manual, Appendix D "Tips and
> > conventions", or in the defcustom and defface sections, should this be
> > documented and how?
>
> It's already documented in CONTRIBUTE.  Again, other Lisp programs out
> there are free not to follow these guidelines (and, in fact, :version
> might not have any useful effect in 3rd party packages), it is our own
> convention whose purpose is to help "M-x customize-changed" do its job
> well.