about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-07-21 00:04:47 -0500
committerCase Duckworth2022-07-21 00:04:47 -0500
commitcb9cfc5731d7f9e47d00fe5f3ff0077e99b668f7 (patch)
tree883ba8090c4890eff7471719993e7a56cad17e71
parentmeh (diff)
downloademacs-cb9cfc5731d7f9e47d00fe5f3ff0077e99b668f7.tar.gz
emacs-cb9cfc5731d7f9e47d00fe5f3ff0077e99b668f7.zip
bleh
-rw-r--r--init.el501
-rw-r--r--lisp/+apheleia.el23
-rw-r--r--lisp/acdw.el72
-rw-r--r--lisp/user-save.el22
4 files changed, 323 insertions, 295 deletions
diff --git a/init.el b/init.el index 73571f6..6775e33 100644 --- a/init.el +++ b/init.el
@@ -84,7 +84,7 @@
84 (apply fn r)))) 84 (apply fn r))))
85 85
86(setup (:require +init) 86(setup (:require +init)
87 (:local-hook user-save-hook #'+init-sort) 87 (:local-hook user-save-before-save-hook #'+init-sort)
88 (+with-ensure-after-init 88 (+with-ensure-after-init
89 (:hook #'+init-add-setup-to-imenu))) 89 (:hook #'+init-add-setup-to-imenu)))
90 90
@@ -147,8 +147,8 @@
147 ) 147 )
148 148
149(setup (:require user-save) 149(setup (:require user-save)
150 (add-hook 'user-save-hook #'+clean-empty-lines) 150 (add-hook 'user-save-before-save-hook #'+clean-empty-lines)
151 (add-hook 'user-save-hook (defun user-save@save-some-buffers () 151 (add-hook 'user-save-before-save-hook (defun user-save@save-some-buffers ()
152 (save-some-buffers t t))) 152 (save-some-buffers t t)))
153 (user-save-global-mode +1)) 153 (user-save-global-mode +1))
154 154
@@ -375,6 +375,7 @@
375 (* " "))) 375 (* " ")))
376 (:+leader "s" #'+eshell-here 376 (:+leader "s" #'+eshell-here
377 "C-s" #'+eshell-here) 377 "C-s" #'+eshell-here)
378 (:global "C-c C-z" #'+eshell-here)
378 (add-to-list 'eshell-modules-list 'eshell-tramp) 379 (add-to-list 'eshell-modules-list 'eshell-tramp)
379 (with-eval-after-load 'mwim 380 (with-eval-after-load 'mwim
380 (setf (alist-get 'eshell-mode mwim-beginning-of-line-function) 381 (setf (alist-get 'eshell-mode mwim-beginning-of-line-function)
@@ -478,7 +479,7 @@
478 (executable-find "aspell"))) 479 (executable-find "aspell")))
479 (put 'ispell-buffer-session-localwords 480 (put 'ispell-buffer-session-localwords
480 'safe-local-variable #'+ispell-safe-local-p) 481 'safe-local-variable #'+ispell-safe-local-p)
481 (add-hook 'user-save-hook #'+ispell-move-buffer-words-to-dir-locals-hook)) 482 (add-hook 'user-save-before-save-hook #'+ispell-move-buffer-words-to-dir-locals-hook))
482 483
483(setup kmacro 484(setup kmacro
484 (:also-load +kmacro) 485 (:also-load +kmacro)
@@ -729,7 +730,7 @@
729 ;; (cons ch ch))) 730 ;; (cons ch ch)))
730 ;; org-emphasis-alist)) 731 ;; org-emphasis-alist))
731 ) 732 )
732 (:local-hook user-save-hook #'+org-before-save@prettify-buffer) 733 (:local-hook user-save-before-save-hook #'+org-before-save@prettify-buffer)
733 (advice-add #'org-delete-backward-char :override #'+org-delete-backward-char) 734 (advice-add #'org-delete-backward-char :override #'+org-delete-backward-char)
734 ;; (define-advice org-open-at-point (:around (fn &rest r) open-external) 735 ;; (define-advice org-open-at-point (:around (fn &rest r) open-external)
735 ;; "Open links from org externally." 736 ;; "Open links from org externally."
@@ -1164,167 +1165,167 @@
1164 '(t)))))) 1165 '(t))))))
1165 1166
1166(setup (:straight circe) 1167(setup (:straight circe)
1167 (:require _circe 1168 ;; (:require _circe
1168 +circe) 1169 ;; +circe)
1169 (:also-load circe-chanop) 1170 ;; (:also-load circe-chanop)
1170 (+ensure-after-init (lambda () (defalias 'irc '+irc "Start IRC."))) 1171 ;; (+ensure-after-init (lambda () (defalias 'irc '+irc "Start IRC.")))
1171 1172
1172 ;; Formatting options 1173 ;; Formatting options
1173 (:option 1174 ;; (:option
1174 ;; Messages between users 1175 ;; ;; Messages between users
1175 circe-format-action (format (format "%%%ds* {nick} {body}" 1176 ;; circe-format-action (format (format "%%%ds* {nick} {body}"
1176 (- +circe-left-margin 2)) 1177 ;; (- +circe-left-margin 2))
1177 " ") 1178 ;; " ")
1178 circe-format-say (format "{nick:%1$d.%1$ds} | {body}" 1179 ;; circe-format-say (format "{nick:%1$d.%1$ds} | {body}"
1179 (- +circe-left-margin 3)) 1180 ;; (- +circe-left-margin 3))
1180 circe-format-self-action circe-format-action 1181 ;; circe-format-self-action circe-format-action
1181 circe-format-self-say (replace-regexp-in-string "|" ">" circe-format-say) 1182 ;; circe-format-self-say (replace-regexp-in-string "|" ">" circe-format-say)
1182 circe-format-notice (format "-{nick:%1$d.%1$ds}---{body}" 1183 ;; circe-format-notice (format "-{nick:%1$d.%1$ds}---{body}"
1183 (- +circe-left-margin 4)) 1184 ;; (- +circe-left-margin 4))
1184 circe-format-message (format (format "%%%ds@ *{nick}* {body}" 1185 ;; circe-format-message (format (format "%%%ds@ *{nick}* {body}"
1185 (- +circe-left-margin 2)) 1186 ;; (- +circe-left-margin 2))
1186 " ") 1187 ;; " ")
1187 circe-format-message-action (replace-regexp-in-string "@" "*" 1188 ;; circe-format-message-action (replace-regexp-in-string "@" "*"
1188 circe-format-message) 1189 ;; circe-format-message)
1189 circe-format-self-message (format (format "%%%ds> *{chattarget}* {body}" 1190 ;; circe-format-self-message (format (format "%%%ds> *{chattarget}* {body}"
1190 (- +circe-left-margin 2)) 1191 ;; (- +circe-left-margin 2))
1191 " ") 1192 ;; " ")
1192 ;; Meta messages 1193 ;; ;; Meta messages
1193 circe-format-server-channel-creation-time (+circe-format-meta 1194 ;; circe-format-server-channel-creation-time (+circe-format-meta
1194 (concat "Channel {channel}" 1195 ;; (concat "Channel {channel}"
1195 " created on {date}") t) 1196 ;; " created on {date}") t)
1196 circe-format-server-ctcp (+circe-format-meta 1197 ;; circe-format-server-ctcp (+circe-format-meta
1197 (concat "CTCP PING request to {target} from" 1198 ;; (concat "CTCP PING request to {target} from"
1198 " {userhost}: {body}")) 1199 ;; " {userhost}: {body}"))
1199 circe-format-server-ctcp-ping-reply (+circe-format-meta 1200 ;; circe-format-server-ctcp-ping-reply (+circe-format-meta
1200 (concat 1201 ;; (concat
1201 "CTCP PING reply to {target} from" 1202 ;; "CTCP PING reply to {target} from"
1202 " {userhost}: {body}")) 1203 ;; " {userhost}: {body}"))
1203 circe-format-server-part (+circe-format-meta "PART {channel}: {reason}") 1204 ;; circe-format-server-part (+circe-format-meta "PART {channel}: {reason}")
1204 circe-format-server-quit (+circe-format-meta "QUIT: {reason}") 1205 ;; circe-format-server-quit (+circe-format-meta "QUIT: {reason}")
1205 circe-format-server-quit-channel (+circe-format-meta 1206 ;; circe-format-server-quit-channel (+circe-format-meta
1206 "QUIT {channel}: {reason}") 1207 ;; "QUIT {channel}: {reason}")
1207 circe-format-server-join (+circe-format-meta "JOIN: {userinfo}") 1208 ;; circe-format-server-join (+circe-format-meta "JOIN: {userinfo}")
1208 circe-format-server-join-in-channel (+circe-format-meta 1209 ;; circe-format-server-join-in-channel (+circe-format-meta
1209 "JOIN {channel}: {userinfo}") 1210 ;; "JOIN {channel}: {userinfo}")
1210 circe-format-server-lurker-activity (+circe-format-meta 1211 ;; circe-format-server-lurker-activity (+circe-format-meta
1211 "(JOINED {joindelta} ago)") 1212 ;; "(JOINED {joindelta} ago)")
1212 circe-format-server-message (+circe-format-meta "{body}" t) 1213 ;; circe-format-server-message (+circe-format-meta "{body}" t)
1213 circe-fromat-server-mode-change (+circe-format-meta 1214 ;; circe-fromat-server-mode-change (+circe-format-meta
1214 (concat "MODE: {target} {change}" 1215 ;; (concat "MODE: {target} {change}"
1215 " by {setter} ({userhost})") t) 1216 ;; " by {setter} ({userhost})") t)
1216 circe-format-server-netmerge (+circe-format-meta 1217 ;; circe-format-server-netmerge (+circe-format-meta
1217 (concat "NETMERGE: {split} at {date}" 1218 ;; (concat "NETMERGE: {split} at {date}"
1218 " (/WL to see who's still missing)") t) 1219 ;; " (/WL to see who's still missing)") t)
1219 circe-format-server-netsplit (+circe-format-meta 1220 ;; circe-format-server-netsplit (+circe-format-meta
1220 (concat "NETSPLIT: {split}" 1221 ;; (concat "NETSPLIT: {split}"
1221 " (/WL to see who left)") t) 1222 ;; " (/WL to see who left)") t)
1222 circe-format-server-nick-change (+circe-format-meta 1223 ;; circe-format-server-nick-change (+circe-format-meta
1223 "NICK WAS {old-nick} ({userhost})" 1224 ;; "NICK WAS {old-nick} ({userhost})"
1224 "new-nick") 1225 ;; "new-nick")
1225 circe-format-server-nick-regain (+circe-format-meta 1226 ;; circe-format-server-nick-regain (+circe-format-meta
1226 "NICK REGAINED: {old-nick} ({userhost})" 1227 ;; "NICK REGAINED: {old-nick} ({userhost})"
1227 "new-nick") 1228 ;; "new-nick")
1228 circe-format-server-notice (+circe-format-meta "-SERVER NOTICE- {body}" t) 1229 ;; circe-format-server-notice (+circe-format-meta "-SERVER NOTICE- {body}" t)
1229 circe-format-server-topic-time (+circe-format-meta 1230 ;; circe-format-server-topic-time (+circe-format-meta
1230 "TOPIC SET BY {setter} on {topic-date}") 1231 ;; "TOPIC SET BY {setter} on {topic-date}")
1231 circe-format-server-topic-time-for-channel (+circe-format-meta 1232 ;; circe-format-server-topic-time-for-channel (+circe-format-meta
1232 (concat 1233 ;; (concat
1233 "TOPIC ({channel}) SET BY" 1234 ;; "TOPIC ({channel}) SET BY"
1234 " {setter} on {topic-date}")) 1235 ;; " {setter} on {topic-date}"))
1235 circe-format-server-whois-idle (+circe-format-meta "IDLE FOR {idle-duration}" 1236 ;; circe-format-server-whois-idle (+circe-format-meta "IDLE FOR {idle-duration}"
1236 "whois-nick") 1237 ;; "whois-nick")
1237 circe-format-server-whois-idle-with-signon (+circe-format-meta 1238 ;; circe-format-server-whois-idle-with-signon (+circe-format-meta
1238 (concat 1239 ;; (concat
1239 "IDLE FOR {idle-duration}" 1240 ;; "IDLE FOR {idle-duration}"
1240 " (signon: {signon-date})") 1241 ;; " (signon: {signon-date})")
1241 "whois-nick") 1242 ;; "whois-nick")
1242 circe-format-server-rejoin (+circe-format-meta 1243 ;; circe-format-server-rejoin (+circe-format-meta
1243 (concat "REJOIN: {userinfo} " 1244 ;; (concat "REJOIN: {userinfo} "
1244 "after {departuredelta}")) 1245 ;; "after {departuredelta}"))
1245 circe-format-server-topic (+circe-format-meta "TOPIC: {new-topic}") 1246 ;; circe-format-server-topic (+circe-format-meta "TOPIC: {new-topic}")
1246 circe-prompt-string (format (format "%%%ds> " 1247 ;; circe-prompt-string (format (format "%%%ds> "
1247 (- +circe-left-margin 2)) 1248 ;; (- +circe-left-margin 2))
1248 " ")) 1249 ;; " "))
1249 1250
1250 (:option +circe-server-buffer-action (lambda (buf) 1251 ;; (:option +circe-server-buffer-action (lambda (buf)
1251 (message "Connected to %s" buf)) 1252 ;; (message "Connected to %s" buf))
1252 +circe-network-inhibit-autoconnect _circe-network-inhibit-autoconnect 1253 ;; +circe-network-inhibit-autoconnect _circe-network-inhibit-autoconnect
1253 circe-network-options _circe-network-options 1254 ;; circe-network-options _circe-network-options
1254 circe-color-nicks-everywhere t 1255 ;; circe-color-nicks-everywhere t
1255 circe-default-part-message "See You, Space Cowpokes . . ." 1256 ;; circe-default-part-message "See You, Space Cowpokes . . ."
1256 circe-default-user user-real-login-name 1257 ;; circe-default-user user-real-login-name
1257 circe-reduce-lurker-spam t 1258 ;; circe-reduce-lurker-spam t
1258 circe-server-auto-join-default-type :after-auth) 1259 ;; circe-server-auto-join-default-type :after-auth)
1259 (:bind "C-c C-p" #'circe-command-PART 1260 ;; (:bind "C-c C-p" #'circe-command-PART
1260 "C-c C-t" #'+circe-current-topic 1261 ;; "C-c C-t" #'+circe-current-topic
1261 "C-l" #'lui-track-jump-to-indicator 1262 ;; "C-l" #'lui-track-jump-to-indicator
1262 "C-<return>" #'+circe-chat@set-prompt) 1263 ;; "C-<return>" #'+circe-chat@set-prompt)
1263 1264
1264 ;; XXX: this doesn't quite work right. 1265 ;; XXX: this doesn't quite work right.
1265 (advice-add #'circe-command-PART :after #'+circe-kill-buffer) 1266 ;; (advice-add #'circe-command-PART :after #'+circe-kill-buffer)
1266 (advice-add #'circe-command-QUIT :after #'+circe-quit@kill-buffer) 1267 ;; (advice-add #'circe-command-QUIT :after #'+circe-quit@kill-buffer)
1267 (advice-add #'circe-command-GQUIT :after #'+circe-gquit@kill-buffer) 1268 ;; (advice-add #'circe-command-GQUIT :after #'+circe-gquit@kill-buffer)
1268 1269
1269 (:with-mode circe-chat-mode 1270 ;; (:with-mode circe-chat-mode
1270 (:local-set lui-input-function #'+lui-filter 1271 ;; (:local-set lui-input-function #'+lui-filter
1271 +modeline-position-function #'ignore) 1272 ;; +modeline-position-function #'ignore)
1272 (:hook #'enable-circe-color-nicks 1273 ;; (:hook #'enable-circe-color-nicks
1273 #'enable-circe-new-day-notifier 1274 ;; #'enable-circe-new-day-notifier
1274 #'+circe-chat@set-prompt 1275 ;; #'+circe-chat@set-prompt
1275 ;; Filters 1276 ;; ;; Filters
1276 ;;#'+circe-F/C-mode 1277 ;; ;;#'+circe-F/C-mode
1277 ;; For some reason `+circe-shorten-url-mode' won't work right out of 1278 ;; ;; For some reason `+circe-shorten-url-mode' won't work right out of
1278 ;; the gate. 1279 ;; ;; the gate.
1279 ;;(lambda () (run-at-time 0.25 nil #'+circe-shorten-url-mode)) 1280 ;; ;;(lambda () (run-at-time 0.25 nil #'+circe-shorten-url-mode))
1280 ) 1281 ;; )
1281 (:bind "C-c C-s" #'circe-command-SLAP)) 1282 ;; (:bind "C-c C-s" #'circe-command-SLAP))
1282 1283
1283 (:with-mode lui-mode 1284 ;; (:with-mode lui-mode
1284 (:option lui-fill-column (+ fill-column +circe-left-margin) 1285 ;; (:option lui-fill-column (+ fill-column +circe-left-margin)
1285 lui-fill-type nil 1286 ;; lui-fill-type nil
1286 lui-max-buffer-size (+bytes 10 :kb) 1287 ;; lui-max-buffer-size (+bytes 10 :kb)
1287 lui-time-stamp-position 'right-margin 1288 ;; lui-time-stamp-position 'right-margin
1288 lui-time-stamp-format "| %H:%M" 1289 ;; lui-time-stamp-format "| %H:%M"
1289 lui-track-behavior 'before-switch-to-buffer 1290 ;; lui-track-behavior 'before-switch-to-buffer
1290 lui-track-indicator 'bar 1291 ;; lui-track-indicator 'bar
1291 lui-fill-remove-face-from-newline nil 1292 ;; lui-fill-remove-face-from-newline nil
1292 lui-formatting-list `((,(+lui-make-formatting-list-rx "*") 1293 ;; lui-formatting-list `((,(+lui-make-formatting-list-rx "*")
1293 1 lui-strong-face) 1294 ;; 1 lui-strong-face)
1294 (,(+lui-make-formatting-list-rx "_") 1295 ;; (,(+lui-make-formatting-list-rx "_")
1295 1 lui-emphasis-face) 1296 ;; 1 lui-emphasis-face)
1296 (,(+lui-make-formatting-list-rx "/") 1297 ;; (,(+lui-make-formatting-list-rx "/")
1297 1 lui-emphasis-face)) 1298 ;; 1 lui-emphasis-face))
1298 lui-autopaste-function 1299 ;; lui-autopaste-function
1299 (defun +0x0-upload-string (string) 1300 ;; (defun +0x0-upload-string (string)
1300 "Upload a string using 0x0." 1301 ;; "Upload a string using 0x0."
1301 (with-temp-buffer 1302 ;; (with-temp-buffer
1302 (insert string) 1303 ;; (insert string)
1303 (0x0-upload-text (0x0--choose-server))) 1304 ;; (0x0-upload-text (0x0--choose-server)))
1304 (current-kill 0))) 1305 ;; (current-kill 0)))
1305 (add-to-list '+pulse-location-commands #'lui-track-jump-to-indicator) 1306 ;; (add-to-list '+pulse-location-commands #'lui-track-jump-to-indicator)
1306 (:face 'lui-track-bar '((t ( :height 10 1307 ;; (:face 'lui-track-bar '((t ( :height 10
1307 :underline ( :color foreground-color 1308 ;; :underline ( :color foreground-color
1308 :style line 1309 ;; :style line
1309 :position line) 1310 ;; :position line)
1310 :extend t :inhert (default))))) 1311 ;; :extend t :inhert (default)))))
1311 (:hook #'visual-line-mode 1312 ;; (:hook #'visual-line-mode
1312 #'enable-lui-track 1313 ;; #'enable-lui-track
1313 #'visual-fill-column-mode 1314 ;; #'visual-fill-column-mode
1314 #'enable-lui-autopaste 1315 ;; #'enable-lui-autopaste
1315 (defun turn-off-+nyan-mode () (+nyan-local-mode -1)) 1316 ;; (defun turn-off-+nyan-mode () (+nyan-local-mode -1))
1316 (defun turn-off-electric-pair-mode () (electric-pair-mode -1))) 1317 ;; (defun turn-off-electric-pair-mode () (electric-pair-mode -1)))
1317 (:local-set fringes-outside-margins t 1318 ;; (:local-set fringes-outside-margins t
1318 right-margin-width (length lui-time-stamp-format) 1319 ;; right-margin-width (length lui-time-stamp-format)
1319 scroll-margin 0 1320 ;; scroll-margin 0
1320 scroll-step 1 1321 ;; scroll-step 1
1321 word-wrap t 1322 ;; word-wrap t
1322 wrap-prefix (+string-repeat +circe-left-margin " ") 1323 ;; wrap-prefix (+string-repeat +circe-left-margin " ")
1323 line-number-mode nil 1324 ;; line-number-mode nil
1324 column-number-mode nil 1325 ;; column-number-mode nil
1325 file-percentage-mode nil 1326 ;; file-percentage-mode nil
1326 visual-fill-column-extra-text-width 1327 ;; visual-fill-column-extra-text-width
1327 (cons +circe-left-margin 0))) 1328 ;; (cons +circe-left-margin 0)))
1328 1329
1329 (tracking-mode +1) 1330 (tracking-mode +1)
1330 (:with-mode tracking-mode 1331 (:with-mode tracking-mode
@@ -1339,13 +1340,14 @@
1339 '(tracking-mode 1340 '(tracking-mode
1340 tracking-mode-line-buffers))) 1341 tracking-mode-line-buffers)))
1341 1342
1342 (with-eval-after-load 'topsy 1343 ;; (with-eval-after-load 'topsy
1343 (:option (append topsy-mode-functions) 1344 ;; (:option (append topsy-mode-functions)
1344 '(circe-channel-mode . +circe-current-topic))) 1345 ;; '(circe-channel-mode . +circe-current-topic)))
1345 1346
1346 (with-eval-after-load 'circe-color-nicks 1347 ;; (with-eval-after-load 'circe-color-nicks
1347 (add-hook 'modus-themes-after-load-theme-hook #'circe-nick-color-reset)) 1348 ;; (add-hook 'modus-themes-after-load-theme-hook #'circe-nick-color-reset))
1348 (add-hook 'kill-emacs-hook #'+circe-quit-all@kill-emacs)) 1349 ;; (add-hook 'kill-emacs-hook #'+circe-quit-all@kill-emacs)
1350 )
1349 1351
1350(setup (:straight (clean-kill-ring :host github 1352(setup (:straight (clean-kill-ring :host github
1351 :repo "NicholasBHubbard/clean-kill-ring.el")) 1353 :repo "NicholasBHubbard/clean-kill-ring.el"))
@@ -1540,79 +1542,79 @@
1540 (t . bar))) 1542 (t . bar)))
1541 (electric-cursor-mode +1)) 1543 (electric-cursor-mode +1))
1542 1544
1543(setup (:straight elfeed) 1545;; (setup (:straight elfeed)
1544 (:require +elfeed) 1546;; (:require +elfeed)
1545 (+define-dir elfeed/ (sync/ "emacs/elfeed/" t)) 1547;; (+define-dir elfeed/ (sync/ "emacs/elfeed/" t))
1546 (:option 1548;; (:option
1547 elfeed-curl-program-name (executable-find "curl") 1549;; elfeed-curl-program-name (executable-find "curl")
1548 elfeed-use-curl elfeed-curl-program-name 1550;; elfeed-use-curl elfeed-curl-program-name
1549 elfeed-curl-extra-arguments '("--insecure") 1551;; elfeed-curl-extra-arguments '("--insecure")
1550 elfeed-enclosure-default-dir (cl-loop for dir in '("~/var/download/" 1552;; elfeed-enclosure-default-dir (cl-loop for dir in '("~/var/download/"
1551 "~/Downloads/") 1553;; "~/Downloads/")
1552 if (file-exists-p dir) 1554;; if (file-exists-p dir)
1553 return dir) 1555;; return dir)
1554 elfeed-search-filter "@10-days-ago +unread" 1556;; elfeed-search-filter "@10-days-ago +unread"
1555 elfeed-search-trailing-width 24 1557;; elfeed-search-trailing-width 24
1556 elfeed-search-title-min-width 24 1558;; elfeed-search-title-min-width 24
1557 elfeed-search-title-max-width 78 1559;; elfeed-search-title-max-width 78
1558 elfeed-search-remain-on-entry t 1560;; elfeed-search-remain-on-entry t
1559 elfeed-show-unique-buffers t 1561;; elfeed-show-unique-buffers t
1560 elfeed-db-directory (elfeed/ "db/" t)) 1562;; elfeed-db-directory (elfeed/ "db/" t))
1561 (:+leader "f" #'elfeed "C-f" #'elfeed) 1563;; (:+leader "f" #'elfeed "C-f" #'elfeed)
1562 (advice-add #'elfeed-search-fetch :after #'beginning-of-buffer) 1564;; (advice-add #'elfeed-search-fetch :after #'beginning-of-buffer)
1563 (:with-mode elfeed-search-mode 1565;; (:with-mode elfeed-search-mode
1564 (:bind "&" #'+elfeed-search-browse-generic 1566;; (:bind "&" #'+elfeed-search-browse-generic
1565 "w" #'elfeed-search-yank 1567;; "w" #'elfeed-search-yank
1566 "y" nil 1568;; "y" nil
1567 "a" #'+elfeed-show-mark-read-and-advance) 1569;; "a" #'+elfeed-show-mark-read-and-advance)
1568 (:hook #'hl-line-mode) 1570;; (:hook #'hl-line-mode)
1569 ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/ 1571;; ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/
1570 (advice-add #'elfeed-search-update--force :after #'elfeed-db-save) 1572;; (advice-add #'elfeed-search-update--force :after #'elfeed-db-save)
1571 (advice-add #'elfeed :before #'elfeed-db-load)) 1573;; (advice-add #'elfeed :before #'elfeed-db-load))
1572 (:with-mode elfeed-show-mode 1574;; (:with-mode elfeed-show-mode
1573 (:bind "SPC" #'+elfeed-scroll-up-command 1575;; (:bind "SPC" #'+elfeed-scroll-up-command
1574 "S-SPC" #'+elfeed-scroll-down-command 1576;; "S-SPC" #'+elfeed-scroll-down-command
1575 "&" #'+elfeed-show-browse-generic 1577;; "&" #'+elfeed-show-browse-generic
1576 "RET" #'shr-browse-url 1578;; "RET" #'shr-browse-url
1577 "w" #'elfeed-show-yank 1579;; "w" #'elfeed-show-yank
1578 "y" nil) 1580;; "y" nil)
1579 (:hook #'reading-mode) 1581;; (:hook #'reading-mode)
1580 (:option +elfeed--update-repeat (* 60 30) ; 1/2 hour 1582;; (:option +elfeed--update-repeat (* 60 30) ; 1/2 hour
1581 +elfeed--update-first-time 60)) 1583;; +elfeed--update-first-time 60))
1582 (+elfeed-update-async-mode +1) 1584;; (+elfeed-update-async-mode +1)
1583 (add-hook '+elfeed-update-proceed-hook (defun non-work-hours? () 1585;; (add-hook '+elfeed-update-proceed-hook (defun non-work-hours? ()
1584 "Return nil if during work hours, t otherwise." 1586;; "Return nil if during work hours, t otherwise."
1585 (let* ((now (current-time)) 1587;; (let* ((now (current-time))
1586 (now* (decode-time now)) 1588;; (now* (decode-time now))
1587 (work-start* (append '(0 0 8) (cdddr now*))) ; 8:00 AM 1589;; (work-start* (append '(0 0 8) (cdddr now*))) ; 8:00 AM
1588 (work-end* (append '(0 0 18) (cdddr now*))) ; 6:00 PM 1590;; (work-end* (append '(0 0 18) (cdddr now*))) ; 6:00 PM
1589 (work-start (encode-time work-start*)) 1591;; (work-start (encode-time work-start*))
1590 (work-end (encode-time work-end*))) 1592;; (work-end (encode-time work-end*)))
1591 (or (time-less-p now work-start) 1593;; (or (time-less-p now work-start)
1592 (time-less-p work-end now)))))) 1594;; (time-less-p work-end now))))))
1593 1595
1594(setup (:straight elfeed-org) 1596;; (setup (:straight elfeed-org)
1595 (:also-load +org-capture) 1597;; (:also-load +org-capture)
1596 (:option rmh-elfeed-org-files (list (elfeed/ "elfeed.org" t))) 1598;; (:option rmh-elfeed-org-files (list (elfeed/ "elfeed.org" t)))
1597 (elfeed-org) 1599;; (elfeed-org)
1598 (+org-capture-templates-setf "f" 1600;; (+org-capture-templates-setf "f"
1599 `("Feed" entry 1601;; `("Feed" entry
1600 (file+olp ,(car rmh-elfeed-org-files) "Feeds") 1602;; (file+olp ,(car rmh-elfeed-org-files) "Feeds")
1601 "* %? %^g"))) 1603;; "* %? %^g")))
1602 1604
1603(setup (:straight (elfeed-tube :host github :repo "karthink/elfeed-tube") 1605;; (setup (:straight (elfeed-tube :host github :repo "karthink/elfeed-tube")
1604 (or (executable-find "youtube-dl") 1606;; (or (executable-find "youtube-dl")
1605 (executable-find "yt-dlp"))) 1607;; (executable-find "yt-dlp")))
1606 (:straight (elfeed-tube-mpv :host github :repo "karthink/elfeed-tube")) 1608;; (:straight (elfeed-tube-mpv :host github :repo "karthink/elfeed-tube"))
1607 (:load-after elfeed) 1609;; (:load-after elfeed)
1608 (with-eval-after-load 'elfeed 1610;; (with-eval-after-load 'elfeed
1609 (elfeed-tube-setup) 1611;; (elfeed-tube-setup)
1610 (:bind-into (elfeed-show-mode-map elfeed-search-mode-map) 1612;; (:bind-into (elfeed-show-mode-map elfeed-search-mode-map)
1611 "F" #'elfeed-tube-fetch 1613;; "F" #'elfeed-tube-fetch
1612 [remap save-buffer] #'elfeed-tube-save) 1614;; [remap save-buffer] #'elfeed-tube-save)
1613 (:bind-into elfeed-show-mode-map 1615;; (:bind-into elfeed-show-mode-map
1614 "C-c C-f" #'elfeed-tube-mpv-follow-mode 1616;; "C-c C-f" #'elfeed-tube-mpv-follow-mode
1615 "C-c C-w" #'elfeed-tube-mpv-where))) 1617;; "C-c C-w" #'elfeed-tube-mpv-where)))
1616 1618
1617(setup (:straight elpher) 1619(setup (:straight elpher)
1618 (:bind "l" #'elpher-back)) 1620 (:bind "l" #'elpher-back))
@@ -1869,11 +1871,15 @@
1869 jabber-groupchat-buffer-format "%n" 1871 jabber-groupchat-buffer-format "%n"
1870 jabber-chat-buffer-format "%n" 1872 jabber-chat-buffer-format "%n"
1871 jabber-muc-private-buffer-format "%n(%g)" 1873 jabber-muc-private-buffer-format "%n(%g)"
1874 jabber-muc-header-line-format '("" jabber-muc-topic)
1872 jabber-activity-show-p #'ignore 1875 jabber-activity-show-p #'ignore
1873 jabber-muc-decorate-presence-patterns 1876 jabber-muc-decorate-presence-patterns
1874 '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$") 1877 '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$")
1875 ("." . jabber-muc-presence-dim)) 1878 ("." . jabber-muc-presence-dim))
1876 jabber-muc-colorize-foreign nil ; colorizing doesn't match my color theme 1879 jabber-muc-colorize-foreign nil ; doesn't match my color theme
1880 jabber-groupchat-prompt-format "[%t] %n\n"
1881 jabber-chat-local-prompt-format "[%t] %n\n"
1882 jabber-chat-foreign-prompt-format "[%t] %n\n"
1877 ;; jabber-chat-foreign-prompt-format 1883 ;; jabber-chat-foreign-prompt-format
1878 ;; (concat +jabber-pre-prompt 1884 ;; (concat +jabber-pre-prompt
1879 ;; "%n\n" 1885 ;; "%n\n"
@@ -1909,7 +1915,9 @@
1909 jabber-roster-mode 1915 jabber-roster-mode
1910 jabber-console-mode)) 1916 jabber-console-mode))
1911 (let ((hook (intern (format "%s-hook" mode)))) 1917 (let ((hook (intern (format "%s-hook" mode))))
1912 (add-hook hook #'visual-fill-column-mode))) 1918 (add-hook hook #'visual-fill-column-mode)
1919 ;; (add-hook hook (lambda () (setq-local wrap-prefix " ")))
1920 ))
1913 (with-eval-after-load 'tracking 1921 (with-eval-after-load 'tracking
1914 (add-to-list 'tracking-ignored-buffers "discuss@conference.soprani.ca")) 1922 (add-to-list 'tracking-ignored-buffers "discuss@conference.soprani.ca"))
1915 (:with-mode jabber-chat-mode 1923 (:with-mode jabber-chat-mode
@@ -2483,13 +2491,6 @@
2483 trashed-use-header-line t 2491 trashed-use-header-line t
2484 trashed-size-format 'human-readable)) 2492 trashed-size-format 'human-readable))
2485 2493
2486(setup (:straight (twtxt
2487 :fork (:repo "duckwork/twtxt-el")))
2488 (:require)
2489 (:also-load _twtxt)
2490 (:option twtxt-file _twtxt-file
2491 twtxt-following _twtxt-following))
2492
2493(setup (:straight undo-fu) (:quit "Trying native undo functionality") 2494(setup (:straight undo-fu) (:quit "Trying native undo functionality")
2494 (:option undo-fu-allow-undo-in-region t) 2495 (:option undo-fu-allow-undo-in-region t)
2495 (:global "C-/" #'undo-fu-only-undo 2496 (:global "C-/" #'undo-fu-only-undo
diff --git a/lisp/+apheleia.el b/lisp/+apheleia.el index 3428a72..51cf145 100644 --- a/lisp/+apheleia.el +++ b/lisp/+apheleia.el
@@ -3,6 +3,7 @@
3;;; Code: 3;;; Code:
4 4
5(require 'cl-lib) 5(require 'cl-lib)
6(require 'el-patch)
6(require 'user-save) 7(require 'user-save)
7 8
8;; https://github.com/raxod502/apheleia/pull/63#issue-1077529623 9;; https://github.com/raxod502/apheleia/pull/63#issue-1077529623
@@ -14,13 +15,31 @@
14 (point-max)) 15 (point-max))
15 (funcall callback))) 16 (funcall callback)))
16 17
18;;; Why does the original function have to check for `apheleia-mode' ?
19(el-patch-defun apheleia--format-after-save ()
20 "Run code formatter for current buffer if any configured, then save."
21 (unless apheleia--format-after-save-in-progress
22 (when (el-patch-swap apheleia-mode
23 (or apheleia-mode
24 +apheleia/user-save-mode))
25 (when-let ((formatters (apheleia--get-formatters)))
26 (apheleia-format-buffer
27 formatters
28 (lambda ()
29 (with-demoted-errors "Apheleia: %s"
30 (when buffer-file-name
31 (let ((apheleia--format-after-save-in-progress t))
32 (apheleia--save-buffer-silently)))
33 (run-hooks 'apheleia-post-format-hook))))))))
34
35
17(define-minor-mode +apheleia/user-save-mode 36(define-minor-mode +apheleia/user-save-mode
18 "Minor mode for reformatting code on `user-save'. 37 "Minor mode for reformatting code on `user-save'.
19Customize with `apheleia-mode-alist' and `apheleia-formatters'." 38Customize with `apheleia-mode-alist' and `apheleia-formatters'."
20 :lighter " Apheleia/US" 39 :lighter " Apheleia/US"
21 (if +apheleia/user-save-mode 40 (if +apheleia/user-save-mode
22 (add-hook 'user-save-hook #'apheleia--format-after-save nil 'local) 41 (add-hook 'user-save-after-save-hook #'apheleia--format-after-save nil 'local)
23 (remove-hook 'user-save-hook #'apheleia--format-after-save 'local))) 42 (remove-hook 'user-save-after-save-hook #'apheleia--format-after-save 'local)))
24 43
25(define-globalized-minor-mode +apheleia/user-save-global-mode 44(define-globalized-minor-mode +apheleia/user-save-global-mode
26 +apheleia/user-save-mode +apheleia/user-save-mode) 45 +apheleia/user-save-mode +apheleia/user-save-mode)
diff --git a/lisp/acdw.el b/lisp/acdw.el index 26d1494..99ab733 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -297,44 +297,44 @@ always nil; this function is mostly intended for use in init."
297 (setq r (concat r str))) 297 (setq r (concat r str)))
298 r)) 298 r))
299 299
300(defun chat-disconnect () 300;; (defun chat-disconnect ()
301 "Disconnect from all chats." 301;; "Disconnect from all chats."
302 (interactive) 302;; (interactive)
303 (+with-progress "Quitting circe..." 303;; (+with-progress "Quitting circe..."
304 (ignore-errors 304;; (ignore-errors
305 (circe-command-GQUIT "peace love bread") 305;; (circe-command-GQUIT "peace love bread")
306 (cancel-timer (irc-connection-get conn :flood-timer)))) 306;; (cancel-timer (irc-connection-get conn :flood-timer))))
307 (+with-progress "Quitting jabber..." 307;; (+with-progress "Quitting jabber..."
308 (ignore-errors 308;; (ignore-errors
309 (jabber-disconnect))) 309;; (jabber-disconnect)))
310 (when (boundp '+slack-teams) 310;; (when (boundp '+slack-teams)
311 (+with-progress "Quitting-slack..." 311;; (+with-progress "Quitting-slack..."
312 (dolist (team +slack-teams) 312;; (dolist (team +slack-teams)
313 (ignore-errors 313;; (ignore-errors
314 (slack-team-disconnect team))) 314;; (slack-team-disconnect team)))
315 (ignore-errors (slack-ws-close)))) 315;; (ignore-errors (slack-ws-close))))
316 (+with-progress "Killing buffers..." 316;; (+with-progress "Killing buffers..."
317 (ignore-errors 317;; (ignore-errors
318 (+mapc-some-buffers (lambda () "Remove the buffer from tracking and kill it unconditionally." 318;; (+mapc-some-buffers (lambda () "Remove the buffer from tracking and kill it unconditionally."
319 (let ((kill-buffer-query-functions nil)) 319;; (let ((kill-buffer-query-functions nil))
320 (tracking-remove-buffer (current-buffer)) 320;; (tracking-remove-buffer (current-buffer))
321 (kill-buffer))) 321;; (kill-buffer)))
322 (lambda () "Return t if derived from the following modes." 322;; (lambda () "Return t if derived from the following modes."
323 (derived-mode-p 'lui-mode 323;; (derived-mode-p 'lui-mode
324 'jabber-chat-mode 324;; 'jabber-chat-mode
325 'jabber-roster-mode 325;; 'jabber-roster-mode
326 'jabber-browse-mode 326;; 'jabber-browse-mode
327 'slack-mode)))))) 327;; 'slack-mode))))))
328 328
329;; I can never remember all the damn chat things I run, so this just does all of em. 329;; I can never remember all the damn chat things I run, so this just does all of em.
330(defun chat (&optional arg) 330;; (defun chat (&optional arg)
331 "Initiate all chat functions. 331;; "Initiate all chat functions.
332With optional ARG, kill all chat-related buffers first." 332;; With optional ARG, kill all chat-related buffers first."
333 (interactive "P") 333;; (interactive "P")
334 (when arg (chat-disconnect)) 334;; (when arg (chat-disconnect))
335 (dolist-with-progress-reporter (fn chat-functions) 335;; (dolist-with-progress-reporter (fn chat-functions)
336 "Connecting to chat..." 336;; "Connecting to chat..."
337 (call-interactively fn))) 337;; (call-interactively fn)))
338 338
339(defun +forward-paragraph (arg) 339(defun +forward-paragraph (arg)
340 "Move forward ARG (simple) paragraphs. 340 "Move forward ARG (simple) paragraphs.
diff --git a/lisp/user-save.el b/lisp/user-save.el index 1c04c9d..674abac 100644 --- a/lisp/user-save.el +++ b/lisp/user-save.el
@@ -20,7 +20,7 @@
20 20
21(defgroup user-save nil 21(defgroup user-save nil
22 "Group for `user-save-mode' customizations." 22 "Group for `user-save-mode' customizations."
23 :group 'emacs 23 :group 'files
24 :prefix "user-save-") 24 :prefix "user-save-")
25 25
26(defcustom user-save-hook-into-kill-emacs nil 26(defcustom user-save-hook-into-kill-emacs nil
@@ -39,8 +39,13 @@ Each predicate will be called with no arguments, and if it
39returns t, will inhibit `user-save-mode' from activating." 39returns t, will inhibit `user-save-mode' from activating."
40 :type '(repeat function)) 40 :type '(repeat function))
41 41
42(defvar user-save-hook nil 42(defcustom user-save-before-save-hook nil
43 "Hook to run when the user, not Emacs, saves the buffer.") 43 "Hook to run before the user, not Emacs, saves the buffer."
44 :type 'hook)
45
46(defcustom user-save-after-save-hook nil
47 "Hook to run after the user, not Emacs, saves the buffer."
48 :type 'hook)
44 49
45(defvar user-save-mode-map (let ((map (make-sparse-keymap))) 50(defvar user-save-mode-map (let ((map (make-sparse-keymap)))
46 (define-key map (kbd "C-x C-s") #'user-save-buffer) 51 (define-key map (kbd "C-x C-s") #'user-save-buffer)
@@ -49,11 +54,13 @@ returns t, will inhibit `user-save-mode' from activating."
49 "Keymap for `user-save-mode'. 54 "Keymap for `user-save-mode'.
50This map shadows the default map for `save-buffer'.") 55This map shadows the default map for `save-buffer'.")
51 56
52(defun user-save-run-hooks (&rest _) 57(defun user-save-run-hooks (which &rest _)
53 "Run the hooks in `user-save-hook'. 58 "Run the hooks in one of the user-save-hooks.
59If WHICH is `'before', run `user-save-before-save-hook';
60if it's `after', run `user-save-after-save-hook'.
54This does /not/ also save the buffer." 61This does /not/ also save the buffer."
55 (with-demoted-errors "User-save-hook error: %S" 62 (with-demoted-errors "User-save-hook error: %S"
56 (run-hooks 'user-save-hook))) 63 (run-hooks (intern (format "user-save-%s-save-hook" which)))))
57 64
58(defun user-save-non-file-buffer-p (&optional buffer-or-name) 65(defun user-save-non-file-buffer-p (&optional buffer-or-name)
59 "Return whether BUFFER-OR-NAME is a non-file buffer. 66 "Return whether BUFFER-OR-NAME is a non-file buffer.
@@ -74,8 +81,9 @@ run all the time, put them in `user-save-hook'.
74ARG is passed directly to `save-buffer'." 81ARG is passed directly to `save-buffer'."
75 (interactive '(called-interactively)) 82 (interactive '(called-interactively))
76 (message "User-Saving the buffer...") 83 (message "User-Saving the buffer...")
77 (user-save-run-hooks) 84 (user-save-run-hooks 'before)
78 (save-buffer arg) 85 (save-buffer arg)
86 (user-save-run-hooks 'after)
79 (message "User-Saving the buffer...Done.")) 87 (message "User-Saving the buffer...Done."))
80 88
81(defun user-save-some-buffers (&optional pred) 89(defun user-save-some-buffers (&optional pred)