aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Burkett2016-10-29 08:34:42 -0400
committerJustin Burkett2016-10-29 08:35:54 -0400
commit5abc8cfd33f7ad03ceb3fe7b35fbcdc732c0193a (patch)
tree324f8c2b065987dd8cd870144401fa2859bf0667
parentc678b9370682c55e73b1157929e97edce44fe398 (diff)
downloademacs-5abc8cfd33f7ad03ceb3fe7b35fbcdc732c0193a.tar.gz
emacs-5abc8cfd33f7ad03ceb3fe7b35fbcdc732c0193a.zip
Add sort option -prefix-then-key-order-reverse
Fixes #145
-rw-r--r--which-key.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/which-key.el b/which-key.el
index c17a1c7a3eb..70372675ce9 100644
--- a/which-key.el
+++ b/which-key.el
@@ -1176,6 +1176,16 @@ coming before a prefix. Within these categories order using
1176 (and (not apref?) bpref?) 1176 (and (not apref?) bpref?)
1177 (which-key-key-order acons bcons)))) 1177 (which-key-key-order acons bcons))))
1178 1178
1179(defun which-key-prefix-then-key-order-reverse (acons bcons)
1180 "Order first by whether A and/or B is a prefix with prefix
1181coming before a prefix. Within these categories order using
1182`which-key-key-order'."
1183 (let ((apref? (which-key--group-p (cdr acons)))
1184 (bpref? (which-key--group-p (cdr bcons))))
1185 (if (not (eq apref? bpref?))
1186 (and apref? (not bpref?))
1187 (which-key-key-order acons bcons))))
1188
1179(defun which-key-local-then-key-order (acons bcons) 1189(defun which-key-local-then-key-order (acons bcons)
1180 "Order first by whether A and/or B is a local binding with 1190 "Order first by whether A and/or B is a local binding with
1181local bindings coming first. Within these categories order using 1191local bindings coming first. Within these categories order using