Commit graph

22 commits

Author SHA1 Message Date
Robert Pluim
d4f81f716a Improve 'which-key-special-keys' docstring
* lisp/which-key.el (which-key-special-keys): Explain the format
and use 'setopt'.
2024-11-15 16:31:08 +01:00
Thomas Voss
7766ba8419 Align columns in which-key with wide characters properly
In the case that a character takes up multple columns (such as
`…' when used as a truncation character), make sure that the
columns are still aligned properly.
* lisp/which-key.el (which-key--pad-column): Use `string-width'
instead of `length'.  (Bug#73463)

Copyright-paperwork-exempt: yes
2024-09-25 14:55:25 +03:00
Eli Zaretskii
4d6fadb8d2 ; * lisp/which-key.el: Fix ':package-version' (bug#73072). 2024-09-06 19:02:50 +03:00
Philip Kaludercic
1ae2f00447
Fix edge-case with 'which-key-dont-use-unicode' setter
* lisp/which-key.el (which-key-dont-use-unicode): Check if the
user options have a 'standard-value' before proceeding to
reevaluate.  This avoids accidentally setting the symbol value
to nil, before the user option has been declared, overriding the
actual non-nil, default values.  (Bug#72077)
2024-07-26 23:26:14 +02:00
john muhl
e6f78485aa ; Fix typos in 'which-key-mode' (bug#72093)
* lisp/which-key.el (which-key-preserve-window-configuration):
Correct spelling of "taken".
(which-key--create-pages): Correct spelling of "widths".
(which-key--start-paging-timer): Correct spelling of
"secondary".
2024-07-13 18:50:07 +03:00
Stefan Kangas
45a20d781a ; Fix typos in symbols 2024-06-29 17:29:38 +02:00
Stefan Kangas
7372b2eb30 Expand docstring of which-key-mode
* lisp/which-key.el (which-key-mode): Expand docstring.
2024-06-29 00:57:10 +02:00
Philip Kaludercic
6ad6507532
; * lisp/which-key.el (which-key-dont-use-unicode): Add :initialize
This fixes the change from 768e92b9, which accidentally would call
'custom-reevaluate-setting' on user options before they were registered,
initialising their default value to nil.  When the 'defcustom'
expressions were evaluated later on, they were not properly initialised
as their variables were already bound to some value (nil).

https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg00825.html
2024-06-25 08:36:37 +02:00
Robert Pluim
7e8a97ac78 Show entries from key-translation-map in which-key mode
* lisp/which-key.el (which-key-extra-keymaps): New user option.
(which-key--get-current-bindings): Consult it.

(Bug#71648)
2024-06-24 19:17:38 +02:00
Philip Kaludercic
768e92b9c0
Update options that depend on 'which-key-dont-use-unicode'
* lisp/which-key.el (which-key-dont-use-unicode): Add a custom setter
that re-evaluates a manual list of options use
'which-key-dont-use-unicode' to determine their default value.

https://lists.gnu.org/archive/html/help-gnu-emacs/2024-06/msg00130.html
2024-06-24 09:46:09 +02:00
Stefan Kangas
fb11294d41 ; Fix typos 2024-06-23 16:40:06 +02:00
Philip Kaludercic
830b392e18
* lisp/which-key.el (which-key-is-verbose): Remove unused option 2024-06-19 22:54:40 +02:00
Philip Kaludercic
cc0a3a5f65
Disable usage of unicode for which-key by default
* lisp/which-key.el (which-key-dont-use-unicode): Set to t.
(which-key-separator, which-key-ellipsis): Ensure that these
options are set after 'which-key-dont-use-unicode', as their
default value depends on it.
2024-06-18 11:31:26 +02:00
Philip Kaludercic
543ad34ee4
Remove :underline from 'which-key-highlighted-command-face '
* lisp/which-key.el (which-key-highlighted-command-face): To
avoid using properties that might not be supported on all
displays, we instead inherit from the semantic face 'highlight'.
2024-06-18 11:31:24 +02:00
Philip Kaludercic
b0b7df823b
; * lisp/which-key.el (which-key--process-page): Use ?\s 2024-06-18 11:31:04 +02:00
Philip Kaludercic
e0190c4fb8
Prevent which-key faces from over-extending during formatting
* lisp/which-key.el (which-key--pad-column): Instead of
injecting the description using a left-aligned format-string (%-[n]s),
we manually add the necessary padding so that the text
properties don't extend beyond the description.  This allows us
to use a face with a background without it extending until the
end of a column.

See also 63a6fb2a7a for a similar
issue with Quick Help.
2024-06-18 11:31:04 +02:00
Stefan Kangas
e0871780ac ; Fix more checkdoc warnings in which-key.el
* lisp/which-key.el (which-key-special-keys)
(which-key-highlighted-command-face, which-key--safe-lookup-key)
(which-key--safe-lookup-key-description)
(which-key-add-keymap-based-replacements)
(which-key-add-key-based-replacements)
(which-key--fit-buffer-to-window-horizontally)
(which-key--popup-max-dimensions)
(which-key--propertize-description, which-key--format-and-replace)
(which-key--get-bindings, which-key--list-to-pages)
(which-key--create-pages-1, which-key--create-pages)
(which-key--get-popup-map, which-key-show-major-mode): Fix
checkdoc warnings.
2024-06-16 13:39:26 +02:00
Philip Kaludercic
43a2240119
Fix :version tag for 'which-key' custom data
* lisp/which-key.el (which-key-idle-delay)
(which-key-idle-secondary-delay, which-key-echo-keystrokes)
(which-key-max-description-length)
(which-key-min-column-description-width)
(which-key-add-column-padding, which-key-unicode-correction)
(which-key-dont-use-unicode, which-key-separator)
(which-key-ellipsis, which-key-prefix-prefix)
(which-key-compute-remaps, which-key-replacement-alist)
(which-key-allow-multiple-replacements)
(which-key-show-docstrings, which-key-highlighted-command-list)
(which-key-special-keys, which-key-buffer-name)
(which-key-show-prefix, which-key-popup-type)
(which-key-min-display-lines, which-key-max-display-columns)
(which-key-side-window-location, which-key-side-window-slot)
(which-key-side-window-max-width)
(which-key-side-window-max-height, which-key-frame-max-width)
(which-key-frame-max-height)
(which-key-allow-imprecise-window-fit)
(which-key-show-remaining-keys, which-key-sort-order)
(which-key-sort-uppercase-first, which-key-paging-prefixes)
(which-key-paging-key, which-key-use-C-h-commands)
(which-key-show-early-on-C-h, which-key-is-verbose)
(which-key-preserve-window-configuration)
(which-key-hide-alt-key-translations, which-key-delay-functions)
(which-key-allow-regexps, which-key-inhibit-regexps)
(which-key-show-transient-maps, which-key-init-buffer-hook)
(which-key-key-face, which-key-separator-face)
(which-key-note-face, which-key-command-description-face)
(which-key-local-map-description-face)
(which-key-highlighted-command-face)
(which-key-group-description-face, which-key-special-key-face)
(which-key-docstring-face)
(which-key-custom-popup-max-dimensions-function)
(which-key-custom-hide-popup-function)
(which-key-custom-show-popup-function, which-key-lighter)
(which-key-inhibit-display-hook)
(which-key-this-command-keys-function)
(which-key-allow-evil-operators)
(which-key-show-operator-state-maps): Rename :version to
:package-version and add new :version tags indicating that
'which-key' was added with Emacs 30.
2024-06-15 21:24:46 +02:00
Stefan Kangas
f2077bca79 Bump which-key minimum Emacs version to 25.1
* lisp/which-key.el: Bump minimum required Emacs version to 25.1 since
the package depends on `universal-argument--description'.  This was
detected by package-lint.
2024-06-15 16:33:09 +02:00
Stefan Kangas
1efbc8ff44 Fix checkdoc warnings in which-key.el
* lisp/which-key.el (which-key, which-key-idle-secondary-delay)
(which-key-replacement-alist)
(which-key-allow-multiple-replacements, which-key-show-docstrings)
(which-key-highlighted-command-list, which-key-show-prefix)
(which-key-sort-order, which-key-sort-uppercase-first)
(which-key-use-C-h-commands, which-key-show-early-on-C-h)
(which-key-preserve-window-configuration, which-key-C-h-map)
(which-key-delay-functions, which-key-inhibit-regexps)
(which-key-faces, which-key-key-face, which-key-separator-face)
(which-key-note-face, which-key-command-description-face)
(which-key-local-map-description-face, which-key-special-key-face)
(which-key-inhibit-display-hook)
(which-key-this-command-keys-function, which-key-mode)
(which-key--init-buffer, which-key--get-menu-item-binding)
(which-key--get-keymap-bindings, which-key-reload-key-sequence)
(which-key-show-major-mode, which-key-show-full-major-mode)
(which-key-C-h-dispatch): Fix checkdoc warnings.
2024-06-15 16:29:36 +02:00
Philip Kaludercic
4b2781f16d
* lisp/which-key.el: Clean up file header 2024-06-15 14:48:58 +02:00
Philip Kaludercic
f1c06968ee
Merge remote-tracking branch 'github-which-key/master' 2024-06-15 14:44:06 +02:00