1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-28 19:00:42 -08:00

Fix mode line status

This commit is contained in:
justbur 2015-07-20 08:43:59 -04:00
parent 3b1ee3b204
commit 1a2ef54cc8

View file

@ -846,7 +846,7 @@ element in each list element of KEYS."
(list :pages (reverse pages) :page-height avl-lines
:page-widths (reverse page-widths)
:keys/page (reverse keys/page) :n-pages n-pages
:tot-keys (length keys))))
:tot-keys (cl-reduce '+ keys/page :initial-value 0))))
(defun which-key--create-pages (prefix-keys keys sel-win-width)
(let* ((max-dims (which-key--popup-max-dimensions sel-win-width))
@ -874,11 +874,13 @@ element in each list element of KEYS."
(if (and (> avl-lines 1) found) prev-result result)))))
(defun which-key--lighter-status (n-shown n-tot)
(setq which-key--lighter-backup (cdr (assq 'which-key-mode minor-mode-alist)))
(setcar (cdr (assq 'which-key-mode minor-mode-alist))
(format " WK: %s/%s keys" n-shown n-tot)))
(when which-key-show-remaining-keys
(setq which-key--lighter-backup (cdr (assq 'which-key-mode minor-mode-alist)))
(setcar (cdr (assq 'which-key-mode minor-mode-alist))
(format " WK: %s/%s keys" n-shown n-tot))))
(defun which-key--lighter-restore ()
(setcar (cdr (assq 'which-key-mode minor-mode-alist)) which-key--lighter-backup))
(when which-key-show-remaining-keys
(setcar (cdr (assq 'which-key-mode minor-mode-alist)) which-key--lighter-backup)))
(defun which-key--show-page (n &optional prefix-keys)
"Show page N, starting from 0.
@ -905,8 +907,7 @@ PREFIX-KEYS holds the description of the prefix keys."
(s-replace "\n" (concat "\n " spaces) page))))
((eq which-key-show-prefix 'top)
(setq page (concat prefix-w-face "-\n" page))))
(when which-key-show-remaining-keys
(which-key--lighter-status n-shown n-tot))
(which-key--lighter-status n-shown n-tot)
(if (eq which-key-popup-type 'minibuffer)
(let (message-log-max) (message "%s" page))
(with-current-buffer which-key--buffer