summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-03-12 17:22:32 -0600
committerCase Duckworth2021-03-12 17:22:32 -0600
commit32800720dddb0061cd8f4187091f29c6088e5415 (patch)
treec3f6c3207bcb89636ae6ba0028f212064311ae04 /lisp
parentConfigure `org-mode'. (diff)
downloademacs-32800720dddb0061cd8f4187091f29c6088e5415.tar.gz
emacs-32800720dddb0061cd8f4187091f29c6088e5415.zip
Move `acdw/modeline' functions into `acdw/pkg' forms
This change means I don't have to `require' libraries that haven't been
registered with `straight' yet.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw.el44
1 files changed, 0 insertions, 44 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index b1843c9..201db1f 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -21,9 +21,6 @@
21;; 21;;
22;;; Code: 22;;; Code:
23 23
24(require 'simple-modeline)
25(require 'minions)
26
27;;; Utilities 24;;; Utilities
28 25
29(defun acdw/when-unfocused (func &rest args) 26(defun acdw/when-unfocused (func &rest args)
@@ -54,47 +51,6 @@ Ready for use with `after-focus-change-function'."
54 (run-at-time sunset-time (* 60 60 24) sunset-command) 51 (run-at-time sunset-time (* 60 60 24) sunset-command)
55 (run-at-time "12:00am" (* 60 60 24) sunset-command))) 52 (run-at-time "12:00am" (* 60 60 24) sunset-command)))
56 53
57;;; Mode line segments (for `simple-modeline')
58(defun acdw/modeline-modified ()
59 "Displays a color-coded buffer modification/read-only indicator in the mode-line."
60 (if (not (string-match-p "\\*.*\\*" (buffer-name)))
61 (let* ((read-only (and buffer-read-only (buffer-file-name)))
62 (modified (buffer-modified-p)))
63 (propertize
64 (if read-only " ×" (if modified " ●" " ○"))
65 'face `(:inherit
66 ,(if modified 'simple-modeline-status-modified
67 (if read-only 'simple-modeline-status-error
68 'simple-modeline-unimportant)))
69 'help-echo (format
70 "Buffer is %s and %smodified\nmouse-1: Toggle read-only status."
71 (if read-only "read-only" "writable")
72 (if modified "" "not "))
73 'local-map (purecopy (simple-modeline-make-mouse-map
74 'mouse-1
75 (lambda (event)
76 (interactive "e")
77 (with-selected-window (posn-window (event-start event))
78 (read-only-mode 'toggle)))))
79 'mouse-face 'mode-line-highlight))))
80
81(defun acdw/modeline-minions ()
82 "Display a button for `minions-minor-modes-menu'."
83 (concat
84 " "
85 (propertize
86 "ⱷ"
87 'help-echo (format
88 "Minor modes menu\nmouse-1: show menu.")
89 'local-map (purecopy (simple-modeline-make-mouse-map
90 'mouse-1
91 (lambda (event)
92 (interactive "e")
93 (with-selected-window (posn-window (event-start
94 event))
95 (minions-minor-modes-menu)))))
96 'mouse-face 'mode-line-highlight)))
97
98;;; Directories (think `no-littering') 54;;; Directories (think `no-littering')
99 55
100(defvar acdw/dir (expand-file-name 56(defvar acdw/dir (expand-file-name