1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-24 00:40:35 -08:00
Commit graph

594 commits

Author SHA1 Message Date
Justin Burkett
fc29864395 Fix whitespace 2021-05-31 22:52:43 -04:00
Justin Burkett
7e854d0203 Fix recent commit 2021-05-31 22:48:53 -04:00
Justin Burkett
fa1b4c9b38
Merge pull request #303 from tarsiiformes/posframe
Support packages that use another frame to display bindings
2021-05-31 22:21:44 -04:00
Jonas Bernoulli
f6ce67d705
Get which-key--buffer's window from any frame
Previously we assumed the buffer was being displayed in a window
of the current frame, which isn't the case if e.g. a child frame
is being used.

We also cannot assume that the third-party code that sets up such
a child frame also deletes it.  `which-key-posframe' for example
merely hides it.
2021-05-30 21:32:50 +02:00
Jonas Bernoulli
016b9bbf86 Cosmetics 2021-05-30 21:10:04 +02:00
Jonas Bernoulli
1f5e532852
Avoid code-duplication in which-key--hide-popup 2021-05-30 20:17:49 +02:00
Jonas Bernoulli
aa91a7cd83
Fix nesting-level of "God-mode" section 2021-05-30 20:16:53 +02:00
Jiangbin Zhao
7927209c1b fix which-key--show-keymap for which-key-enable-extended-define-key
With which-key-enable-extended-define-key set to 't, given the keymap
and bindings below:

  (setq a-map (make-sparse-keymap))
  (bind-keys :map a-map
             ("a" . ("key 1" . command-1))
             ("b" . ("key b" . command-2)))

The output of (which-key--get-keymap-bindings a-map) was having
"unknown" as the key descriptions.

This change fixes it therefore allows the following to work as
expected:

(which-key--show-keymap "A map" a-map)
2021-05-23 14:48:29 -07:00
Frank Terbeck
5fb30301cb Unset header-line-format format in " *which-key*" buffer
Similarly to mode-line-format, header-line-format just takes up space and
currently also breaks window size calculations for the buffer. This sets
it to nil in order to suppress its display.

Signed-off-by: Frank Terbeck <ft@bewatermyfriend.org>
2021-04-06 20:28:00 -04:00
Celestial Nebula
c632dbf27a
Update reference to obsolete variable in DOCSTRING (#285) 2021-03-24 14:21:16 -04:00
Justin Burkett
c0608e812a Version 3.5.1 2021-01-31 13:37:08 -05:00
Justin Burkett
428aedfce0 Further simplify which-key--pseudo-key 2020-12-16 12:20:14 -05:00
Daniel Mendler
3908719ff2
simplify pseudo key 2020-12-15 23:58:39 +01:00
Justin Burkett
ae59b7edb0 Version 3.5.0 2020-09-08 19:01:44 -04:00
Justin Burkett
5b37abcbe7 Fix which-key--next-page-hint
prefix-keys might be a vector.

Fixes #265
2020-09-08 18:59:30 -04:00
Justin Burkett
a70fc16adc Hide paging hint when prefix is help-char
We can't do paging in this case.
2020-09-08 14:18:21 -04:00
Justin Burkett
2b10b8e77d Remove use of focus-{in,out}-hook
Fix #259 #260 #262
2020-09-01 21:35:43 -04:00
Justin Burkett
ebb4e92b3c Add which-key-add-keymap-based-replacements
This is an alternative to advising define-key using
which-key-enable-extended-define-key, but functions the same beneath the
surface.

Ref #226 #261
2020-08-28 10:17:40 -04:00
Rudi Grinberg
e48e190a75
Fix #257 (#258)
* Add test for #257

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

* Fix #257

Explicitly distinguish between replacing with `nil` and not replacing at
all.

I'm also simplifying the code by making all the branches more explicit.
This is a little longer, but makes all the clauses obvious.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
2020-08-17 19:58:31 -04:00
Rudi Grinberg
3642c11d5e Speed up which-key--maybe-replace
The first optimization is avoiding the intermediate list created by
append. Instead we just iterate over the two lists in turn

The second opimitization occurs where
which-key-allow-multiple-replacements is nil, in which case we can stop
the iteration once we've found a replacement

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
2020-07-21 15:27:24 -04:00
N V
8f2427a69b
Fix which-key--propertize-description use make-text-button return value (#249)
As of:

7ac79872ae

make-text-button no longer modifies a string when it is passed as the
first argument. which-key--propertize-description relied on the mutation
of the string argument. Using the return value of make-text-button will
return the propertized string with both the new and old behavior.

Fixes #248
2020-07-01 22:19:37 -04:00
Yunhao Zhao
f9d8d49d1f
Fix prefix argument for which-key-show-major-mode (#239) 2020-02-16 08:50:11 -05:00
Justin Burkett
7b068f3e95 Fix case sorting in alpha sort functions 2020-02-12 09:23:18 -05:00
Justin Burkett
9ff54fffbb Fix short windows being resized
fit-window-to-buffer defaults to a min height of 4. For some reason, the order
in which fit-window-to-buffer is called in display-buffer-in-side-window seems
to have changed. This makes the order not matter.
2020-02-11 21:48:57 -05:00
Justin Burkett
6e4b4c5419 Simplify last commit 2020-02-07 22:40:28 -05:00
Justin Burkett
d5a42732a6 Replace use of xor
Apparently this is a recent function
2020-02-07 22:34:41 -05:00
Justin Burkett
90d10a8fb3 Fix sorting of keys and add test
Fixes #233
2020-02-07 22:29:40 -05:00
Henrik Lissner
d1dfddcd1e Refactor regexp & fix incompatibility + error 2020-02-06 21:21:01 -05:00
Henrik Lissner
b11227b24b Strip out advice in command docstrings 2020-02-06 21:21:01 -05:00
Justin Burkett
45bfcd3041 Make which-key-show prefix mode-line work like top and bottom
Fixes #234
2020-02-03 20:57:53 -05:00
Justin Burkett
db3d003e90 Add full keymap versions of show-{major,minor}-mode
Fixes #236
2020-01-19 15:10:12 -05:00
Justin Burkett
1e3640e48c Make next page hint more consistent 2019-12-21 13:57:34 -05:00
Justin Burkett
8554a9f171 Generalize C-h commands to use help-char
help-char defaults to C-h. This removes the assumption that help-char is set to
C-h.

See #228
2019-12-21 13:47:54 -05:00
Justin Burkett
dcb9820c2d Default to imprecise window fitting on terminal
See #225.
2019-11-27 12:00:57 -05:00
Jonas Bernoulli
a916c9ae28 Fix typos (#222) 2019-11-11 14:51:32 -05:00
Justin Burkett
42a2505516 Rework implementation of manual updating
Instead of having people mess with prefix-help-command, use a new variable
which-key-show-early-on-C-h and control everything through
which-key-C-h-dispatch.
2019-08-01 22:40:30 -04:00
Justin Burkett
a256c4bce6 Use which-key-idle-secondary-delay value in manual updates 2019-08-01 15:32:55 -04:00
Justin Burkett
2cb5ceba55 Fix paging in which-key-manual-update 2019-07-31 13:59:11 -04:00
Justin Burkett
5cbfccd5fe Add which-key-manual-update
Intended to be used for prefix-help-command

Ref #66
2019-07-31 12:15:26 -04:00
Justin Burkett
da2e093e91 Add no-paging optional arg to which-key-show-keymap 2019-07-23 11:52:11 -04:00
Justin Burkett
cf8572a688 which-key-persistent-popup-p -> which-key-persistent-popup 2019-07-23 11:34:49 -04:00
Uros Perisic
fb2bc8fd08 Add which-key-persistent-popup-p variable (#213)
I did not remove the `pre-command-hook', because that would require me
to add the hook back every time `which-key--hide-popup' is called,
which seems excessive. Hercules.el already handles this more
conservatively. But if you want me to, I can add it.
2019-07-21 02:44:45 +08:00
D.K
ba03e7e5bc Add translation keymap support (#210) 2019-05-28 21:14:09 -04:00
Justin Burkett
77586e62b6 Add which-key-dump-bindings
Fixes #209
2019-05-17 21:57:18 -04:00
Justin Burkett
187ac0eb89 Add note to docstring for which-key-idle-delay
Ref #206
2019-03-15 08:48:23 -04:00
Justin Burkett
c87b0ce782 Add debugging messages for buffer sizing 2019-03-06 10:18:52 -05:00
Justin Burkett
51c485f16b Don't ignore case when making replacements
Fixes #204
2019-03-01 10:41:36 -05:00
Justin Burkett
9c5922edbb Version 3.3.2 2019-02-25 14:10:06 -05:00
Justin Burkett
d9122c48b2 Always check non-major-mode replacements in which-key--maybe-replace 2019-02-25 09:57:03 -05:00
Justin Burkett
3b184d6f0c Simplify finding and matching replacements
Don't try to grab all matching replacements ahead of time, because later ones
may not match if earlier ones make deletions.

Fixes #202
2019-02-24 22:57:31 -05:00