branch: externals/which-key commit 27d9fec33abb989b030f7677ccf5f799287d6472 Author: Justin Burkett <jus...@burkett.cc> Commit: Justin Burkett <jus...@burkett.cc>
Fix compiler warnings Fixes #312 --- which-key.el | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/which-key.el b/which-key.el index 1213d14..ff0db27 100644 --- a/which-key.el +++ b/which-key.el @@ -717,9 +717,20 @@ update.") (goto-char (point-max)) (insert "\n" fmt-msg "\n"))))) +(defsubst which-key--safe-lookup-key (keymap key) + "Version of `lookup-key' that allows KEYMAP to be nil. +Also convert numeric results of `lookup-key' to nil. KEY is not +checked." + (when (keymapp keymap) + (let ((result (lookup-key keymap key))) + (when (and result (not (numberp result))) + result)))) + ;;; Third-party library support ;;;; Evil +(defvar evil-state nil) + (defcustom which-key-allow-evil-operators (boundp 'evil-this-operator) "Allow popup to show for evil operators. The popup is normally inhibited in the middle of commands, but @@ -1440,15 +1451,6 @@ local bindings coming first. Within these categories order using "If MAYBE-STRING is a string use `which-key--string-width' o/w return 0." (if (stringp maybe-string) (string-width maybe-string) 0)) -(defsubst which-key--safe-lookup-key (keymap key) - "Version of `lookup-key' that allows KEYMAP to be nil. -Also convert numeric results of `lookup-key' to nil. KEY is not -checked." - (when (keymapp keymap) - (let ((result (lookup-key keymap key))) - (when (and result (not (numberp result))) - result)))) - (defsubst which-key--butlast-string (str) (mapconcat #'identity (butlast (split-string str)) " ")) @@ -1702,7 +1704,7 @@ return the docstring." (t (format "%s %s" current docstring))))) -(defun which-key--format-and-replace (unformatted &optional prefix preserve-full-key) +(defun which-key--format-and-replace (unformatted &optional preserve-full-key) "Take a list of (key . desc) cons cells in UNFORMATTED, add faces and perform replacements according to the three replacement alists. Returns a list (key separator description)." @@ -1851,7 +1853,7 @@ non-nil, then bindings are collected recursively for all prefixes." (when which-key-sort-order (setq unformatted (sort unformatted which-key-sort-order))) - (which-key--format-and-replace unformatted prefix recursive))) + (which-key--format-and-replace unformatted recursive))) ;;; Functions for laying out which-key buffer pages