1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-01 11:20:41 -08:00

Satisfy compiler

This commit is contained in:
justbur 2015-11-16 20:13:58 -05:00
parent 7068ebd224
commit b0991a8a91

View file

@ -1240,7 +1240,7 @@ alists. Returns a list (key separator description)."
(describe-buffer-bindings buffer which-key--current-prefix))
(goto-char (point-min))
(let ((header-p (not (= (char-after) ?\f)))
sections header section)
bindings header)
(while (not (eobp))
(cond
(header-p
@ -1250,8 +1250,8 @@ alists. Returns a list (key separator description)."
(setq header-p nil)
(forward-line 3))
((= (char-after) ?\f)
;; (push (cons header (nreverse section)) sections)
(setq section nil)
;; (push (cons header (nreverse section)) bindings)
;; (setq section nil)
(setq header-p t))
((looking-at "^[ \t]*$")
;; ignore
@ -1275,20 +1275,18 @@ alists. Returns a list (key separator description)."
((string-match-p ignore-keys-regexp key))
((and which-key--current-prefix
(string-match (format "^%s[ \t]\\([^ \t]+\\)[ \t]+$" key-str-qt) key))
(unless (assoc-string (match-string 1 key) sections)
(push (cons (match-string 1 key) binding) sections)))
(unless (assoc-string (match-string 1 key) bindings)
(push (cons (match-string 1 key) binding) bindings)))
((string-match "^\\([^ \t]+\\|[^ \t]+ \\.\\. [^ \t]+\\)[ \t]+$" key)
(unless (assoc-string (match-string 1 key) sections)
(push (cons (match-string 1 key) binding) sections)))))))))
(unless (assoc-string (match-string 1 key) bindings)
(push (cons (match-string 1 key) binding) bindings)))))))))
(forward-line))
(nreverse sections)))))
(nreverse bindings)))))
(defun which-key--get-formatted-key-bindings ()
"Uses `describe-buffer-bindings' to collect the key bindings in
BUFFER that follow the key sequence KEY-SEQ."
(let* ((key-str-qt (regexp-quote (key-description which-key--current-prefix)))
(buffer (current-buffer))
(unformatted (which-key--get-current-bindings)))
(let* ((unformatted (which-key--get-current-bindings)))
(when which-key-sort-order
(setq unformatted
(sort unformatted (lambda (a b) (funcall which-key-sort-order a b)))))