From 254298b1b040d19ec39a26c051c7b5b7e95cbd93 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 19 May 2017 16:52:32 +0200 Subject: [PATCH] Revise debug/help keybindings & commands --- core/autoload/debug.el | 22 +++++++++++----------- modules/private/hlissner/+bindings.el | 11 +++++++---- modules/private/hlissner/+commands.el | 2 -- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/core/autoload/debug.el b/core/autoload/debug.el index a147ca582..dc440aedc 100644 --- a/core/autoload/debug.el +++ b/core/autoload/debug.el @@ -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))) diff --git a/modules/private/hlissner/+bindings.el b/modules/private/hlissner/+bindings.el index c9e14aab5..21a182396 100644 --- a/modules/private/hlissner/+bindings.el +++ b/modules/private/hlissner/+bindings.el @@ -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' ;; diff --git a/modules/private/hlissner/+commands.el b/modules/private/hlissner/+commands.el index 004a2eab3..4e6ba5bea 100644 --- a/modules/private/hlissner/+commands.el +++ b/modules/private/hlissner/+commands.el @@ -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)