diff --git a/.github/README.md b/.github/README.md index 94e1e54..04733e8 100644 --- a/.github/README.md +++ b/.github/README.md @@ -159,7 +159,17 @@ Note that `god-mode-describe-key` is only able to interpret key-bindings that ar ## Visual indicators for God mode -You can change the cursor style to visually indicate whether God mode is active +God mode allows you to customize its minor mode lighter by customizing the `god-mode-lighter-string` variable and the `god-mode-lighter` face. +For example, if you don't want any lighter, you can set the string to nil. +On the other hand, if you want the lighter to stand out, you can change the face, e.g. by making it inherit from `error`. +You can do this using `M-x customize-face RET god-mode-lighter` or as follows: + +```emacs-lisp +(custom-set-faces + '(god-mode-lighter ((t (:inherit error))))) +``` + +Additionally, you can change the cursor style to visually indicate whether God mode is active as follows: ```emacs-lisp diff --git a/god-mode.el b/god-mode.el index 88629a8..2b54539 100644 --- a/god-mode.el +++ b/god-mode.el @@ -109,6 +109,18 @@ in God mode will be translated to `C-'." :group 'god :type 'boolean) +(defcustom god-mode-lighter-string + "God" + "String displayed on the mode line when God mode is active. +Set it to nil if you don't want a mode line indicator." + :group 'god + :type '(choice string (const :tag "None" nil))) + +(defface god-mode-lighter + '((t)) + "Face for God mode's lighter." + :group 'god) + (defun god-mode-make-f-key (n &optional shift) "Get the event for numbered function key N, with shift status SHIFT. For example, calling with arguments 5 and t yields the symbol `S-f5'." @@ -134,7 +146,9 @@ For example, calling with arguments 5 and t yields the symbol `S-f5'." (define-minor-mode god-local-mode "Minor mode for running commands." :init-value nil - :lighter " God" + :lighter (god-mode-lighter-string + ((" " + (:propertize god-mode-lighter-string face god-mode-lighter)))) :keymap god-local-mode-map (if god-local-mode (run-hooks 'god-mode-enabled-hook)