Wilfred / helpful

A better Emacs *help* buffer
1.12k stars 62 forks source link

Improve user-friendliness of disambiguation prompt #324

Closed yuhan0 closed 1 year ago

yuhan0 commented 1 year ago

When executing C-h o on the symbol buffer-file-name, one currently gets the following prompt:

buffer-file-name is a both a variable and a callable, show variable?

Personally, I have to pause a few seconds every time to parse this question and decide whether to answer "yes" or "no".

This PR proposes the following improvement, via read-char-choice:

buffer-file-name is ambiguous: describe [c]allable / [v]ariable?

Which lets the user directly enter c or v via the minibuffer prompt, requiring much less mental effort.
(note: any other key choice is rejected, and one can abort with C-g.)

I've also added support for describing faces (and disambiguating them with the key choice f in [f]aces), using the native describe-face command. This can be helpful for symbols like font-lock-variable-name-face, which is both a customizable variable and the default face of the same name.

Wilfred commented 1 year ago

I was never super happy with the y-or-n-p usage, and this is a much nicer solution! Thanks :)