1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-02 11:50:48 -08:00

Fix potential bug when no keys exist

Need to check for no keys before checking the number of keys on the
first page in case the latter is nil
This commit is contained in:
justbur 2015-07-17 10:59:13 -04:00
parent 4717c88680
commit 23600ce6e1

View file

@ -894,15 +894,15 @@ value of `which-key-show-prefix'. SEL-WIN-WIDTH is passed to
pages (reverse pages)
first-page (car pages)
first-page-str (concat prefix-string (car first-page)))
(cond ((<= (car keys-per-page) 0) ; check first page
(message "%s- which-key can't show keys: Settings and/or frame size are too restrictive." prefix-keys)
(cons 0 0))
(max-pages-reached
(cond (max-pages-reached
(error "Which-key reached the maximum number of pages")
(cons 0 0))
((<= (length formatted-keys) 0)
(message "%s- which-key: no keys to display" prefix-keys)
(cons 0 0))
((<= (car keys-per-page) 0) ; check first page
(message "%s- which-key can't show keys: Settings and/or frame size are too restrictive." prefix-keys)
(cons 0 0))
(t
(if (eq which-key-popup-type 'minibuffer)
(let (message-log-max) (message "%s" first-page-str))