aboutsummaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/init.el b/init.el
index b2b0bf8..5f5fdfb 100644
--- a/init.el
+++ b/init.el
@@ -1001,6 +1001,25 @@
1001;; minibuffer or a popup window. 1001;; minibuffer or a popup window.
1002;; --------------------------------- 1002;; ---------------------------------
1003 1003
1004;; Define function and keybind to list all bindings of a certain key
1005(defun mm/print-all-bindings-for-key (key)
1006 "Output all bindings for KEY in *MESSAGES*."
1007 (interactive "kEnter key sequence: ")
1008 (mapc (lambda (pair)
1009 (when (cdr pair)
1010 (message "%S: %S" (car pair) (cdr pair))))
1011 (mapcar (lambda (keymap)
1012 (cons keymap
1013 (let ((binding (lookup-key (eval keymap) key)))
1014 (and (not (numberp binding)) binding))))
1015 (let (atoms)
1016 (mapatoms (lambda (a)
1017 (when (keymapp (and (boundp a) (eval a)))
1018 (push a atoms))))
1019 atoms))))
1020(global-set-key (kbd "C-h C-u k") 'mm/print-all-bindings-for-key)
1021
1022
1004;; Define fixed version of `keyboard-escape-quit' which does not close 1023;; Define fixed version of `keyboard-escape-quit' which does not close
1005;; windows or change their layout. 1024;; windows or change their layout.
1006(defun mm/keyboard-escape-quit-keep-windows () 1025(defun mm/keyboard-escape-quit-keep-windows ()