about summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2022-01-06 22:54:56 -0600
committerCase Duckworth2022-01-06 22:54:56 -0600
commit9b9d026b613fd90230f0bdde9f87b2142d9bfc53 (patch)
tree7b0d48cca8a63b1ce73c81c90b89807aacc554ce /lisp
parentMerge branch 'main' of https://tildegit.org/acdw/emacs (diff)
downloademacs-9b9d026b613fd90230f0bdde9f87b2142d9bfc53.tar.gz
emacs-9b9d026b613fd90230f0bdde9f87b2142d9bfc53.zip
Add god-mode
I'm trying this out ... again
Diffstat (limited to 'lisp')
-rw-r--r--lisp/+god-mode.el17
-rw-r--r--lisp/+modeline.el18
2 files changed, 35 insertions, 0 deletions
diff --git a/lisp/+god-mode.el b/lisp/+god-mode.el new file mode 100644 index 0000000..f70e76b --- /dev/null +++ b/lisp/+god-mode.el
@@ -0,0 +1,17 @@
1;;; +god-mode.el -*- lexical-binding: t; -*-
2
3;;; Code:
4
5(defun +god-mode-insert ()
6 "Leave `god-local-mode' at point."
7 (interactive)
8 (god-local-mode -1))
9
10(defun +god-mode-append ()
11 "Leave `god-local-mode' after point."
12 (interactive)
13 (forward-char 1)
14 (god-local-mode -1))
15
16(provide '+god-mode)
17;;; +god-mode.el ends here
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."
240 (concat (or spacer +modeline-default-spacer) 240 (concat (or spacer +modeline-default-spacer)
241 (window-parameter (selected-window) 'ace-window-path)))) 241 (window-parameter (selected-window) 'ace-window-path))))
242 242
243(defun +modeline-god-mode (&optional spacer)
244 "Display an icon when `god-mode' is active."
245 (when (and (boundp 'god-local-mode) god-local-mode)
246 (concat (or spacer +modeline-default-spacer)
247 (propertize "Ω"
248 'help-echo (concat "God mode is active."
249 "\nmouse-1: exit God mode.")
250 'local-map (purecopy
251 (simple-modeline-make-mouse-map
252 'mouse-1 (lambda (e)
253 (interactive "e")
254 (with-selected-window
255 (posn-window
256 (event-start ev))
257 (god-local-mode -1)
258 (force-mode-line-update)))))
259 'mouse-face 'mode-line-highlight))))
260
243(provide '+modeline) 261(provide '+modeline)
244;;; +modeline.el ends here 262;;; +modeline.el ends here