about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--early-init.el15
-rw-r--r--init.el78
-rw-r--r--lisp/+casing.el47
-rw-r--r--lisp/+emacs.el69
-rw-r--r--lisp/+lookup.el16
-rw-r--r--lisp/acdw.el8
6 files changed, 127 insertions, 106 deletions
diff --git a/early-init.el b/early-init.el index 17b3844..805bd61 100644 --- a/early-init.el +++ b/early-init.el
@@ -21,13 +21,16 @@
21 21
22;;; Code: 22;;; Code:
23 23
24(define-advice load (:before (feature &rest _)) 24;;(setq debug-on-error t)
25 "Message the user when loading a library." 25(message "Loading early-init.el...")
26 (with-temp-message (format "Now loading: '%s'" feature))) 26
27;; (define-advice load (:before (feature &rest _))
28;; "Message the user when loading a library."
29;; (with-temp-message (format "Now loading: '%s'" feature)))
27 30
28;;; Speed up init 31;;; Speed up init
29 32
30(setq gc-cons-threshold most-positive-fixnum) 33;; (setq gc-cons-threshold most-positive-fixnum)
31 34
32(add-hook 'emacs-startup-hook 35(add-hook 'emacs-startup-hook
33 (defun emacs-startup@restore-values () 36 (defun emacs-startup@restore-values ()
@@ -41,8 +44,6 @@
41;;; Set up extra load paths and functionality 44;;; Set up extra load paths and functionality
42 45
43(push (locate-user-emacs-file "lisp") load-path) 46(push (locate-user-emacs-file "lisp") load-path)
44(add-to-list 'load-path (locate-user-emacs-file "lisp/compat") :append)
45
46(require 'acdw) 47(require 'acdw)
47 48
48(+define-dir .etc (locate-user-emacs-file ".etc") 49(+define-dir .etc (locate-user-emacs-file ".etc")
@@ -159,5 +160,7 @@ See `no-littering' for examples.")
159;; is `straight-package-neutering-mode'. 160;; is `straight-package-neutering-mode'.
160(defalias 'straight-ಠ_ಠ-mode nil) 161(defalias 'straight-ಠ_ಠ-mode nil)
161 162
163(message "Loading early-init.el...Done.")
164
162(provide 'early-init) 165(provide 'early-init)
163;;; early-init.el ends here 166;;; early-init.el ends here
diff --git a/init.el b/init.el index 51bcf31..526c867 100644 --- a/init.el +++ b/init.el
@@ -15,17 +15,13 @@
15;; - Make good choices. 15;; - Make good choices.
16 16
17;;; Code: 17;;; Code:
18 18(let ((early-features `((early-init . ,(locate-user-emacs-file "early-init"))
19(dolist (feature `((early-init . ,(locate-user-emacs-file "early-init")) 19 acdw private +key)))
20 acdw 20 (dolist (feature early-features)
21 private)) 21 (require (or (car-safe feature) feature) (cdr-safe feature) :noerror)))
22 (require (or (car-safe feature) feature) (cdr-safe feature) :noerror))
23 22
24(setup (:require +casing) 23(setup (:require +casing)
25 (:+key "M-c" +casing-map) 24 (+casing-mode +1))
26 ;; Unbind default casing bindings
27 (:global "M-u" nil "M-c" nil "M-l" nil
28 "C-x C-u" nil "C-x C-l" nil))
29 25
30(setup (:require +emacs) 26(setup (:require +emacs)
31 ;; +emacs.el contains super-basic defaults that are basically necessary for 27 ;; +emacs.el contains super-basic defaults that are basically necessary for
@@ -37,11 +33,8 @@
37 (:global "C-x C-k" #'kill-current-buffer 33 (:global "C-x C-k" #'kill-current-buffer
38 "C-x 4 n" #'clone-buffer 34 "C-x 4 n" #'clone-buffer
39 "C-c v" #'visible-mode 35 "C-c v" #'visible-mode
40 "C-M-;" #'+lisp-comment-or-uncomment-sexp) 36 "C-M-;" #'+lisp-comment-or-uncomment-sexp
41 ;; Unbind stuff, too. 37 "M-j" nil)
42 (dolist (key '("C-M-j"
43 "M-j"))
44 (global-set-key (kbd key) nil))
45 ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults 38 ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults
46 (global-set-key (kbd "C-h") 'delete-backward-char) 39 (global-set-key (kbd "C-h") 'delete-backward-char)
47 (keyboard-translate ?\C-h ?\C-?) 40 (keyboard-translate ?\C-h ?\C-?)
@@ -55,15 +48,28 @@
55 (:bind "C-c s" #'+init-sort-then-save) 48 (:bind "C-c s" #'+init-sort-then-save)
56 (:hook #'+init-add-setup-to-imenu)) 49 (:hook #'+init-add-setup-to-imenu))
57 50
58(setup (:require +key)
59 (+ensure-after-init #'+key-global-mode))
60
61(setup (:require +lookup) 51(setup (:require +lookup)
62 (:+key "C-c l" +lookup-map)) 52 (+lookup-mode +1))
63 53
64(setup (:require auth-source) 54(setup (:require auth-source)
65 (:option auth-sources (list (private/ "authinfo")))) 55 (:option auth-sources (list (private/ "authinfo"))))
66 56
57(setup (:require auto-insert)
58 (setf (alist-get '("lisp/.*\\.el\\'" . "+Emacs lisp")
59 auto-insert-alist nil nil #'equal)
60 `(nil ";;; " (file-name-nondirectory (buffer-file-name))
61 (make-string (max 2 (- fill-column (current-column) 27)) 32)
62 "-*- lexical-binding: t; -*-" '(setq lexical-binding t)
63 ,(concat "\n\n;;; Commentary:"
64 "\n\n;; ") _
65 ,(concat "\n\n;;; Code:"
66 "\n\n"
67 "\n\n(provide '")
68 (file-name-base (buffer-file-name))
69 ,(concat ")" "\n;;; ")
70 (file-name-nondirectory (buffer-file-name)) " ends here\n"))
71 (auto-insert-mode +1))
72
67(setup (:require cus-edit) 73(setup (:require cus-edit)
68 ;; I don't use Custom to actually /make/ any customizations, but it's handy to 74 ;; I don't use Custom to actually /make/ any customizations, but it's handy to
69 ;; (A) see what options are available and (B) persist some changes across 75 ;; (A) see what options are available and (B) persist some changes across
@@ -98,28 +104,15 @@
98(setup (:require reading) 104(setup (:require reading)
99 (:global "C-c C-r" #'reading-mode)) 105 (:global "C-c C-r" #'reading-mode))
100 106
107(setup +key
108 (+ensure-after-init #'+key-global-mode))
109
101(setup abbrev 110(setup abbrev
102 (:option abbrev-file-name (sync/ "abbrev.el") 111 (:option abbrev-file-name (sync/ "abbrev.el")
103 save-abbrevs 'silent) 112 save-abbrevs 'silent)
104 (:hook-into text-mode 113 (:hook-into text-mode
105 circe-chat-mode)) 114 circe-chat-mode))
106 115
107(setup auto-insert
108 (setf (alist-get '("lisp/.*\\.el\\'" . "+Emacs lisp")
109 auto-insert-alist nil nil #'equal)
110 `(nil ";;; " (file-name-nondirectory (buffer-file-name))
111 (make-string (max 2 (- fill-column (current-column) 27)) 32)
112 "-*- lexical-binding: t; -*-" '(setq lexical-binding t)
113 ,(concat "\n\n;;; Commentary:"
114 "\n\n;; ") _
115 ,(concat "\n\n;;; Code:"
116 "\n\n"
117 "\n\n(provide '")
118 (file-name-base (buffer-file-name))
119 ,(concat ")" "\n;;; ")
120 (file-name-nondirectory (buffer-file-name)) " ends here\n"))
121 (auto-insert-mode +1))
122
123(setup autorevert 116(setup autorevert
124 (:option global-auto-revert-non-file-buffers t 117 (:option global-auto-revert-non-file-buffers t
125 auto-revert-verbose nil) 118 auto-revert-verbose nil)
@@ -303,6 +296,9 @@
303 "M-n" nil 296 "M-n" nil
304 "M-p" nil)) 297 "M-p" nil))
305 298
299(setup flyspell
300 (:hook-into org-mode))
301
306(setup hideshow 302(setup hideshow
307 (:also-load +hideshow) 303 (:also-load +hideshow)
308 (:with-mode hs-minor-mode 304 (:with-mode hs-minor-mode
@@ -558,7 +554,7 @@
558 [remap isearch-query-replace-regexp] #'anzu-isearch-query-replace-regexp)) 554 [remap isearch-query-replace-regexp] #'anzu-isearch-query-replace-regexp))
559 555
560(setup (:straight avy) 556(setup (:straight avy)
561 (:also-load +avy) 557 (:require avy +avy)
562 (:+key "M-j" #'avy-goto-char-timer) 558 (:+key "M-j" #'avy-goto-char-timer)
563 (:bind-into isearch 559 (:bind-into isearch
564 "M-j" #'avy-isearch) 560 "M-j" #'avy-isearch)
@@ -780,7 +776,7 @@
780 ("M-s u" . consult-focus-lines) 776 ("M-s u" . consult-focus-lines)
781 ;; Isearch integration 777 ;; Isearch integration
782 ("M-s e" . consult-isearch-history))) 778 ("M-s e" . consult-isearch-history)))
783 (define-key +key-mode-map (kbd (car binding)) (cdr binding))) 779 (global-set-key (kbd (car binding)) (cdr binding)))
784 (with-eval-after-load 'isearch-mode 780 (with-eval-after-load 'isearch-mode
785 (dolist (binding '(("M-e" . consult-isearch-history) 781 (dolist (binding '(("M-e" . consult-isearch-history)
786 ("M-s e" . consult-isearch-history) 782 ("M-s e" . consult-isearch-history)
@@ -813,7 +809,8 @@
813(setup (:straight crux) 809(setup (:straight crux)
814 ;; yes it's silly I have an addon to this addon. 810 ;; yes it's silly I have an addon to this addon.
815 (:also-load +crux) 811 (:also-load +crux)
816 (:option crux-shell-func #'crux-eshell) 812 (:option crux-shell-func #'crux-eshell
813 +crux-default-date-format "%F")
817 (:global "C-o" #'crux-smart-open-line 814 (:global "C-o" #'crux-smart-open-line
818 "C-x 4 t" #'crux-transpose-windows 815 "C-x 4 t" #'crux-transpose-windows
819 "M-w" #'+crux-kill-ring-save 816 "M-w" #'+crux-kill-ring-save
@@ -844,7 +841,7 @@ See also `crux-reopen-as-root-mode'."
844 (autoload 'dictionary-search "dictionary" 841 (autoload 'dictionary-search "dictionary"
845 "Ask for a word and search it in all dictionaries" t) 842 "Ask for a word and search it in all dictionaries" t)
846 (:hook #'reading-mode) 843 (:hook #'reading-mode)
847 (define-key +lookup-map "d" #'dictionary-search)) 844 (define-key +lookup-mode-map "d" #'dictionary-search))
848 845
849(setup (:straight (discord 846(setup (:straight (discord
850 :host github 847 :host github
@@ -949,6 +946,11 @@ See also `crux-reopen-as-root-mode'."
949 :repo "duckwork/filldent.el")) 946 :repo "duckwork/filldent.el"))
950 (:+key "M-q" #'filldent-dwim)) 947 (:+key "M-q" #'filldent-dwim))
951 948
949(setup (:straight flyspell-correct)
950 (:option flyspell-correct--cr-key ";")
951 (:bind-into flyspell
952 "C-;" #'flyspell-correct-wrapper))
953
952(setup (:straight-when (forge 954(setup (:straight-when (forge
953 :host github :repo "magit/forge") 955 :host github :repo "magit/forge")
954 (eq system-system 'linux)) 956 (eq system-system 'linux))
diff --git a/lisp/+casing.el b/lisp/+casing.el index fe97310..a21e710 100644 --- a/lisp/+casing.el +++ b/lisp/+casing.el
@@ -3,17 +3,7 @@
3;;; Code: 3;;; Code:
4 4
5(require 'thingatpt) 5(require 'thingatpt)
6 6(require '+key)
7(defvar +casing-map (make-sparse-keymap)
8 "Keymap for word-casing.")
9
10(let ((map +casing-map))
11 (define-key map "u" #'+upcase-dwim)
12 (define-key map (kbd "M-u") #'+upcase-dwim)
13 (define-key map "l" #'+downcase-dwim)
14 (define-key map (kbd "M-l") #'+downcase-dwim)
15 (define-key map "c" #'+capitalize-dwim)
16 (define-key map (kbd "M-c") #'+capitalize-dwim))
17 7
18;;;###autoload 8;;;###autoload
19(defun +upcase-dwim (arg) 9(defun +upcase-dwim (arg)
@@ -28,9 +18,10 @@ Otherwise, it calls `upcase-word' on the word at point (using
28 (word-bound (save-excursion 18 (word-bound (save-excursion
29 (skip-chars-forward "^[:word:]") 19 (skip-chars-forward "^[:word:]")
30 (bounds-of-thing-at-point 'word)))) 20 (bounds-of-thing-at-point 'word))))
31 (upcase-region (car word-bound) (cdr word-bound)) 21 (when (and (car word-bound) (cdr word-bound))
32 (goto-char (cdr word-bound)) 22 (upcase-region (car word-bound) (cdr word-bound))
33 (upcase-word following)))) 23 (goto-char (cdr word-bound))
24 (upcase-word following)))))
34 25
35;;;###autoload 26;;;###autoload
36(defun +downcase-dwim (arg) 27(defun +downcase-dwim (arg)
@@ -45,9 +36,10 @@ Otherwise, it calls `downcase-word' on the word at point (using
45 (word-bound (save-excursion 36 (word-bound (save-excursion
46 (skip-chars-forward "^[:word:]") 37 (skip-chars-forward "^[:word:]")
47 (bounds-of-thing-at-point 'word)))) 38 (bounds-of-thing-at-point 'word))))
48 (downcase-region (car word-bound) (cdr word-bound)) 39 (when (and (car word-bound) (cdr word-bound))
49 (goto-char (cdr word-bound)) 40 (downcase-region (car word-bound) (cdr word-bound))
50 (downcase-word following)))) 41 (goto-char (cdr word-bound))
42 (downcase-word following)))))
51 43
52;;;###autoload 44;;;###autoload
53(defun +capitalize-dwim (arg) 45(defun +capitalize-dwim (arg)
@@ -62,11 +54,26 @@ Otherwise, it calls `capitalize-word' on the word at point (using
62 (word-bound (save-excursion 54 (word-bound (save-excursion
63 (skip-chars-forward "^[:word:]") 55 (skip-chars-forward "^[:word:]")
64 (bounds-of-thing-at-point 'word)))) 56 (bounds-of-thing-at-point 'word))))
65 (capitalize-region (car word-bound) (cdr word-bound)) 57 (when (and (car word-bound) (cdr word-bound))
66 (goto-char (cdr word-bound)) 58 (capitalize-region (car word-bound) (cdr word-bound))
67 (capitalize-word following)))) 59 (goto-char (cdr word-bound))
60 (capitalize-word following)))))
68 61
69;; Later on, I'll add repeat maps and stuff in here... 62;; Later on, I'll add repeat maps and stuff in here...
70 63
64(define-minor-mode +casing-mode
65 "Enable easy case-twiddling commands."
66 :lighter " cC"
67 :keymap (let ((map (make-sparse-keymap)))
68 (define-key map "u" #'+upcase-dwim)
69 (define-key map (kbd "M-u") #'+upcase-dwim)
70 (define-key map "l" #'+downcase-dwim)
71 (define-key map (kbd "M-l") #'+downcase-dwim)
72 (define-key map "c" #'+capitalize-dwim)
73 (define-key map (kbd "M-c") #'+capitalize-dwim)
74 map)
75 (define-key +key-mode-map (kbd "M-c") (when +casing-mode
76 +casing-mode-map)))
77
71(provide '+casing) 78(provide '+casing)
72;;; +casing.el ends here 79;;; +casing.el ends here
diff --git a/lisp/+emacs.el b/lisp/+emacs.el index 2e3d257..7453913 100644 --- a/lisp/+emacs.el +++ b/lisp/+emacs.el
@@ -80,8 +80,8 @@ Do this only if the buffer is not visiting a file."
80 mark-ring-max 50 80 mark-ring-max 50
81 minibuffer-eldef-shorten-default t 81 minibuffer-eldef-shorten-default t
82 minibuffer-prompt-properties (list 'read-only t 82 minibuffer-prompt-properties (list 'read-only t
83 'cursor-intangible t 83 'cursor-intangible t
84 'face 'minibuffer-prompt) 84 'face 'minibuffer-prompt)
85 mode-require-final-newline 'visit-save 85 mode-require-final-newline 'visit-save
86 mouse-drag-copy-region t 86 mouse-drag-copy-region t
87 mouse-wheel-progressive-speed nil 87 mouse-wheel-progressive-speed nil
@@ -90,8 +90,8 @@ Do this only if the buffer is not visiting a file."
90 read-answer-short t 90 read-answer-short t
91 read-buffer-completion-ignore-case t 91 read-buffer-completion-ignore-case t
92 read-extended-command-predicate (when (fboundp 92 read-extended-command-predicate (when (fboundp
93 'command-completion-default-include-p) 93 'command-completion-default-include-p)
94 'command-completion-default-include-p) 94 'command-completion-default-include-p)
95 recenter-positions '(top middle bottom) 95 recenter-positions '(top middle bottom)
96 regexp-search-ring-max 100 96 regexp-search-ring-max 100
97 regexp-search-ring-max 200 97 regexp-search-ring-max 200
@@ -169,23 +169,23 @@ Do this only if the buffer is not visiting a file."
169;;; Modes 169;;; Modes
170 170
171(dolist (enable-mode '(global-auto-revert-mode 171(dolist (enable-mode '(global-auto-revert-mode
172 blink-cursor-mode 172 blink-cursor-mode
173 electric-pair-mode 173 electric-pair-mode
174 show-paren-mode 174 show-paren-mode
175 global-so-long-mode 175 global-so-long-mode
176 minibuffer-depth-indicate-mode 176 minibuffer-depth-indicate-mode
177 file-name-shadow-mode 177 file-name-shadow-mode
178 minibuffer-electric-default-mode 178 minibuffer-electric-default-mode
179 delete-selection-mode 179 delete-selection-mode
180 column-number-mode)) 180 column-number-mode))
181 (when (fboundp enable-mode) 181 (when (fboundp enable-mode)
182 (funcall enable-mode +1))) 182 (funcall enable-mode +1)))
183 183
184(dolist (disable-mode '(tooltip-mode 184(dolist (disable-mode '(tooltip-mode
185 tool-bar-mode 185 tool-bar-mode
186 menu-bar-mode 186 menu-bar-mode
187 scroll-bar-mode 187 scroll-bar-mode
188 horizontal-scroll-bar-mode)) 188 horizontal-scroll-bar-mode))
189 (when (fboundp disable-mode) 189 (when (fboundp disable-mode)
190 (funcall disable-mode -1))) 190 (funcall disable-mode -1)))
191 191
@@ -243,19 +243,16 @@ kill without asking."
243 ("C-s" . isearch-forward-regexp) 243 ("C-s" . isearch-forward-regexp)
244 ("C-r" . isearch-backward-regexp) 244 ("C-r" . isearch-backward-regexp)
245 ("C-M-s" . isearch-forward) 245 ("C-M-s" . isearch-forward)
246 ("C-M-r" . isearch-backward) 246 ("C-M-r" . isearch-backward)))
247 ("M-u" . upcase-dwim)
248 ("M-l" . downcase-dwim)
249 ("M-c" . capitalize-dwim)))
250 (define-key +key-mode-map (kbd (car binding)) (cdr binding))) 247 (define-key +key-mode-map (kbd (car binding)) (cdr binding)))
251 248
252;;; Required libraries 249;;; Required libraries
253 250
254(when (require 'uniquify nil :noerror) 251(when (require 'uniquify nil :noerror)
255 (setq-default uniquify-buffer-name-style 'forward 252 (setq-default uniquify-buffer-name-style 'forward
256 uniquify-separator path-separator 253 uniquify-separator path-separator
257 uniquify-after-kill-buffer-p t 254 uniquify-after-kill-buffer-p t
258 uniquify-ignore-buffers-re "^\\*")) 255 uniquify-ignore-buffers-re "^\\*"))
259 256
260(when (require 'goto-addr) 257(when (require 'goto-addr)
261 (if (fboundp 'global-goto-address-mode) 258 (if (fboundp 'global-goto-address-mode)
@@ -264,36 +261,36 @@ kill without asking."
264 261
265(when (require 'recentf nil :noerror) 262(when (require 'recentf nil :noerror)
266 (setq-default recentf-save-file (.etc "recentf.el") 263 (setq-default recentf-save-file (.etc "recentf.el")
267 recentf-max-menu-items 100 264 recentf-max-menu-items 100
268 recentf-max-saved-items nil 265 recentf-max-saved-items nil
269 recentf-auto-cleanup 'mode) 266 recentf-auto-cleanup 'mode)
270 (add-to-list 'recentf-exclude .etc) 267 (add-to-list 'recentf-exclude .etc)
271 (recentf-mode +1)) 268 (recentf-mode +1))
272 269
273(when (require 'repeat nil :noerror) 270(when (require 'repeat nil :noerror)
274 (setq-default repeat-exit-key "g" 271 (setq-default repeat-exit-key "g"
275 repeat-exit-timeout 5) 272 repeat-exit-timeout 5)
276 (when (fboundp 'repeat-mode) 273 (when (fboundp 'repeat-mode)
277 ;; `repeat-mode' is defined in repeat.el, which is an older library. 274 ;; `repeat-mode' is defined in repeat.el, which is an older library.
278 (repeat-mode +1))) 275 (repeat-mode +1)))
279 276
280(when (require 'savehist nil :noerror) 277(when (require 'savehist nil :noerror)
281 (setq-default history-length t 278 (setq-default history-length t
282 history-delete-duplicates t 279 history-delete-duplicates t
283 history-autosave-interval 60 280 history-autosave-interval 60
284 savehist-file (.etc "savehist.el")) 281 savehist-file (.etc "savehist.el"))
285 (dolist (var '(extended-command-history 282 (dolist (var '(extended-command-history
286 global-mark-ring 283 global-mark-ring
287 kill-ring 284 kill-ring
288 regexp-search-ring 285 regexp-search-ring
289 search-ring 286 search-ring
290 mark-ring)) 287 mark-ring))
291 (add-to-list 'savehist-additional-variables var)) 288 (add-to-list 'savehist-additional-variables var))
292 (savehist-mode +1)) 289 (savehist-mode +1))
293 290
294(when (require 'saveplace nil :noerror) 291(when (require 'saveplace nil :noerror)
295 (setq-default save-place-file (.etc "places.el") 292 (setq-default save-place-file (.etc "places.el")
296 save-place-forget-unreadable-files (eq system-type 'gnu/linux)) 293 save-place-forget-unreadable-files (eq system-type 'gnu/linux))
297 (save-place-mode +1)) 294 (save-place-mode +1))
298 295
299;; (when (require 'tramp) 296;; (when (require 'tramp)
diff --git a/lisp/+lookup.el b/lisp/+lookup.el index dfa0180..f13f535 100644 --- a/lisp/+lookup.el +++ b/lisp/+lookup.el
@@ -7,11 +7,17 @@
7 7
8;;; Code: 8;;; Code:
9 9
10(defvar +lookup-map (let ((map (make-sparse-keymap))) 10(require '+key)
11 (define-key map "f" #'find-function) 11
12 (define-key map "l" #'find-library) 12(define-minor-mode +lookup-mode
13 map) 13 "A mode for easily looking things up."
14 "Keymap for looking up things.") 14 :lighter " l^"
15 :keymap (let ((map (make-sparse-keymap)))
16 (define-key map "f" #'find-function)
17 (define-key map "l" #'find-library)
18 map)
19 (define-key +key-mode-map (kbd "C-c l") (when +lookup-mode
20 +lookup-mode-map)))
15 21
16(provide '+lookup) 22(provide '+lookup)
17;;; +lookup.el ends here 23;;; +lookup.el ends here
diff --git a/lisp/acdw.el b/lisp/acdw.el index a6fddfe..fcab61b 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -19,6 +19,8 @@
19 19
20;;; Code: 20;;; Code:
21 21
22(require 'diary-lib)
23
22;;; Define a directory and an expanding function 24;;; Define a directory and an expanding function
23 25
24(defmacro +define-dir (name directory &optional docstring inhibit-mkdir) 26(defmacro +define-dir (name directory &optional docstring inhibit-mkdir)
@@ -94,7 +96,11 @@ itself."
94 ;; sunset-command. 96 ;; sunset-command.
95 (funcall sunset-command) 97 (funcall sunset-command)
96 (run-at-time sunrise nil sunrise-command)) 98 (run-at-time sunrise nil sunrise-command))
97 ((time-less-p nil sunset-time) (run-at-time sunset nil sunset-command)) 99 ((time-less-p nil sunset-time)
100 ;; If it isn't sunset yet, it's still light---so we need to run the
101 ;; sunrise-command.
102 (funcall sunrise-command)
103 (run-at-time sunset nil sunset-command))
98 (t (run-at-time "12:00am" nil sunset-command))) 104 (t (run-at-time "12:00am" nil sunset-command)))
99 ;; Reset everything at midnight 105 ;; Reset everything at midnight
100 (unless reset 106 (unless reset