Revise debug/help keybindings & commands

This commit is contained in:
Henrik Lissner 2017-05-19 16:52:32 +02:00
parent d6220201d7
commit 254298b1b0
3 changed files with 18 additions and 17 deletions

View file

@ -18,16 +18,16 @@
(propertize "Faces:" 'face 'font-lock-comment-face)
(if faces (string-join faces ", ") "n/a"))))
;;;###autoload
(defun doom/what-col ()
(interactive)
(message "Column %d" (current-column)))
(defun doom-active-minor-modes ()
"Get a list of active minor-mode symbols."
(cl-remove-if (lambda (m) (and (boundp m) (symbol-value m)))
minor-mode-list))
;;;###autoload
(defun doom/what-bindings (key)
(interactive "k")
(message "minor-mode:\t%s\nlocal:\t\t%s\nglobal:\t\t%s"
(or (minor-mode-key-binding key) "n/a")
(or (local-key-binding key) "n/a")
(or (global-key-binding key) "n/a")))
(defun doom/what-minor-mode (mode)
"Get information on an active minor mode. Use `describe-minor-mode' for a
selection of all minor-modes, active or not."
(interactive
(list (completing-read "Minor mode: "
(doom-active-minor-modes))))
(describe-minor-mode-from-symbol (intern mode)))

View file

@ -314,10 +314,13 @@
:n "o" #'ace-link-help)
(:map help-map
"l" #'find-library
"L" #'view-lossage
"h" #'describe-face ; more useful than `view-hello-file'
"g" #'describe-char)) ; more useful than `describe-gnu-project'
:desc "Describe face" "h" #'describe-face ; overwrites `view-hello-file'
:desc "Face at point" "H" #'doom/what-face
:desc "Minor-mode" "M" #'doom/what-minor-mode
:desc "Command log" "W" #'global-command-log-mode
:desc "Find library" "l" #'find-library
:desc "View lossage" "L" #'view-lossage
:desc "Describe char" "g" #'describe-char)) ; overwrites `describe-gnu-project'
;;

View file

@ -7,8 +7,6 @@
;;; Custom commands
;; Emacs utilities
(ex! "bc[omp]" #'+hlissner:byte-compile)
(ex! "clog" #'global-command-log-mode)
(ex! "minor" #'describe-minor-mode) ; list minor modes
(ex! "re[load]" #'doom/reload)
(ex! "re[load]au" #'doom/reload-autoloads)