From 9b9d026b613fd90230f0bdde9f87b2142d9bfc53 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 6 Jan 2022 22:54:56 -0600 Subject: Add god-mode I'm trying this out ... again --- lisp/+modeline.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lisp/+modeline.el') diff --git a/lisp/+modeline.el b/lisp/+modeline.el index 4063d83..a0195f1 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el @@ -240,5 +240,23 @@ The order of elements matters: whichever one matches first is applied." (concat (or spacer +modeline-default-spacer) (window-parameter (selected-window) 'ace-window-path)))) +(defun +modeline-god-mode (&optional spacer) + "Display an icon when `god-mode' is active." + (when (and (boundp 'god-local-mode) god-local-mode) + (concat (or spacer +modeline-default-spacer) + (propertize "Ω" + 'help-echo (concat "God mode is active." + "\nmouse-1: exit God mode.") + 'local-map (purecopy + (simple-modeline-make-mouse-map + 'mouse-1 (lambda (e) + (interactive "e") + (with-selected-window + (posn-window + (event-start ev)) + (god-local-mode -1) + (force-mode-line-update))))) + 'mouse-face 'mode-line-highlight)))) + (provide '+modeline) ;;; +modeline.el ends here -- cgit 1.4.1-21-gabe81