Created
September 27, 2012 21:35
-
-
Save bjorne/3796607 to your computer and use it in GitHub Desktop.
Show free key bindings in Emacs (for the current mode)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq free-keys-modifiers (list "C" "M" "C-M")) | |
(setq free-keys-keys "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.,/§1234567890-=[];'\\`±!@#$%^&*()_+}{:\"|?><~") | |
(defun free-keys () | |
(interactive) | |
(let ((buf (get-buffer-create "*Free keys*"))) | |
(display-buffer buf) | |
(with-current-buffer buf | |
(erase-buffer) | |
(mapc (lambda (modifier) | |
(insert "\nFree keys with modifier " modifier "\n=========================\n") | |
(mapc (lambda (key) | |
(let* ((full-name | |
(concat modifier "-" (char-to-string key))) | |
(binding | |
(key-binding (read-kbd-macro full-name)))) | |
(when (not binding) | |
(insert | |
full-name | |
" maps to " | |
(symbol-name binding) | |
"\n")))) | |
free-keys-keys)) | |
free-keys-modifiers) | |
(setq buffer-read-only t) | |
(make-local-variable 'buffer-read-only) | |
(goto-char 0)))) | |
(provide 'free-keys) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sweeet! Add
C-c
andC-x
to modifier keys. Also, make sureq
kills the free keys buffer.