emacs-use-package-add-which-to-bind-key.patch 1.1 KB

12345678910111213141516171819202122232425262728
  1. Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
  2. This patch adds a support for :which key.
  3. *** a/bind-key.el 1970-01-01 03:00:01.000000000 +0300
  4. --- b/bind-key.el 2018-02-11 00:23:34.858160456 +0300
  5. ***************
  6. *** 217,222 ****
  7. --- 217,223 ----
  8. (filter (plist-get args :filter))
  9. (menu-name (plist-get args :menu-name))
  10. (pkg (plist-get args :package))
  11. + (which (plist-get args :which))
  12. (key-bindings (progn
  13. (while (keywordp (car args))
  14. (pop args)
  15. ***************
  16. *** 254,259 ****
  17. --- 255,262 ----
  18. ,@(if menu-name
  19. `((define-prefix-command ',prefix-map nil ,menu-name))
  20. `((define-prefix-command ',prefix-map)))
  21. + ,@(if which
  22. + `((which-key-add-key-based-replacements ,prefix ',which)))
  23. ,@(if (and map (not (eq map 'global-map)))
  24. (wrap map `((bind-key ,prefix ',prefix-map ,map ,filter)))
  25. `((bind-key ,prefix ',prefix-map nil ,filter)))))