about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2023-05-05 09:58:21 -0500
committerCase Duckworth2023-05-05 09:58:21 -0500
commit989171268461a0069ecd53a49e6098ce08638102 (patch)
treeb88889d371152458f674c0a608222bf1192f3980
parentremove bad fiels (diff)
downloademacs-989171268461a0069ecd53a49e6098ce08638102.tar.gz
emacs-989171268461a0069ecd53a49e6098ce08638102.zip
changes use-package
-rw-r--r--basics.el48
-rw-r--r--early-init.el16
-rw-r--r--init.el617
-rw-r--r--lisp/acdw-chat.el96
-rw-r--r--lisp/acdw-mail.el87
-rw-r--r--lisp/acdw-org.el111
-rw-r--r--lisp/acdw-shell0
-rw-r--r--lisp/acdw-shell.el32
-rw-r--r--lisp/acdw-web.el30
-rw-r--r--lisp/acdw.el7
10 files changed, 608 insertions, 436 deletions
diff --git a/basics.el b/basics.el index 15831d3..1405c84 100644 --- a/basics.el +++ b/basics.el
@@ -192,7 +192,7 @@
192 auto-save-interval 1 192 auto-save-interval 1
193 auto-save-no-message t 193 auto-save-no-message t
194 auto-save-timeout 1 194 auto-save-timeout 1
195 auto-save-visited-interval 10 195 auto-save-visited-interval 1
196 remote-file-name-inhibit-auto-save-visited t) 196 remote-file-name-inhibit-auto-save-visited t)
197(add-to-list 'auto-save-file-name-transforms 197(add-to-list 'auto-save-file-name-transforms
198 `(".*" ,(etc/ "auto-save/" t) t)) 198 `(".*" ,(etc/ "auto-save/" t) t))
@@ -202,7 +202,12 @@
202 version-control t 202 version-control t
203 kept-new-versions 8 203 kept-new-versions 8
204 kept-old-versions 8 204 kept-old-versions 8
205 delete-old-versions t) 205 delete-old-versions t
206 backup-directory-alist
207 `(("^/dev/shm" . nil)
208 ("^/tmp" . nil)
209 (,(getenv "XDG_RUNTIME_DIR") . nil)
210 ("." . ,(no-littering-expand-etc-file-name "backup"))))
206 211
207(require 'recentf) 212(require 'recentf)
208(setq-default ;; recentf-save-file (etc/ "recentf" t) 213(setq-default ;; recentf-save-file (etc/ "recentf" t)
@@ -213,6 +218,7 @@
213(add-to-list 'recentf-exclude etc/) 218(add-to-list 'recentf-exclude etc/)
214(add-to-list 'recentf-exclude "-autoloads.el\\'") 219(add-to-list 'recentf-exclude "-autoloads.el\\'")
215(add-hook 'buffer-list-update-hook #'recentf-track-opened-file) 220(add-hook 'buffer-list-update-hook #'recentf-track-opened-file)
221(add-hook 'after-save-hook #'recentf-save-list)
216(recentf-mode) 222(recentf-mode)
217 223
218(require 'saveplace) 224(require 'saveplace)
@@ -247,7 +253,8 @@
247(setq-default native-comp-async-report-warnings-errors 'silent 253(setq-default native-comp-async-report-warnings-errors 'silent
248 native-comp-deferred-compilation t 254 native-comp-deferred-compilation t
249 native-compile-target-directory (etc/ "eln" t)) 255 native-compile-target-directory (etc/ "eln" t))
250(add-to-list 'native-comp-eln-load-path native-compile-target-directory) 256(when (boundp 'native-comp-eln-load-path)
257 (add-to-list 'native-comp-eln-load-path native-compile-target-directory))
251(when (fboundp 'startup-redirect-eln-cache) 258(when (fboundp 'startup-redirect-eln-cache)
252 (startup-redirect-eln-cache native-compile-target-directory)) 259 (startup-redirect-eln-cache native-compile-target-directory))
253 260
@@ -373,19 +380,19 @@ When at the beginning of a line, delete blank lines before point."
373(when (fboundp '+lisp-comment-or-uncomment-sexp) 380(when (fboundp '+lisp-comment-or-uncomment-sexp)
374 (define-key lisp-mode-map (kbd "C-M-;") #'+lisp-comment-or-uncomment-sexp) 381 (define-key lisp-mode-map (kbd "C-M-;") #'+lisp-comment-or-uncomment-sexp)
375 (define-key emacs-lisp-mode-map (kbd "C-M-;") 382 (define-key emacs-lisp-mode-map (kbd "C-M-;")
376 #'+lisp-comment-or-uncomment-sexp) 383 #'+lisp-comment-or-uncomment-sexp)
377 (with-eval-after-load 'scheme 384 (with-eval-after-load 'scheme
378 (define-key scheme-mode-map (kbd "C-M-;") 385 (define-key scheme-mode-map (kbd "C-M-;")
379 #'+lisp-comment-or-uncomment-sexp))) 386 #'+lisp-comment-or-uncomment-sexp)))
380 387
381(define-key emacs-lisp-mode-map (kbd "C-c C-c") 388(define-key emacs-lisp-mode-map (kbd "C-c C-c")
382 #'eval-defun) 389 #'eval-defun)
383(define-key emacs-lisp-mode-map (kbd "C-c C-k") 390(define-key emacs-lisp-mode-map (kbd "C-c C-k")
384 #'elisp-eval-region-or-buffer) 391 #'elisp-eval-region-or-buffer)
385(define-key lisp-interaction-mode-map (kbd "C-c C-c") 392(define-key lisp-interaction-mode-map (kbd "C-c C-c")
386 #'eval-defun) 393 #'eval-defun)
387(define-key lisp-interaction-mode-map (kbd "C-c C-k") 394(define-key lisp-interaction-mode-map (kbd "C-c C-k")
388 #'elisp-eval-region-or-buffer) 395 #'elisp-eval-region-or-buffer)
389(define-advice eval-region (:around (orig start end &rest args) pulse) 396(define-advice eval-region (:around (orig start end &rest args) pulse)
390 (apply orig start end args) 397 (apply orig start end args)
391 (pulse-momentary-highlight-region start end)) 398 (pulse-momentary-highlight-region start end))
@@ -432,7 +439,7 @@ When at the beginning of a line, delete blank lines before point."
432 :load-path private/) 439 :load-path private/)
433 440
434(use-package custom-allowed 441(use-package custom-allowed
435 :load-path "/home/case/src/emacs/custom-allowed/" 442 :load-path "~/src/custom-allowed.el/"
436 :config 443 :config
437 (add-to-list 'custom-allowed-variables 'safe-local-variable-values) 444 (add-to-list 'custom-allowed-variables 'safe-local-variable-values)
438 (add-to-list 'custom-allowed-variables 'ispell-buffer-session-localwords) 445 (add-to-list 'custom-allowed-variables 'ispell-buffer-session-localwords)
@@ -445,7 +452,7 @@ When at the beginning of a line, delete blank lines before point."
445 (after-init-hook . custom-allowed-load-custom-file)) 452 (after-init-hook . custom-allowed-load-custom-file))
446 453
447(use-package sophomore 454(use-package sophomore
448 :load-path "/home/case/src/emacs/sophomore/" 455 :load-path "~/src/sophomore.el/"
449 :config 456 :config
450 (sophomore-enable-all) 457 (sophomore-enable-all)
451 (sophomore-disable 'view-hello-file 458 (sophomore-disable 'view-hello-file
@@ -463,7 +470,7 @@ When at the beginning of a line, delete blank lines before point."
463 (setq vertico-cycle t) 470 (setq vertico-cycle t)
464 (add-hook 'vertico-mode-hook 471 (add-hook 'vertico-mode-hook
465 (defun vertico-mode@fix-completions () 472 (defun vertico-mode@fix-completions ()
466 (setopt completion-in-region-function 473 (setq completion-in-region-function
467 (if vertico-mode 474 (if vertico-mode
468 #'consult-completion-in-region 475 #'consult-completion-in-region
469 #'completion--in-region)))) 476 #'completion--in-region))))
@@ -596,15 +603,15 @@ When at the beginning of a line, delete blank lines before point."
596 ;; Optionally make narrowing help available in the minibuffer. 603 ;; Optionally make narrowing help available in the minibuffer.
597 ;; You may want to use `embark-prefix-help-command' or which-key instead. 604 ;; You may want to use `embark-prefix-help-command' or which-key instead.
598 (define-key consult-narrow-map (vconcat consult-narrow-key "?") 605 (define-key consult-narrow-map (vconcat consult-narrow-key "?")
599 #'consult-narrow-help)) 606 #'consult-narrow-help))
600 607
601(use-package orderless 608(use-package orderless
602 :ensure t :demand t 609 :ensure t :demand t
603 :init 610 :init
604 (setopt completion-styles '(orderless substring basic) 611 (setq completion-styles '(orderless substring basic)
605 completion-category-defaults nil 612 completion-category-defaults nil
606 completion-category-overrides 613 completion-category-overrides
607 '((file (styles basic partial-completion orderless))))) 614 '((file (styles basic partial-completion orderless)))))
608 615
609(use-package marginalia 616(use-package marginalia
610 :ensure t :demand t 617 :ensure t :demand t
@@ -618,7 +625,7 @@ When at the beginning of a line, delete blank lines before point."
618 ("M-." . embark-dwim) 625 ("M-." . embark-dwim)
619 ("C-h B" . embark-bindings)) 626 ("C-h B" . embark-bindings))
620 :init 627 :init
621 (setopt prefix-help-command #'embark-prefix-help-command) 628 (setq prefix-help-command #'embark-prefix-help-command)
622 :config 629 :config
623 (add-to-list 'display-buffer-alist 630 (add-to-list 'display-buffer-alist
624 '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" 631 '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
@@ -642,7 +649,7 @@ When at the beginning of a line, delete blank lines before point."
642(use-package undo-fu-session 649(use-package undo-fu-session
643 :ensure t 650 :ensure t
644 :config 651 :config
645 (setopt undo-fu-session-compression (cond 652 (setq undo-fu-session-compression (cond
646 ((executable-find "gunzip") 'gz) 653 ((executable-find "gunzip") 'gz)
647 ((executable-find "bzip2") 'bz2)) 654 ((executable-find "bzip2") 'bz2))
648 undo-fu-session-incompatible-files '("/COMMIT_EDITMSG\\'" 655 undo-fu-session-incompatible-files '("/COMMIT_EDITMSG\\'"
@@ -667,6 +674,7 @@ When at the beginning of a line, delete blank lines before point."
667 ([right-margin double-wheel-up] . pixel-scroll-precision) 674 ([right-margin double-wheel-up] . pixel-scroll-precision)
668 ([right-margin triple-wheel-up] . pixel-scroll-precision)) 675 ([right-margin triple-wheel-up] . pixel-scroll-precision))
669 :config 676 :config
670 (pixel-scroll-precision-mode)) 677 (when (fboundp 'pixel-scroll-precision-mode)
678 (pixel-scroll-precision-mode)))
671 679
672;;; basics.el ends here 680;;; basics.el ends here
diff --git a/early-init.el b/early-init.el index 4b67629..80d91db 100644 --- a/early-init.el +++ b/early-init.el
@@ -34,6 +34,8 @@
34(package-initialize) 34(package-initialize)
35(unless package-archive-contents 35(unless package-archive-contents
36 (package-refresh-contents)) 36 (package-refresh-contents))
37(unless (package-installed-p 'use-package)
38 (package-install 'use-package))
37 39
38(setq use-package-enable-imenu-support t 40(setq use-package-enable-imenu-support t
39 use-package-hook-name-suffix nil) 41 use-package-hook-name-suffix nil)
@@ -47,10 +49,10 @@
47 (when (memq :ensure body) 49 (when (memq :ensure body)
48 (add-to-list 'package-selected-packages name))) 50 (add-to-list 'package-selected-packages name)))
49 51
50(use-package use-package-vc 52;; (use-package use-package-vc
51 :load-path "~/src/emacs/use-package-vc.el/" 53;; :load-path "~/src/emacs/use-package-vc.el/"
52 :config 54;; :config
53 (define-advice package-vc-install (:around (orig &rest args) wtf) 55;; (define-advice package-vc-install (:around (orig &rest args) wtf)
54 "Don't freak out about `package-archives' shit." 56;; "Don't freak out about `package-archives' shit."
55 (let ((package-archives nil)) 57;; (let ((package-archives nil))
56 (apply orig args)))) 58;; (apply orig args))))
diff --git a/init.el b/init.el index d6363ea..707125e 100644 --- a/init.el +++ b/init.el
@@ -21,52 +21,52 @@
21 21
22(use-package emacs ; Misc. config 22(use-package emacs ; Misc. config
23 :config 23 :config
24 (setopt recenter-positions '(top middle bottom) 24 (setq recenter-positions '(top middle bottom)
25 initial-major-mode 'lisp-interaction-mode 25 initial-major-mode 'lisp-interaction-mode
26 initial-scratch-message ";; Emacs!\n\n" 26 initial-scratch-message ";; Emacs!\n\n"
27 ;; (format "%s\n\n" 27 ;; (format "%s\n\n"
28 ;; (mapconcat (lambda (s) (format ";; %s" s)) 28 ;; (mapconcat (lambda (s) (format ";; %s" s))
29 ;; (process-lines "fortune" "-s") 29 ;; (process-lines "fortune" "-s")
30 ;; "\n")) 30 ;; "\n"))
31 eval-expression-print-level nil 31 eval-expression-print-level nil
32 eval-expression-print-length nil 32 eval-expression-print-length nil
33 x-select-enable-clipboard-manager nil) 33 x-select-enable-clipboard-manager nil)
34 ;; TODO: move this ... elsewhere 34 ;; TODO: move this ... elsewhere
35 (setopt mode-line-format 35 (setq mode-line-format
36 '("%e" 36 '("%e"
37 mode-line-front-space 37 mode-line-front-space
38 ;; (:propertize ("" mode-line-mule-info 38 ;; (:propertize ("" mode-line-mule-info
39 ;; mode-line-client 39 ;; mode-line-client
40 ;; mode-line-modified 40 ;; mode-line-modified
41 ;; mode-line-remote) 41 ;; mode-line-remote)
42 ;; display (min-width (5.0))) 42 ;; display (min-width (5.0)))
43 ("" mode-line-mule-info 43 ("" mode-line-mule-info
44 mode-line-client 44 mode-line-client
45 mode-line-modified 45 mode-line-modified
46 mode-line-remote) 46 mode-line-remote)
47 mode-line-frame-identification 47 mode-line-frame-identification
48 mode-line-buffer-identification 48 mode-line-buffer-identification
49 " " 49 " "
50 mode-line-position 50 mode-line-position
51 (vc-mode vc-mode) 51 (vc-mode vc-mode)
52 " " 52 " "
53 minions-mode-line-modes 53 minions-mode-line-modes
54 mode-line-misc-info 54 mode-line-misc-info
55 mode-line-end-spaces)) 55 mode-line-end-spaces))
56 (keymap-global-unset "C-\\") 56 (keymap-global-unset "C-\\")
57 (keymap-global-unset "<f2>") 57 (keymap-global-unset "<f2>")
58 (setf (alist-get "\\*Compile-Log\\*" display-buffer-alist nil nil #'equal) 58 (setf (alist-get "\\*Compile-Log\\*" display-buffer-alist nil nil #'equal)
59 '(display-buffer-no-window)) 59 '(display-buffer-no-window))
60 (add-hook 'after-init-hook 60 ;; (add-hook 'after-init-hook
61 (defun global-mode-string@setup () 61 ;; (defun global-mode-string@setup ()
62 (defvar jabber-activity-mode-string) 62 ;; (defvar jabber-activity-mode-string)
63 (defvar org-mode-line-string) 63 ;; (defvar org-mode-line-string)
64 (defvar display-time-mode) 64 ;; (defvar display-time-mode)
65 (defvar display-time-string) 65 ;; (defvar display-time-string)
66 (setf global-mode-string 66 ;; (setf global-mode-string
67 '((t jabber-activity-mode-string) 67 ;; '((t jabber-activity-mode-string)
68 org-mode-line-string 68 ;; org-mode-line-string
69 (display-time-mode display-time-string))))) 69 ;; (display-time-mode display-time-string)))))
70 (keymap-global-set "C-c t" 70 (keymap-global-set "C-c t"
71 (define-keymap 71 (define-keymap
72 :prefix 'toggle-map 72 :prefix 'toggle-map
@@ -87,23 +87,22 @@
87 "Recursive Mono Casual Static" 87 "Recursive Mono Casual Static"
88 "Comic Code" 88 "Comic Code"
89 "DejaVu Sans Mono") 89 "DejaVu Sans Mono")
90 :height 100))) 90 :height 110)))
91 (face-spec-set 'fixed-pitch 91 (face-spec-set 'fixed-pitch
92 `((t :family ,(find-font 92 `((t :family ,(find-font
93 "Recursive Mono Casual Static" 93 "Recursive Mono Linear Static"
94 "Comic Code" 94 "Comic Code"
95 "DejaVu Sans Mono") 95 "DejaVu Sans Mono")
96 :height 1.0))) 96 :height 1.0)))
97 (face-spec-set 'variable-pitch 97 (face-spec-set 'variable-pitch
98 `((t :family ,(find-font 98 `((t :family ,(find-font
99 "Recursive Sans Linear Static" 99 "Recursive Sans Casual Static"
100 "Atkinson Hyperlegible" 100 "Atkinson Hyperlegible"
101 "DejaVu Serif") 101 "DejaVu Serif")
102 :height 1.0))) 102 :height 1.0)))
103 (face-spec-set 'font-lock-comment-face 103 (face-spec-set 'font-lock-comment-face
104 `((t :inherit variable-pitch))) 104 `((t :slant italic
105 (face-spec-set 'font-lock-string-face 105 :inherit variable-pitch)))
106 `((t :inherit variable-pitch)))
107 ;; Emojis 106 ;; Emojis
108 (cl-loop with ffl = (font-family-list) 107 (cl-loop with ffl = (font-family-list)
109 for font in '("Noto Emoji" "Noto Color Emoji" 108 for font in '("Noto Emoji" "Noto Color Emoji"
@@ -147,8 +146,11 @@
147 146
148(use-package prog-mode 147(use-package prog-mode
149 :config 148 :config
150 (setopt tab-width 8 149 ;;; TABS
151 sh-indentation tab-width) 150 (setq tab-width 8
151 sh-indentation tab-width
152 )
153 ;;; Hooks
152 (add-hook 'prog-mode-hook #'auto-fill-mode) 154 (add-hook 'prog-mode-hook #'auto-fill-mode)
153 (add-hook 'prog-mode-hook 155 (add-hook 'prog-mode-hook
154 (defun prog@indent-tabs-maybe () 156 (defun prog@indent-tabs-maybe ()
@@ -158,11 +160,12 @@
158 'scheme-mode 160 'scheme-mode
159 'python-mode 161 'python-mode
160 'haskell-mode) 162 'haskell-mode)
161 -1 1))))) 163 -1 1))))
164 (global-prettify-symbols-mode))
162 165
163(use-package auth-source 166(use-package auth-source
164 :config 167 :config
165 (setopt auth-sources '(default "secrets:passwords")) 168 (setq auth-sources '(default "secrets:passwords"))
166 (add-hook 'auth-info-hook #'truncate-lines-local-mode)) 169 (add-hook 'auth-info-hook #'truncate-lines-local-mode))
167 170
168(use-package fringe 171(use-package fringe
@@ -171,7 +174,7 @@
171 174
172(use-package ispell 175(use-package ispell
173 :config 176 :config
174 (setopt ispell-program-name (choose-executable "aspell" "ispell")) 177 (setq ispell-program-name (choose-executable "aspell" "ispell"))
175 ;; (add-hook 'before-save-hook 178 ;; (add-hook 'before-save-hook
176 ;; #'+ispell-move-buffer-words-to-dir-locals-hook) 179 ;; #'+ispell-move-buffer-words-to-dir-locals-hook)
177 (put 'ispell-buffer-session-localwords 'safe-local-variable 180 (put 'ispell-buffer-session-localwords 'safe-local-variable
@@ -185,23 +188,23 @@
185 ("<backspace>" . dired-up-directory)) 188 ("<backspace>" . dired-up-directory))
186 :config 189 :config
187 (require 'dired-x) 190 (require 'dired-x)
188 (setopt dired-recursive-copies 'always 191 (setq dired-recursive-copies 'always
189 dired-recursive-deletes 'always 192 dired-recursive-deletes 'always
190 dired-create-destination-dirs 'always 193 dired-create-destination-dirs 'always
191 dired-do-revert-buffer t 194 dired-do-revert-buffer t
192 dired-hide-details-hide-symlink-targets nil 195 dired-hide-details-hide-symlink-targets nil
193 dired-isearch-filenames 'dwim 196 dired-isearch-filenames 'dwim
194 delete-by-moving-to-trash t 197 delete-by-moving-to-trash t
195 dired-auto-revert-buffer t 198 dired-auto-revert-buffer t
196 dired-listing-switches "-AlFhv --group-directories-first" 199 dired-listing-switches "-AlFhv --group-directories-first"
197 ls-lisp-dirs-first t 200 ls-lisp-dirs-first t
198 dired-ls-F-marks-symlinks t 201 dired-ls-F-marks-symlinks t
199 dired-clean-confirm-killing-deleted-buffers nil 202 dired-clean-confirm-killing-deleted-buffers nil
200 dired-no-confirm '(byte-compile 203 dired-no-confirm '(byte-compile
201 load chgrp chmod chown 204 load chgrp chmod chown
202 copy move hardlink symlink 205 copy move hardlink symlink
203 shell touch) 206 shell touch)
204 dired-dwim-target t) 207 dired-dwim-target t)
205 (add-hook 'dired-mode-hook #'dired-hide-details-mode) 208 (add-hook 'dired-mode-hook #'dired-hide-details-mode)
206 (add-hook 'dired-mode-hook #'hl-line-mode) 209 (add-hook 'dired-mode-hook #'hl-line-mode)
207 (add-hook 'dired-mode-hook #'truncate-lines-local-mode)) 210 (add-hook 'dired-mode-hook #'truncate-lines-local-mode))
@@ -226,43 +229,68 @@
226 229
227(use-package mouse 230(use-package mouse
228 :config 231 :config
229 (setopt context-menu-functions '(context-menu-undo 232 (setq context-menu-functions '(context-menu-undo
230 context-menu-region 233 context-menu-region
231 context-menu-middle-separator 234 context-menu-middle-separator
232 context-menu-local 235 context-menu-local
233 context-menu-minor)) 236 context-menu-minor))
234 (context-menu-mode)) 237 (context-menu-mode))
235 238
236(use-package password-cache 239(use-package password-cache
237 :config 240 :config
238 (setopt password-cache t 241 (setq password-cache t
239 password-cache-expiry 3600)) 242 password-cache-expiry 3600))
240 243
241(use-package time 244(use-package time
242 :config 245 :config
243 (setopt display-time-format " %H:%M" 246 (setq display-time-format " %H:%M"
244 display-time-interval 60 247 display-time-interval 60
245 display-time-use-mail-icon t 248 display-time-use-mail-icon t
246 display-time-mail-function 249 display-time-mail-function
247 (defun +notmuch-new-mail-p () 250 (defun +notmuch-new-mail-p ()
248 (plist-get (cl-find "inbox+unread" 251 (plist-get (cl-find "inbox+unread"
249 (ignore-errors 252 (ignore-errors
250 (notmuch-hello-query-counts notmuch-saved-searches)) 253 (notmuch-hello-query-counts notmuch-saved-searches))
251 :key (lambda (l) (plist-get l :name)) 254 :key (lambda (l) (plist-get l :name))
252 :test #'equal) 255 :test #'equal)
253 :count)) 256 :count))
254 display-time-default-load-average nil) 257 display-time-default-load-average nil)
255 (with-eval-after-load 'notmuch 258 (with-eval-after-load 'notmuch
256 (add-hook 'notmuch-after-tag-hook #'display-time-update)) 259 (add-hook 'notmuch-after-tag-hook #'display-time-update))
257 (display-time-mode)) 260 ;; (display-time-mode)
261 )
258 262
259(use-package tab-bar 263(use-package tab-bar
260 :config 264 :config
261 (setopt tab-bar-show t 265 (setq tab-bar-show t
262 tab-bar-close-button-show t) 266 tab-bar-close-button-show t)
263 ;; (add-to-list 'tab-bar-format 'tab-bar-format-menu-bar) 267 (setopt tab-bar-format
264 (add-to-list 'tab-bar-format 'tab-bar-format-align-right :append) 268 `(tab-bar-format-history
265 (add-to-list 'tab-bar-format 'tab-bar-format-global :append) 269 tab-bar-format-tabs
270 tab-bar-separator
271 tab-bar-format-add-tab
272 tab-bar-format-align-right
273 ,(defun tab-bar-extra-info ()
274 `((global menu-item
275 ,(format-mode-line
276 '((jabber-activity-mode jabber-activity-mode-string)
277 (:eval (when (and (fboundp 'org-clocking-p)
278 (org-clocking-p))
279 (format " %s"
280 (truncate-string-to-width
281 org-mode-line-string
282 16
283 nil
284 nil
285 (truncate-string-ellipsis)))))
286 (:eval (tmr-mode-line))
287 (display-time-mode
288 (:eval (format " %s" (string-trim display-time-string))))
289 ("" " ")))
290 ignore))))
291 mode-line-misc-info (cl-delete-if (lambda (x)
292 (eq (car x) 'global-mode-string))
293 mode-line-misc-info))
266 (if (daemonp) 294 (if (daemonp)
267 (add-hook 'server-after-make-frame-hook 295 (add-hook 'server-after-make-frame-hook
268 (defun after-frame@tab-bar () 296 (defun after-frame@tab-bar ()
@@ -306,7 +334,7 @@
306 334
307(use-package eldoc 335(use-package eldoc
308 :config 336 :config
309 (setopt eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly) 337 (setq eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly)
310 (setf (alist-get "^\\*eldoc for" display-buffer-alist nil nil #'equal) 338 (setf (alist-get "^\\*eldoc for" display-buffer-alist nil nil #'equal)
311 '(display-buffer-at-bottom 339 '(display-buffer-at-bottom
312 (window-height . 4))) 340 (window-height . 4)))
@@ -314,15 +342,15 @@
314 342
315(use-package pulse 343(use-package pulse
316 :config 344 :config
317 (setopt pulse-flag nil 345 (setq pulse-flag nil
318 pulse-delay 1 346 pulse-delay 1
319 pulse-iterations 1)) 347 pulse-iterations 1))
320 348
321(use-package flyspell 349(use-package flyspell
322 :hook (org-mode-hook)) 350 :hook (org-mode-hook))
323 351
324(use-package display-fill-column-indicator 352;; (use-package display-fill-column-indicator
325 :hook (prog-mode-hook)) 353;; :hook (prog-mode-hook))
326 354
327(use-package package 355(use-package package
328 :config 356 :config
@@ -382,6 +410,23 @@ See `inferior-emacs-lisp-mode' for details."
382 (add-hook 'ielm-mode-hook #'+ielm-init-history) 410 (add-hook 'ielm-mode-hook #'+ielm-init-history)
383 (advice-add 'ielm-send-input :after #'+ielm-write-history)) 411 (advice-add 'ielm-send-input :after #'+ielm-write-history))
384 412
413(use-package elec-pair
414 :config
415 (setopt electric-pair-skip-whitespace 'chomp)
416 (electric-pair-mode))
417
418(use-package bookmark
419 :config
420 (setopt bookmark-save-flag 1))
421
422(use-package sh-script
423 :config
424 (sh-electric-here-document-mode -1))
425
426(use-package cc-mode
427 :config
428 (setopt c-basic-offset 8))
429
385 430
386;;; Applications 431;;; Applications
387 432
@@ -413,7 +458,7 @@ See `inferior-emacs-lisp-mode' for details."
413(use-package +scratch 458(use-package +scratch
414 :load-path "lisp/" 459 :load-path "lisp/"
415 :config 460 :config
416 (setopt +scratch-save-dir (sync/ "emacs/scratch.d/" t)) 461 (setq +scratch-save-dir (sync/ "emacs/scratch.d/" t))
417 (add-hook 'kill-buffer-query-functions #'+scratch@immortal) 462 (add-hook 'kill-buffer-query-functions #'+scratch@immortal)
418 (add-hook 'kill-emacs-hook #'+scratch-save-on-exit) 463 (add-hook 'kill-emacs-hook #'+scratch-save-on-exit)
419 (with-current-buffer (get-scratch-buffer-create) 464 (with-current-buffer (get-scratch-buffer-create)
@@ -424,21 +469,14 @@ See `inferior-emacs-lisp-mode' for details."
424 (run-at-time t (* 60 60 24) #'+scratch-clean)) 469 (run-at-time t (* 60 60 24) #'+scratch-clean))
425 470
426(use-package pulse-location 471(use-package pulse-location
427 :load-path "~/src/emacs/pulse-location/" 472 :load-path "~/src/pulse-location.el/"
428 :config 473 :config
429 (pulse-location-mode)) 474 (pulse-location-mode))
430 475
431(use-package dawn 476(use-package emacs ; `modus-themes' isn't a package ...
432 :load-path "~/src/emacs/dawn/"
433 :after custom-allowed
434 :config 477 :config
435 (add-hook 'custom-allowed-after-load-hook
436 (defun dawn-modus ()
437 (dawn-schedule-themes 'modus-operandi
438 'modus-vivendi)))
439 (setopt modus-themes-mixed-fonts t) 478 (setopt modus-themes-mixed-fonts t)
440 (load-theme 'modus-vivendi t) 479 (add-hook 'modus-themes-after-load-theme-hook
441 (add-hook 'dawn-after-load-theme-hook
442 (defun +reset-faces () 480 (defun +reset-faces ()
443 (dolist (face '(font-lock-regexp-face 481 (dolist (face '(font-lock-regexp-face
444 font-lock-variable-name-face 482 font-lock-variable-name-face
@@ -469,23 +507,28 @@ See `inferior-emacs-lisp-mode' for details."
469 :weight bold))) 507 :weight bold)))
470 (face-spec-set 'font-lock-doc-face 508 (face-spec-set 'font-lock-doc-face
471 '((t :slant italic))))) 509 '((t :slant italic)))))
472 (+reset-faces)) 510 (add-hook 'after-init-hook
511 (defun modus@load ()
512 (+reset-faces)
513 (pcase (string-trim (shell-command-to-string "darkman get"))
514 ("light" (load-theme 'modus-operandi t))
515 ("dark" (load-theme 'modus-vivendi t))))))
473 516
474(use-package electric-cursor 517(use-package electric-cursor
475 :load-path "~/src/emacs/electric-cursor/" 518 :load-path "~/src/electric-cursor.el/"
476 :config 519 :config
477 (setopt electric-cursor-alist '((overwrite-mode . box) 520 (setq electric-cursor-alist '((overwrite-mode . box)
478 (t . bar))) 521 (t . bar)))
479 (electric-cursor-mode)) 522 (electric-cursor-mode))
480 523
481(use-package mode-line-bell 524(use-package mode-line-bell
482 :load-path "~/src/emacs/mode-line-bell/" 525 :load-path "~/src/mode-line-bell.el/"
483 :config 526 :config
484 (setopt mode-line-bell-flash-time 0.25) 527 (setq mode-line-bell-flash-time 0.25)
485 (mode-line-bell-mode)) 528 (mode-line-bell-mode))
486 529
487(use-package titlecase 530(use-package titlecase
488 :load-path "~/src/emacs/titlecase.el/" 531 :load-path "~/src/titlecase.el/"
489 :preface 532 :preface
490 (defun +titlecase-sentence-style-dwim (&optional arg) 533 (defun +titlecase-sentence-style-dwim (&optional arg)
491 "Titlecase a sentence. 534 "Titlecase a sentence.
@@ -515,7 +558,7 @@ With prefix ARG, toggle the value of
515 (keymap-set scule-map "M-t" #'titlecase-dwim))) 558 (keymap-set scule-map "M-t" #'titlecase-dwim)))
516 559
517(use-package scule 560(use-package scule
518 :load-path "~/src/emacs/scule/" 561 :load-path "~/src/scule.el/"
519 :bind-keymap ("M-c" . scule-map) 562 :bind-keymap ("M-c" . scule-map)
520 :init 563 :init
521 ;; Use M-u for prefix keys 564 ;; Use M-u for prefix keys
@@ -523,23 +566,23 @@ With prefix ARG, toggle the value of
523 (keymap-set universal-argument-map "M-u" #'universal-argument-more)) 566 (keymap-set universal-argument-map "M-u" #'universal-argument-more))
524 567
525(use-package filldent 568(use-package filldent
526 :load-path "~/src/emacs/filldent/" 569 :load-path "~/src/filldent.el/"
527 :bind ("M-q" . filldent-dwim) 570 :bind ("M-q" . filldent-dwim)
528 :config 571 :config
529 (setopt filldent-fill-modes '(web-mode))) 572 (setq filldent-fill-modes '(web-mode)))
530 573
531(use-package frowny 574(use-package frowny
532 :load-path "~/src/emacs/frowny/" 575 :load-path "~/src/frowny.el/"
533 :config 576 :config
534 (global-frowny-mode)) 577 (global-frowny-mode))
535 578
536(use-package keepassxc-shim 579(use-package keepassxc-shim
537 :load-path "~/src/emacs/keepassxc-shim/" 580 :load-path "~/src/keepassxc-shim.el/"
538 :config 581 :config
539 (keepassxc-shim-activate)) 582 (keepassxc-shim-activate))
540 583
541(use-package hippie-completing-read 584(use-package hippie-completing-read
542 :load-path "~/src/emacs/hippie-completing-read/" 585 :load-path "~/src/hippie-completing-read.el/"
543 :bind (("M-/" . hippie-completing-read))) 586 :bind (("M-/" . hippie-completing-read)))
544 587
545 588
@@ -549,7 +592,7 @@ With prefix ARG, toggle the value of
549 :ensure t 592 :ensure t
550 :config 593 :config
551 ;; https://github.com/jwiegley/emacs-async/issues/64 594 ;; https://github.com/jwiegley/emacs-async/issues/64
552 ;; (setopt message-send-mail-function #'async-smtpmail-send-it) 595 ;; (setq message-send-mail-function #'async-smtpmail-send-it)
553 (dired-async-mode) 596 (dired-async-mode)
554 (async-bytecomp-package-mode)) 597 (async-bytecomp-package-mode))
555 598
@@ -560,11 +603,11 @@ With prefix ARG, toggle the value of
560 :ensure t 603 :ensure t
561 :hook (prog-mode-hook)) 604 :hook (prog-mode-hook))
562 605
563(use-package clean-kill-ring 606;; (use-package clean-kill-ring
564 :vc (:url "https://github.com/NicholasBHubbard/clean-kill-ring.el") 607;; :vc (:url "https://github.com/NicholasBHubbard/clean-kill-ring.el")
565 :config 608;; :config
566 (setopt clean-kill-ring-prevent-duplicates t) 609;; (setq clean-kill-ring-prevent-duplicates t)
567 (clean-kill-ring-mode)) 610;; (clean-kill-ring-mode))
568 611
569(use-package minions 612(use-package minions
570 :ensure t 613 :ensure t
@@ -641,7 +684,7 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
641(use-package wgrep 684(use-package wgrep
642 :ensure t 685 :ensure t
643 :config 686 :config
644 (setopt wgrep-enable-key (kbd "C-x C-q")) 687 (setq wgrep-enable-key (kbd "C-x C-q"))
645 :bind (:map grep-mode-map 688 :bind (:map grep-mode-map
646 ("C-x C-q" . wgrep-change-to-wgrep-mode))) 689 ("C-x C-q" . wgrep-change-to-wgrep-mode)))
647 690
@@ -651,8 +694,8 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
651 :map isearch-mode-map 694 :map isearch-mode-map
652 ("M-j" . avy-isearch)) 695 ("M-j" . avy-isearch))
653 :config 696 :config
654 (setopt avy-background t 697 (setq avy-background t
655 avy-keys (string-to-list "asdfghjklqwertyuiopzxcvbnm"))) 698 avy-keys (string-to-list "asdfghjklqwertyuiopzxcvbnm")))
656 699
657(use-package zzz-to-char 700(use-package zzz-to-char
658 :ensure t 701 :ensure t
@@ -666,11 +709,11 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
666(use-package isearch-mb 709(use-package isearch-mb
667 :ensure t 710 :ensure t
668 :config 711 :config
669 (setopt isearch-lazy-count t 712 (setq isearch-lazy-count t
670 isearch-regexp-lax-whitespace t 713 isearch-regexp-lax-whitespace t
671 search-whitespace-regexp "\\W+" 714 search-whitespace-regexp "\\W+"
672 search-default-mode t ; Search regexp by default 715 search-default-mode t ; Search regexp by default
673 isearch-wrap-pause 'no) 716 isearch-wrap-pause 'no)
674 (define-advice isearch-cancel (:before (&rest _) add-search-to-history) 717 (define-advice isearch-cancel (:before (&rest _) add-search-to-history)
675 "Add search string to history when canceling." 718 "Add search string to history when canceling."
676 (unless (equal "" isearch-string) 719 (unless (equal "" isearch-string)
@@ -702,46 +745,46 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
702 "C-M-%" #'anzu-isearch-query-replace) 745 "C-M-%" #'anzu-isearch-query-replace)
703 (isearch-mb-mode)) 746 (isearch-mb-mode))
704 747
705(use-package paredit 748;; (use-package paredit
706 :ensure t 749;; :ensure t
707 :hook ( emacs-lisp-mode-hook ielm-mode-hook 750;; :hook ( emacs-lisp-mode-hook ielm-mode-hook
708 eval-expression-minibuffer-setup-hook 751;; eval-expression-minibuffer-setup-hook
709 lisp-interaction-mode-hook 752;; lisp-interaction-mode-hook
710 lisp-mode-hook scheme-mode-hook 753;; lisp-mode-hook scheme-mode-hook
711 fennel-mode-hook fennel-repl-mode-hook 754;; fennel-mode-hook fennel-repl-mode-hook
712 geiser-mode-hook geiser-repl-mode-hook) 755;; geiser-mode-hook geiser-repl-mode-hook)
713 :config 756;; :config
714 (keymap-set paredit-mode-map "C-j" 757;; (keymap-set paredit-mode-map "C-j"
715 (defun +paredit-newline () 758;; (defun +paredit-newline ()
716 (interactive) 759;; (interactive)
717 (call-interactively 760;; (call-interactively
718 (if (derived-mode-p 'lisp-interaction-mode) 761;; (if (derived-mode-p 'lisp-interaction-mode)
719 #'eval-print-last-sexp #'paredit-newline)))) 762;; #'eval-print-last-sexp #'paredit-newline))))
720 (keymap-unset paredit-mode-map "RET" t) 763;; (keymap-unset paredit-mode-map "RET" t)
721 (keymap-unset paredit-mode-map "M-s" t) 764;; (keymap-unset paredit-mode-map "M-s" t)
722 (keymap-unset paredit-mode-map "M-r" t) 765;; (keymap-unset paredit-mode-map "M-r" t)
723 (add-to-list 'paredit-space-for-delimiter-predicates 766;; (add-to-list 'paredit-space-for-delimiter-predicates
724 (defun paredit@dont-space-@ (endp delimiter) 767;; (defun paredit@dont-space-@ (endp delimiter)
725 "Don't add a space after @ in `paredit-mode'." 768;; "Don't add a space after @ in `paredit-mode'."
726 (let ((point (point))) 769;; (let ((point (point)))
727 (or endp 770;; (or endp
728 (seq-every-p 771;; (seq-every-p
729 (lambda (prefix) 772;; (lambda (prefix)
730 (and (> point (length prefix)) 773;; (and (> point (length prefix))
731 (let ((start (- point (length prefix))) 774;; (let ((start (- point (length prefix)))
732 (end point)) 775;; (end point))
733 (not (string= (buffer-substring start end) 776;; (not (string= (buffer-substring start end)
734 prefix))))) 777;; prefix)))))
735 ;; Add strings to this list to inhibit adding a space 778;; ;; Add strings to this list to inhibit adding a space
736 ;; after them. 779;; ;; after them.
737 '(",@"))))))) 780;; '(",@")))))))
738 781
739(use-package hungry-delete 782(use-package hungry-delete
740 :ensure t 783 :ensure t
741 :config 784 :config
742 (setopt hungry-delete-chars-to-skip " \t" 785 (setq hungry-delete-chars-to-skip " \t"
743 hungry-delete-skip-regexp (format "[%s]" hungry-delete-chars-to-skip) 786 hungry-delete-skip-regexp (format "[%s]" hungry-delete-chars-to-skip)
744 hungry-delete-join-reluctantly nil) 787 hungry-delete-join-reluctantly nil)
745 (add-to-list 'hungry-delete-except-modes 'eshell-mode) 788 (add-to-list 'hungry-delete-except-modes 'eshell-mode)
746 (add-to-list 'hungry-delete-except-modes 'nim-mode) 789 (add-to-list 'hungry-delete-except-modes 'nim-mode)
747 (add-to-list 'hungry-delete-except-modes 'python-mode) 790 (add-to-list 'hungry-delete-except-modes 'python-mode)
@@ -758,9 +801,9 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
758 (interactive "*p") 801 (interactive "*p")
759 (if (looking-at hungry-delete-skip-regexp) 802 (if (looking-at hungry-delete-skip-regexp)
760 (hungry-delete-forward (or arg 1)) 803 (hungry-delete-forward (or arg 1))
761 (paredit-forward-delete arg)))) 804 (paredit-forward-delete arg)))))
762 ;; Mode 805 ;; Mode
763 (global-hungry-delete-mode))) 806 (global-hungry-delete-mode))
764 807
765(use-package macrostep 808(use-package macrostep
766 :ensure t 809 :ensure t
@@ -777,7 +820,7 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
777 :ensure t 820 :ensure t
778 :when inferior-lisp-program 821 :when inferior-lisp-program
779 :preface 822 :preface
780 (setopt inferior-lisp-program (choose-executable "sbcl")) 823 (setq inferior-lisp-program (choose-executable "sbcl"))
781 (defun +sly-start-or-mrepl () 824 (defun +sly-start-or-mrepl ()
782 (interactive) 825 (interactive)
783 (if (ignore-errors (sly-connection)) 826 (if (ignore-errors (sly-connection))
@@ -787,7 +830,7 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
787 :config 830 :config
788 (autoload 'sly-mrepl "sly-mrepl" nil t) 831 (autoload 'sly-mrepl "sly-mrepl" nil t)
789 (keymap-set sly-mode-map "C-c C-z" #'+sly-start-or-mrepl) 832 (keymap-set sly-mode-map "C-c C-z" #'+sly-start-or-mrepl)
790 (setopt sly-net-coding-system 'utf-8-unix) 833 (setq sly-net-coding-system 'utf-8-unix)
791 (sly-symbol-completion-mode -1)) 834 (sly-symbol-completion-mode -1))
792 835
793(use-package pdf-tools 836(use-package pdf-tools
@@ -825,9 +868,9 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
825 :ensure t 868 :ensure t
826 :mode "\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'" 869 :mode "\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'"
827 :config 870 :config
828 (setopt markdown-command (choose-executable 871 (setq markdown-command (choose-executable
829 '("pandoc" "--from=markdown" "--to=html5") 872 '("pandoc" "--from=markdown" "--to=html5")
830 "markdown")) 873 "markdown"))
831 (add-hook 'markdown-mode-hook #'visual-fill-column-mode)) 874 (add-hook 'markdown-mode-hook #'visual-fill-column-mode))
832 875
833(use-package pandoc-mode 876(use-package pandoc-mode
@@ -864,31 +907,44 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
864 :bind (("C-c r p" . eradio-toggle|play) 907 :bind (("C-c r p" . eradio-toggle|play)
865 ("C-c r s" . eradio-stop)) 908 ("C-c r s" . eradio-stop))
866 :config 909 :config
867 (setopt eradio-player '("mpv" "--no-video" "--no-terminal") 910 (setq eradio-player '("mpv" "--no-video" "--no-terminal")
868 eradio-channels 911 eradio-channels
869 ;; At some point I should actually ... write this in to this file or 912 ;; (name . url)
870 ;; something. But until I decide to quit using radish altogether, this 913 '(("Nightwave Plaza" . "http://radio.plaza.one/ogg")
871 ;; what I got. 914 ("Radio Paradise - Main Mix" .
872 (with-current-buffer (find-file-noselect "~/etc/radish/stations") 915 "http://stream.radioparadise.com/rp_192m.ogg")
873 (let (chans) 916 ("Radio Paradise - Mellow Mix" .
874 (dolist (line (string-split (buffer-substring-no-properties 917 "http://stream.radioparadise.com/mellow-96m.ogg")
875 (point-min) (point-max)) 918 ("Radio Paradise - Rock Mix" .
876 "\n") 919 "http://stream.radioparadise.com/rock-96m.ogg")
877 chans) 920 ("Radio Paradise - Global Mix" .
878 (unless (string-match-p "^#" line) 921 "http://stream.radioparadise.com/global-96m.ogg")
879 (let* ((ll (string-split line "\t")) 922 ("KLSU" . "http://130.39.238.143:8010/stream.mp3"))
880 (url (cl-first ll)) 923 ;; At some point I should actually ... write this in to this file or
881 (name (cl-second ll)) 924 ;; something. But until I decide to quit using radish altogether, this
882 (tags (cl-third ll))) 925 ;; what I got.
883 (when (and name 926 ;; (with-current-buffer (find-file-noselect "~/etc/radish/stations")
884 (string-match-p "[^ \n\t]*://[^ \n\t]*" url)) 927 ;; (let (chans)
885 (push (cons (format "%s - %s" name tags) url) chans))))))))) 928 ;; (dolist (line (string-split (buffer-substring-no-properties
929 ;; (point-min) (point-max))
930 ;; "\n")
931 ;; chans)
932 ;; (unless (string-match-p "^#" line)
933 ;; (let* ((ll (string-split line "\t"))
934 ;; (url (cl-first ll))
935 ;; (name (cl-second ll))
936 ;; (tags (cl-third ll)))
937 ;; (when (and name
938 ;; (string-match-p "[^ \n\t]*://[^ \n\t]*" url))
939 ;; (push (cons (format "%s - %s" name tags) url)
940 ;; chans)))))))
941 ))
886 942
887(use-package wiki-abbrev 943(use-package wiki-abbrev
888 :after org ; Don't need abbrevs til I load org. 944 :after org ; Don't need abbrevs til I load org.
889 :load-path "~/src/emacs/wiki-abbrev.el/" 945 :load-path "~/src/wiki-abbrev.el/"
890 :config 946 :config
891 (setopt wiki-abbrev-file (etc/ "wiki-abbrevs")) 947 (setq wiki-abbrev-file (etc/ "wiki-abbrevs"))
892 (wiki-abbrev-insinuate)) 948 (wiki-abbrev-insinuate))
893 949
894(use-package flyspell-correct 950(use-package flyspell-correct
@@ -931,7 +987,7 @@ With PREFIX, prompt to change the current dictionary."
931 :bind (:map dired-mode-map 987 :bind (:map dired-mode-map
932 (")" . dired-git-info-mode)) 988 (")" . dired-git-info-mode))
933 :config 989 :config
934 (setopt dgi-auto-hide-details-p nil)) 990 (setq dgi-auto-hide-details-p nil))
935 991
936(use-package expand-region ; needed for embrace anyway 992(use-package expand-region ; needed for embrace anyway
937 :ensure t 993 :ensure t
@@ -963,7 +1019,7 @@ With PREFIX, prompt to change the current dictionary."
963 (keymap-set org-mode-map "=" (org-insert-or-embrace "=")) 1019 (keymap-set org-mode-map "=" (org-insert-or-embrace "="))
964 (keymap-set org-mode-map "~" (org-insert-or-embrace "~")) 1020 (keymap-set org-mode-map "~" (org-insert-or-embrace "~"))
965 (keymap-set org-mode-map "+" (org-insert-or-embrace "+"))) 1021 (keymap-set org-mode-map "+" (org-insert-or-embrace "+")))
966 :bind (("C-\"" . embrace-commander)) 1022 :bind (("C-'" . embrace-commander))
967 :hook ((org-mode-hook . embrace-org-mode-hook) 1023 :hook ((org-mode-hook . embrace-org-mode-hook)
968 (ruby-mode-hook . embrace-ruby-mode-hook) 1024 (ruby-mode-hook . embrace-ruby-mode-hook)
969 (emacs-lisp-mode-hook . embrace-emacs-lisp-mode-hook) 1025 (emacs-lisp-mode-hook . embrace-emacs-lisp-mode-hook)
@@ -972,7 +1028,7 @@ With PREFIX, prompt to change the current dictionary."
972(use-package apheleia 1028(use-package apheleia
973 :ensure t 1029 :ensure t
974 :config 1030 :config
975 (setopt apheleia-hide-log-buffers t) 1031 (setq apheleia-hide-log-buffers t)
976 (setf (alist-get 'shfmt apheleia-formatters) 1032 (setf (alist-get 'shfmt apheleia-formatters)
977 '("shfmt" "--case-indent")) 1033 '("shfmt" "--case-indent"))
978 (global-set-key (kbd "M-C-\\") 1034 (global-set-key (kbd "M-C-\\")
@@ -997,44 +1053,24 @@ With PREFIX, prompt to change the current dictionary."
997(use-package rec-mode 1053(use-package rec-mode
998 :ensure t) 1054 :ensure t)
999 1055
1000;; (use-package gauche-mode
1001;; :load-path "~/src/emacs/gauche-mode/"
1002;; :mode "\\.scm\\'"
1003;; :config
1004;; (setopt gauche-mode-info-language 'en
1005;; scheme-program-name "gosh -i"
1006;; scheme-compile-exp-command "%s")
1007;; (add-to-list 'scheme-source-modes 'gauche-mode)
1008;; (setf (alist-get "\\*scheme\\*" display-buffer-alist nil nil #'equal)
1009;; '((display-buffer-reuse-window
1010;; display-buffer-pop-up-window)
1011;; (inhibit-same-window . t)))
1012;; (add-hook 'gauche-mode-hook #'enable-gauche-paredit-mode)
1013;; (add-hook 'inferior-scheme-mode-hook #'enable-gauche-paredit-mode)
1014;; ;; Extras
1015;; (define-key gauche-mode-map (kbd "C-c C-k")
1016;; (defun +gauche-mode-send-buffer ()
1017;; (interactive)
1018;; (save-mark-and-excursion
1019;; (let ((start (point-min))
1020;; (end (point-max)))
1021;; (goto-char start)
1022;; (while (or (looking-at "#!") ; Shebang
1023;; (looking-at ":;") ; "shell trampoline"
1024;; )
1025;; (forward-line 1)
1026;; (beginning-of-line)
1027;; (setq start (point)))
1028;; (scheme-send-region-and-go start end))))))
1029 1056
1030(use-package geiser 1057(use-package geiser
1031 :ensure t 1058 :ensure t
1032 :config 1059 :config
1033 (use-package geiser-guile :ensure t) 1060 (when (executable-find "guile")
1034 (use-package geiser-chicken :ensure t) 1061 (use-package geiser-guile :ensure t))
1035 (use-package geiser-chez :ensure t) 1062 (when (executable-find "chicken")
1036 (use-package geiser-gambit :ensure t) 1063 (use-package geiser-chicken :ensure t))
1037 (use-package geiser-chibi :ensure t) 1064 (when (or (prog1 (executable-find "chez")
1065 (setopt geiser-chez-binary
1066 (executable-find "chez")))
1067 (executable-find "petite")
1068 (executable-find "scheme"))
1069 (use-package geiser-chez :ensure t))
1070 (when (executable-find "gambit")
1071 (use-package geiser-gambit :ensure t))
1072 (when (executable-find "chibi-scheme")
1073 (use-package geiser-chibi :ensure t))
1038 (use-package macrostep-geiser 1074 (use-package macrostep-geiser
1039 :ensure t 1075 :ensure t
1040 :config 1076 :config
@@ -1047,21 +1083,6 @@ With PREFIX, prompt to change the current dictionary."
1047 (keymap-unset geiser-mode-map "C-." t) 1083 (keymap-unset geiser-mode-map "C-." t)
1048 (keymap-unset scheme-mode-map "M-o" t))) 1084 (keymap-unset scheme-mode-map "M-o" t)))
1049 1085
1050(use-package treesit-auto
1051 ;; XXX: I don't really get the utility of this package, but I spent a ton of
1052 ;; time figuring out how to properly build it ... so here it is.
1053 :ensure t
1054 :when (treesit-available-p)
1055 :config
1056 ;; (setopt treesit-extra-load-path
1057 ;; ;; https://github.com/casouri/tree-sitter-module/
1058 ;; `(,(expand-file-name "~/misc/tree-sitter-module/dist/")))
1059 (setopt treesit-auto-install nil) ; javascript keeps failing
1060 (global-treesit-auto-mode))
1061
1062(use-package elpher
1063 :ensure t)
1064
1065(use-package detached 1086(use-package detached
1066 :when (executable-find "dtach") 1087 :when (executable-find "dtach")
1067 :ensure t 1088 :ensure t
@@ -1078,33 +1099,33 @@ With PREFIX, prompt to change the current dictionary."
1078(use-package lin 1099(use-package lin
1079 :ensure t 1100 :ensure t
1080 :config 1101 :config
1081 (setopt lin-face 'lin-cyan 1102 (setq lin-face 'lin-cyan
1082 lin-mode-hooks 1103 lin-mode-hooks
1083 '(dired-mode-hook 1104 '(dired-mode-hook
1084 ;; bongo-mode-hook 1105 ;; bongo-mode-hook
1085 ;; elfeed-search-mode-hook 1106 ;; elfeed-search-mode-hook
1086 git-rebase-mode-hook 1107 git-rebase-mode-hook
1087 grep-mode-hook 1108 grep-mode-hook
1088 ibuffer-mode-hook 1109 ibuffer-mode-hook
1089 ilist-mode-hook 1110 ilist-mode-hook
1090 ;; ledger-report-mode-hook 1111 ;; ledger-report-mode-hook
1091 log-view-mode-hook 1112 log-view-mode-hook
1092 magit-log-mode-hook 1113 magit-log-mode-hook
1093 ;; mu4e-headers-mode-hook 1114 ;; mu4e-headers-mode-hook
1094 notmuch-search-mode-hook 1115 notmuch-search-mode-hook
1095 notmuch-tree-mode-hook 1116 notmuch-tree-mode-hook
1096 occur-mode-hook 1117 occur-mode-hook
1097 org-agenda-mode-hook 1118 org-agenda-mode-hook
1098 pdf-outline-buffer-mode-hook 1119 pdf-outline-buffer-mode-hook
1099 proced-mode-hook 1120 proced-mode-hook
1100 tabulated-list-mode-hook)) 1121 tabulated-list-mode-hook))
1101 (lin-global-mode)) 1122 (lin-global-mode))
1102 1123
1103(use-package gcmh 1124(use-package gcmh
1104 :ensure t 1125 :ensure t
1105 :config 1126 :config
1106 (setopt gcmh-idle-delay 'auto 1127 (setq gcmh-idle-delay 'auto
1107 gcmh-verbose nil) 1128 gcmh-verbose nil)
1108 (gcmh-mode)) 1129 (gcmh-mode))
1109 1130
1110(use-package tmr 1131(use-package tmr
@@ -1116,44 +1137,10 @@ With PREFIX, prompt to change the current dictionary."
1116 tmr--timers) 1137 tmr--timers)
1117 (propertize "⏲" 'face 'font-lock-warning-face) 1138 (propertize "⏲" 'face 'font-lock-warning-face)
1118 "")) 1139 ""))
1119 (add-to-list 'global-mode-string 1140 ;; (add-to-list 'global-mode-string
1120 '("" (:eval (tmr-mode-line))) 1141 ;; '("" (:eval (tmr-mode-line)))
1121 'append)) 1142 ;; 'append)
1122 1143 )
1123;; (use-package elfeed
1124;; :ensure t
1125;; :preface
1126;; ;; https://karthinks.com/software/lazy-elfeed/
1127;; (defun elfeed-scroll-up-command (&optional arg)
1128;; "Scroll up or go to next feed item in Elfeed"
1129;; (interactive "^P")
1130;; (let ((scroll-error-top-bottom nil))
1131;; (condition-case-unless-debug nil
1132;; (scroll-up-command arg)
1133;; (error (elfeed-show-next)))))
1134;; (defun elfeed-scroll-down-command (&optional arg)
1135;; "Scroll up or go to next feed item in Elfeed"
1136;; (interactive "^P")
1137;; (let ((scroll-error-top-bottom nil))
1138;; (condition-case-unless-debug nil
1139;; (scroll-down-command arg)
1140;; (error (elfeed-show-prev)))))
1141;; :bind (("C-c f" . elfeed))
1142;; :config
1143;; (setopt elfeed-enclosure-default-dir "~/var/download/"
1144;; elfeed-db-directory (sync/ "emacs/elfeed/db" t)
1145;; elfeed-curl-max-connections 4)
1146;; (add-hook 'elfeed-search-update-hook #'truncate-lines-local-mode)
1147;; (keymap-set elfeed-show-mode-map "SPC" #'elfeed-scroll-up-command)
1148;; (keymap-set elfeed-show-mode-map "S-SPC" #'elfeed-scroll-down-command)
1149;; (keymap-set elfeed-search-mode-map "a" #'elfeed-search-untag-all-unread)
1150;; (setq elfeed-feeds nil) ; Always reload the feed list from feeds.opml
1151;; (elfeed-load-opml "~/var/feeds.opml"))
1152
1153(use-package iedit ; XXX: is this necessary?
1154 :ensure t
1155 :init
1156 (customize-set-variable 'iedit-toggle-key-default (kbd "C-'")))
1157 1144
1158(use-package dumb-jump 1145(use-package dumb-jump
1159 :ensure t 1146 :ensure t
diff --git a/lisp/acdw-chat.el b/lisp/acdw-chat.el index 62dcf72..9294ffe 100644 --- a/lisp/acdw-chat.el +++ b/lisp/acdw-chat.el
@@ -51,6 +51,16 @@ CHANNEL, SERVER, NICK, and BIBOUMI-SERVER are passed to
51 nick 51 nick
52 'popup)))) 52 'popup))))
53 53
54(defalias 'jabber-irc-join 'jabber-biboumi-muc-connect)
55
56(defun jabber-connect-all* (&optional arg)
57 "Run `jabber-connect-all'.
58With a prefix ARG, disconnect first."
59 (interactive "p")
60 (when arg
61 (jabber-disconnect))
62 (jabber-connect-all))
63
54(defun jabber-group-yank-join-url () 64(defun jabber-group-yank-join-url ()
55 "Yank a url for joining the focused group." 65 "Yank a url for joining the focused group."
56 (interactive) 66 (interactive)
@@ -62,7 +72,7 @@ CHANNEL, SERVER, NICK, and BIBOUMI-SERVER are passed to
62;;; Packages 72;;; Packages
63 73
64(use-package jabber 74(use-package jabber
65 :load-path "~/src/emacs/jabber/" 75 :load-path "~/src/jabber.el/"
66 :custom-face 76 :custom-face
67 (jabber-activity-face ((t :inherit jabber-chat-prompt-foreign 77 (jabber-activity-face ((t :inherit jabber-chat-prompt-foreign
68 :foreground unspecified 78 :foreground unspecified
@@ -85,37 +95,58 @@ CHANNEL, SERVER, NICK, and BIBOUMI-SERVER are passed to
85 :bind-keymap ("C-c j" . jabber-global-keymap) 95 :bind-keymap ("C-c j" . jabber-global-keymap)
86 :bind (("C-c C-SPC" . jabber-activity-switch-to)) 96 :bind (("C-c C-SPC" . jabber-activity-switch-to))
87 :config 97 :config
88 (setopt jabber-account-list '(("acdw@hmm.st")) 98 (setq jabber-account-list '(("acdw@hmm.st"))
89 jabber-auto-reconnect t 99 jabber-auto-reconnect t
90 jabber-biboumi-server "irc.hmm.st" 100 jabber-biboumi-server "irc.hmm.st"
91 jabber-biboumi-irc-servers '("irc.libera.chat" 101 jabber-biboumi-irc-servers '("irc.libera.chat"
92 "irc.tilde.chat" 102 "irc.oftc.net"
93 "tilde.town" 103 "irc.tilde.chat"
94 "m455.casa" 104 "tilde.town"
95 "irc.twitch.tv") 105 "m455.casa"
96 jabber-biboumi-default-nick "acdw" 106 "irc.twitch.tv")
97 jabber-last-read-marker (make-string fill-column ?.) 107 jabber-biboumi-default-nick "acdw"
98 jabber-muc-decorate-presence-patterns 108 jabber-last-read-marker (make-string fill-column ?.)
99 '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$" . nil) 109 jabber-muc-decorate-presence-patterns
100 ("Mode #.*" . jabber-muc-presence-dim) 110 '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$" . nil)
101 ("." . jabber-muc-presence-dim)) 111 ("Mode #.*" . jabber-muc-presence-dim)
102 jabber-activity-make-strings #'jabber-activity-make-strings-shorten 112 ("." . jabber-muc-presence-dim))
103 jabber-rare-time-format " - - - - - - %H:%M %F" 113 jabber-activity-make-strings #'jabber-activity-make-strings-shorten
104 jabber-muc-header-line-format 114 jabber-rare-time-format " - - - - - - %H:%M %F"
105 '(" " (:eval (replace-regexp-in-string "%" "%%" 115 jabber-chat-header-line-format
106 (jabber-jid-displayname 116 '("" (jabber-chat-buffer-show-avatar
107 jabber-group))) 117 (:eval
108 " / " jabber-muc-topic) 118 (let ((buddy (jabber-jid-symbol jabber-chatting-with)))
109 ;; buffer name formats 119 (jabber-propertize " "
110 jabber-chat-buffer-format "*xmpp* %n" 120 'display (get buddy 'avatar)))))
111 jabber-browse-buffer-format "*xmpp-browse* %n" 121 (:eval (replace-regexp-in-string "%" "%%"
112 jabber-groupchat-buffer-format "*xmpp-muc* %n" 122 (jabber-jid-displayname
113 jabber-muc-private-buffer-format "*xmpp-muc-private* %n" 123 jabber-chatting-with)))
114 ;; "prompt" (speaker) formats 124 "\t" (:eval (let ((buddy (jabber-jid-symbol jabber-chatting-with)))
115 jabber-groupchat-prompt-format (format "%%>%dn . " jabber-prefix-width) 125 (propertize
116 jabber-chat-local-prompt-format (format "%%>%dn . " jabber-prefix-width) 126 (or
117 jabber-chat-foreign-prompt-format (format "%%>%dn . " jabber-prefix-width) 127 (cdr (assoc (get buddy 'show) jabber-presence-strings))
118 jabber-muc-private-foreign-prompt-format "\n%g/%n . ") 128 (get buddy 'show))
129 'face
130 (or (cdr (assoc (get buddy 'show) jabber-presence-faces))
131 'jabber-roster-user-online))))
132 "\t" (:eval (jabber-fix-status (get (jabber-jid-symbol jabber-chatting-with) 'status)))
133 "\t" jabber-events-message
134 "\t" jabber-chatstates-message)
135 jabber-muc-header-line-format
136 '(" " (:eval (replace-regexp-in-string "%" "%%"
137 (jabber-jid-displayname
138 jabber-group)))
139 " / " jabber-muc-topic)
140 ;; buffer name formats
141 jabber-chat-buffer-format "*xmpp* %n"
142 jabber-browse-buffer-format "*xmpp-browse* %n"
143 jabber-groupchat-buffer-format "*xmpp-muc* %n"
144 jabber-muc-private-buffer-format "*xmpp-muc-private* %n"
145 ;; "prompt" (speaker) formats
146 jabber-groupchat-prompt-format (format "%%>%dn . " jabber-prefix-width)
147 jabber-chat-local-prompt-format (format "%%>%dn . " jabber-prefix-width)
148 jabber-chat-foreign-prompt-format (format "%%>%dn . " jabber-prefix-width)
149 jabber-muc-private-foreign-prompt-format "\n%g/%n . ")
119 ;; jabber muc nick coloring 150 ;; jabber muc nick coloring
120 ;; wgreenhous | I found 1.5 ok for saturation and 2.0 for value (modus) 151 ;; wgreenhous | I found 1.5 ok for saturation and 2.0 for value (modus)
121 ;; (setopt jabber-muc-nick-value 1.0 152 ;; (setopt jabber-muc-nick-value 1.0
@@ -131,6 +162,7 @@ CHANNEL, SERVER, NICK, and BIBOUMI-SERVER are passed to
131 (map-keymap (lambda (key command) 162 (map-keymap (lambda (key command)
132 (define-key jabber-global-keymap (vector (+ key #x60)) command)) 163 (define-key jabber-global-keymap (vector (+ key #x60)) command))
133 jabber-global-keymap) 164 jabber-global-keymap)
165 (define-key jabber-global-keymap "c" #'jabber-connect-all*)
134 (require 'jabber-httpupload nil t) 166 (require 'jabber-httpupload nil t)
135 (add-hook 'jabber-post-connect-hooks #'jabber-enable-carbons) 167 (add-hook 'jabber-post-connect-hooks #'jabber-enable-carbons)
136 (remove-hook 'jabber-alert-muc-hooks 'jabber-muc-echo) 168 (remove-hook 'jabber-alert-muc-hooks 'jabber-muc-echo)
diff --git a/lisp/acdw-mail.el b/lisp/acdw-mail.el index f8111e7..bf20c9b 100644 --- a/lisp/acdw-mail.el +++ b/lisp/acdw-mail.el
@@ -146,7 +146,7 @@ the saved search as well."
146 (notmuch-poll))) 146 (notmuch-poll)))
147 (lambda (_) 147 (lambda (_)
148 (message "Polling mail (async)...done")))) 148 (message "Polling mail (async)...done"))))
149 ;;(user-error "Feature `async' not found!") 149 (user-error "Feature `async' not found!")
150 (notmuch-poll))) 150 (notmuch-poll)))
151 151
152;;; https://kitchingroup.cheme.cmu.edu/blog/2015/09/04/Checking-for-email-attachments-before-you-send-email/ 152;;; https://kitchingroup.cheme.cmu.edu/blog/2015/09/04/Checking-for-email-attachments-before-you-send-email/
@@ -172,28 +172,93 @@ the saved search as well."
172 (error "No attachment. Aborting send.")))) 172 (error "No attachment. Aborting send."))))
173 173
174;;; Process ical attachments 174;;; Process ical attachments
175;; https://www.reddit.com/r/emacs/comments/8s1ion/comment/e0x5kgd/
176
177(defun ical2org (&optional replace output-buffer)
178 "Run ical2org on contents of this buffer.
179If REPLACE (interactive prefix argument), replace contents of the
180buffer. If no REPLACE nor OUTPUT-BUFFER, output goes to
181minibuffer."
182 (interactive "P")
183 (shell-command-on-region (point-min) (point-max)
184 "ical2org.awk"
185 output-buffer
186 replace
187 "*ical2org errors*"
188 'display-errors))
189
190(defun ical2org-capture ()
191 "Run `ical2org' on this buffer, then `org-capture' the result.
192Leaves current buffer as-was afterwards."
193 (interactive)
194 (let ((buf (current-buffer))
195 (ics (buffer-string)))
196 (ical2org 'replace buf)
197 (mark-whole-buffer)
198 (org-capture nil "a")
199 (mark-whole-buffer)
200 (delete-region (point-min) (point-max))
201 (insert ics)))
202
203(defun notmuch-ics-refile (filename header)
204 "Refile the current ICS buffer to FILENAME, under HEADER."
205 (org-refile nil nil
206 (list header
207 filename
208 nil
209 (with-current-buffer (find-file-noselect filename)
210 (org-find-exact-headline-in-buffer header))))
211 (notmuch-ics-kill))
212
213(defun notmuch-ics-kill ()
214 "Kill the current ICS buffer and delete its file."
215 (let ((kill-buffer-hook nil)
216 (kill-buffer-query-functions nil)
217 (file (buffer-file-name)))
218 (set-buffer-modified-p nil)
219 (kill-buffer-and-window)
220 (delete-file file)))
221
222(defun notmuch-ics-cancel ()
223 "Cancel saving ICS buffer."
224 (interactive)
225 (notmuch-ics-kill))
226
227(define-derived-mode notmuch-save-ics-mode org-mode
228 "Org-mode but with a different keymap.")
175 229
176(defun notmuch-save-ics () 230(defun notmuch-save-ics ()
231 ;; XXX: this is hacky as hell
177 "Save a .ics file in a message." 232 "Save a .ics file in a message."
178 (interactive) 233 (interactive)
179 (with-current-notmuch-show-message 234 (with-current-notmuch-show-message
180 (notmuch-foreach-mime-part 235 (notmuch-foreach-mime-part
181 (lambda (part) 236 (lambda (part)
182 (message "%S" part)
183 (when (and (listp part) 237 (when (and (listp part)
184 (or (equal "application/ics" (caadr part)) 238 (or (equal "application/ics" (caadr part))
185 ;; (equal "text/calendar" (caadr part)) 239 ;; (equal "text/calendar" (caadr part))
186 )) 240 ))
187 (save-window-excursion 241 (let* ((filename (format "/dev/shm/notmuch-%s.ics"
188 (let* ((filename "/tmp/notmuch.ics") 242 (time-convert (current-time) 'integer))))
189 (buf (find-file-noselect filename))) 243 (mm-save-part-to-file part filename)
190 (delete-file filename) 244 (message "Converting ICS to org ...")
191 (kill-buffer (get-file-buffer filename)) 245 (with-current-buffer (find-file-other-window filename)
192 (mm-save-part-to-file part filename) 246 (ical2org 'replace (current-buffer))
193 (icalendar-import-file filename diary-file) 247 (deactivate-mark)
194 (kill-buffer buf))))) 248 (let ((org-mode-hook nil))
249 (notmuch-save-ics-mode))
250 (local-set-key (kbd "C-c C-c")
251 (lambda () (interactive)
252 (notmuch-ics-refile (sync/ "org/diary.org") "Appointments")))
253 (local-set-key (kbd "C-c C-k") #'notmuch-ics-cancel)
254 (setq-local header-line-format
255 (concat "ICAL buffer. "
256 "Finish: `C-c C-c'. "
257 "Abort: `C-c C-k'."))))))
195 (mm-dissect-buffer t t)))) 258 (mm-dissect-buffer t t))))
196 259
260(add-hook 'notmuch-show-hook #'notmuch-save-ics)
261
197 262
198;;; Fixes 263;;; Fixes
199 264
@@ -338,7 +403,7 @@ the saved search as well."
338 (add-hook 'notmuch-show-mode-hook #'visual-fill-column-mode) 403 (add-hook 'notmuch-show-mode-hook #'visual-fill-column-mode)
339 404
340 (define-advice notmuch-bury-or-kill-this-buffer (:after (&rest _) poll-async) 405 (define-advice notmuch-bury-or-kill-this-buffer (:after (&rest _) poll-async)
341 (notmuch-async-poll)) 406 (call-process "swaymail"))
342 407
343 (define-advice notmuch-address-selection-function 408 (define-advice notmuch-address-selection-function
344 (:override (prompt collection _) no-initial-input) 409 (:override (prompt collection _) no-initial-input)
diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index f961dda..2ec3339 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el
@@ -137,19 +137,33 @@ itself. Other values of ARG will call `newline' with that ARG."
137 137
138 138
139;;; Copy rich text to the keyboard 139;;; Copy rich text to the keyboard
140
140;; Thanks to Oleh Krehel: 141;; Thanks to Oleh Krehel:
141;; https://emacs.stackexchange.com/questions/54292/copy-results-of-org-export-directly-to-clipboard 142;; https://emacs.stackexchange.com/questions/54292/copy-results-of-org-export-directly-to-clipboard
142;; So. Emacs can't do this itself because it doesn't support sending clipboard 143;; So. Emacs can't do this itself because it doesn't support sending clipboard
143;; or selection contents as text/html. We have to use xclip instead. 144;; or selection contents as text/html. We have to use xclip instead.
145;; (defun org-to-html-to-clipboard (&rest org-export-args)
146;; "Export current org buffer to HTML, then copy it to the clipboard.
147;; ORG-EXPORT-ARGS are passed to `org-export-to-file'."
148;; (let ((f (make-temp-file "org-html-export")))
149;; (apply #'org-export-to-file 'html f org-export-args)
150;; (start-process "xclip" " *xclip*"
151;; "xclip" "-verbose" "-i" f
152;; "-t" "text/html" "-selection" "clipboard")
153;; (message "HTML pasted to clipboard.")))
154
155;; Wayland version.. TODO: make it work for both
144(defun org-to-html-to-clipboard (&rest org-export-args) 156(defun org-to-html-to-clipboard (&rest org-export-args)
145 "Export current org buffer to HTML, then copy it to the clipboard. 157 "Export current org buffer to HTML, then copy it to the clipboard.
146ORG-EXPORT-ARGS are passed to `org-export-to-file'." 158ORG-EXPORT-ARGS are passed to `org-export-to-file'."
147 (let ((f (make-temp-file "org-html-export"))) 159 (let ((buf (generate-new-buffer "*org-html-clipboard*" t)))
148 (apply #'org-export-to-file 'html f org-export-args) 160 (apply #'org-export-to-buffer 'html buf org-export-args)
149 (start-process "xclip" " *xclip*" 161 (with-current-buffer buf
150 "xclip" "-verbose" "-i" f 162 (call-process-region (point-min) (point-max)
151 "-t" "text/html" "-selection" "clipboard") 163 "wl-copy" nil nil nil
152 (message "HTML pasted to clipboard."))) 164 "-t" "text/html")
165 (kill-buffer-and-window))
166 (message "HTML copied to clipboard.")))
153 167
154(defun org-subtree-to-html-to-clipboard () 168(defun org-subtree-to-html-to-clipboard ()
155 "Export current subtree to HTML." 169 "Export current subtree to HTML."
@@ -203,6 +217,33 @@ If LIST is non-nil, return the result as a list instead of a string."
203 (when (org-at-heading-p) (org-align-tags)))))) 217 (when (org-at-heading-p) (org-align-tags))))))
204 218
205 219
220;;; Navigating headings
221
222(defun org-next-visible-heading-unfolding (arg)
223 (interactive "p")
224 (when (let ((pt (org-next-visible-heading arg)))
225 (and (buffer-narrowed-p)
226 (or (= (point) (point-min))
227 (and pt
228 (= pt (point-max))))))
229 (widen)
230 (org-next-visible-heading arg)
231 (org-narrow-to-subtree)))
232
233(defun org-previous-visible-heading-unfolding (arg)
234 (interactive "p")
235 (org-next-visible-heading-unfolding (- arg)))
236
237(defun org-up-heading-unfolding (arg)
238 (interactive "p")
239 (when (let ((pt (outline-up-heading arg)))
240 (and (buffer-narrowed-p)
241 (= (point) (point-min))))
242 (widen)
243 (org-up-heading-unfolding arg)
244 (org-narrow-to-subtree)))
245
246
206;;; Misc. 247;;; Misc.
207 248
208(defun org-clock-in-or-out (prefix) 249(defun org-clock-in-or-out (prefix)
@@ -261,19 +302,20 @@ If LIST is non-nil, return the result as a list instead of a string."
261 org-archive-mark-done t 302 org-archive-mark-done t
262 org-fold-catch-invisible-edits 'show-and-error 303 org-fold-catch-invisible-edits 'show-and-error
263 org-clock-clocked-in-display 'mode-line 304 org-clock-clocked-in-display 'mode-line
264 org-clock-string-limit 7 ; just the clock bit 305 org-clock-string-limit 0
265 org-clock-persist nil 306 org-clock-persist nil
266 org-confirm-babel-evaluate nil 307 org-confirm-babel-evaluate nil
267 org-cycle-separator-lines 0 308 org-cycle-separator-lines 0
268 org-deadline-warning-days 0 309 org-deadline-warning-days 0
269 org-directory (sync/ "org/" t) 310 org-directory (sync/ "org/" t)
270 org-ellipsis (or (bound-and-true-p truncate-string-ellipsis) "…") 311 org-ellipsis (or (bound-and-true-p truncate-string-ellipsis) "…")
271 org-emphasis-alist '(("*" org-bold) 312 org-emphasis-alist
272 ("/" org-italic) 313 '(("*" org-bold)
273 ("_" org-underline) 314 ("/" org-italic)
274 ("=" org-verbatim) 315 ("_" org-underline)
275 ("~" org-code) 316 ("=" org-verbatim)
276 ("+" org-strikethrough)) 317 ("~" org-code)
318 ("+" org-strikethrough))
277 org-fontify-done-headline t 319 org-fontify-done-headline t
278 org-fontify-quote-and-verse-blocks t 320 org-fontify-quote-and-verse-blocks t
279 org-fontify-whole-heading-line t 321 org-fontify-whole-heading-line t
@@ -320,6 +362,9 @@ If LIST is non-nil, return the result as a list instead of a string."
320 (keymap-set org-mode-map "S-<return>" #'+org-table-copy-down|+org-return-dwim) 362 (keymap-set org-mode-map "S-<return>" #'+org-table-copy-down|+org-return-dwim)
321 (keymap-unset org-mode-map "C-'" t) 363 (keymap-unset org-mode-map "C-'" t)
322 (keymap-unset org-mode-map "C-," t) 364 (keymap-unset org-mode-map "C-," t)
365 (keymap-set org-mode-map "C-c C-n" #'org-next-visible-heading-unfolding)
366 (keymap-set org-mode-map "C-c C-p" #'org-previous-visible-heading-unfolding)
367 (keymap-set org-mode-map "C-c C-u" #'org-up-heading-unfolding)
323 ;; Hooks 368 ;; Hooks
324 (add-hook 'org-mode-hook 369 (add-hook 'org-mode-hook
325 (defun org-mode@setup () 370 (defun org-mode@setup ()
@@ -333,7 +378,8 @@ If LIST is non-nil, return the result as a list instead of a string."
333 (add-hook 'before-save-hook 378 (add-hook 'before-save-hook
334 (defun before-save@org-mode@before-save () 379 (defun before-save@org-mode@before-save ()
335 (org-align-tags 'all) 380 (org-align-tags 'all)
336 (+org-hide-drawers-except-point)) 381 (+org-hide-drawers-except-point)
382 )
337 nil :local))) 383 nil :local)))
338 ;; Extra font-lock keywords 384 ;; Extra font-lock keywords
339 (font-lock-add-keywords 385 (font-lock-add-keywords
@@ -353,13 +399,15 @@ If LIST is non-nil, return the result as a list instead of a string."
353 ("<f8>" . org-clock-in-or-out)) 399 ("<f8>" . org-clock-in-or-out))
354 :config 400 :config
355 (setopt org-clock-clocked-in-display 'mode-line 401 (setopt org-clock-clocked-in-display 'mode-line
356 global-mode-string 402 ;; global-mode-string
357 '((t jabber-activity-mode-string) 403 ;; '((t jabber-activity-mode-string)
358 (:eval (when (org-clocking-p) org-mode-line-string)) 404 ;; (:eval (when (org-clocking-p) org-mode-line-string))
359 (display-time-mode display-time-string))) 405 ;; (display-time-mode display-time-string))
360 (add-hook 'org-clock-in-hook (defun org-clock@remove-from-global-mode-string () 406 )
361 (setq global-mode-string 407 ;; (add-hook 'org-clock-in-hook (defun org-clock@remove-from-global-mode-string ()
362 (delq 'org-mode-line-string global-mode-string))))) 408 ;; (setq global-mode-string
409 ;; (delq 'org-mode-line-string global-mode-string))))
410 )
363 411
364(use-package org-agenda 412(use-package org-agenda
365 :bind (("C-c a" . org-agenda)) 413 :bind (("C-c a" . org-agenda))
@@ -372,7 +420,7 @@ If LIST is non-nil, return the result as a list instead of a string."
372 (800 1000 1200 1400 1600 1800 2000) 420 (800 1000 1200 1400 1600 1800 2000)
373 " ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄") 421 " ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄")
374 org-agenda-current-time-string "← now ───────────────" 422 org-agenda-current-time-string "← now ───────────────"
375 org-agenda-include-diary t ; I use the org-diary features 423 org-agenda-include-diary nil ; I use the org-diary features
376 org-agenda-todo-ignore-deadlines 'near 424 org-agenda-todo-ignore-deadlines 'near
377 org-agenda-todo-ignore-scheduled 'future 425 org-agenda-todo-ignore-scheduled 'future
378 org-agenda-include-deadlines t 426 org-agenda-include-deadlines t
@@ -397,7 +445,8 @@ If LIST is non-nil, return the result as a list instead of a string."
397 '("WAIT" "MCKENZIE" "RACHEL"))))) 445 '("WAIT" "MCKENZIE" "RACHEL")))))
398 (stuck "" ((org-agenda-overriding-header "Waiting")))) 446 (stuck "" ((org-agenda-overriding-header "Waiting"))))
399 ((org-agenda-files ',(list (progn (require 'chd) 447 ((org-agenda-files ',(list (progn (require 'chd)
400 (chd/ "inbox-chd.org")))))))) 448 (chd/ "inbox-chd.org"))
449 (sync/ "org/diary.org")))))))
401 ;; Speedup agenda generation 450 ;; Speedup agenda generation
402 ;; https://orgmode.org/manual/Speeding-Up-Your-Agendas.html 451 ;; https://orgmode.org/manual/Speeding-Up-Your-Agendas.html
403 ;; https://orgmode.org/worg/agenda-optimization.html 452 ;; https://orgmode.org/worg/agenda-optimization.html
@@ -409,7 +458,7 @@ If LIST is non-nil, return the result as a list instead of a string."
409 (add-hook 'org-agenda-mode-hook #'truncate-lines-local-mode) 458 (add-hook 'org-agenda-mode-hook #'truncate-lines-local-mode)
410 (add-hook 'org-agenda-mode-hook #'hl-line-mode) 459 (add-hook 'org-agenda-mode-hook #'hl-line-mode)
411 (add-hook 'org-agenda-after-show-hook #'org-narrow-to-subtree) 460 (add-hook 'org-agenda-after-show-hook #'org-narrow-to-subtree)
412 (add-hook 'org-agenda-after-show-hook #'+org-hide-drawers-except-point) 461 ;; (add-hook 'org-agenda-after-show-hook #'+org-hide-drawers-except-point)
413 (define-advice org-agenda-files (:filter-return (files) skip-regexp) 462 (define-advice org-agenda-files (:filter-return (files) skip-regexp)
414 "Filter some files from `org-agenda'." 463 "Filter some files from `org-agenda'."
415 (when org-agenda-skip-file-regexp 464 (when org-agenda-skip-file-regexp
@@ -420,11 +469,17 @@ If LIST is non-nil, return the result as a list instead of a string."
420 files))) 469 files)))
421 files) 470 files)
422 (define-advice org-agenda (:around (orig &rest r) inhibit-hooks) 471 (define-advice org-agenda (:around (orig &rest r) inhibit-hooks)
423 (let ((org-mode-hook nil)) 472 (dlet ((org-mode-hook nil))
473 (apply orig r)))
474 (define-advice org-agenda-skip (:around (orig &rest r) fix-looking-at)
475 (dlet ((comment-start-skip "^\\s-*#\\(?: \\|$\\)"))
424 (apply orig r))) 476 (apply orig r)))
477 ;; (advice-remove 'org-agenda 'org-agenda@inhibit-hooks)
425 (define-advice org-agenda-switch-to (:after (&rest _) do-hooks) 478 (define-advice org-agenda-switch-to (:after (&rest _) do-hooks)
426 (run-hooks 'org-mode-hook)) 479 (run-hooks 'org-mode-hook))
427 (progress@around org-agenda-list "Building agenda")) 480 (progress@around org-agenda-list "Building agenda")
481 (with-eval-after-load 'org-agenda
482 (add-to-list 'org-agenda-files (sync/ "org/diary.org"))))
428 483
429(use-package org-capture 484(use-package org-capture
430 :bind (("C-c c" . org-capture))) 485 :bind (("C-c c" . org-capture)))
@@ -465,7 +520,7 @@ effect for exporting link types)."
465 org-export-with-toc nil)) 520 org-export-with-toc nil))
466 521
467(use-package org-word-count 522(use-package org-word-count
468 :load-path "~/src/emacs/org-word-count/" 523 :load-path "~/src/org-word-count.el/"
469 :hook org-mode-hook) 524 :hook org-mode-hook)
470 525
471(use-package org-modern 526(use-package org-modern
@@ -487,7 +542,7 @@ effect for exporting link types)."
487 542
488(use-package org-taskwise 543(use-package org-taskwise
489 :after org 544 :after org
490 :load-path "~/src/emacs/org-taskwise/") 545 :load-path "~/src/org-taskwise.el/")
491 546
492(provide 'acdw-org) 547(provide 'acdw-org)
493;;; acdw-org.el ends here 548;;; acdw-org.el ends here
diff --git a/lisp/acdw-shell b/lisp/acdw-shell deleted file mode 100644 index e69de29..0000000 --- a/lisp/acdw-shell +++ /dev/null
diff --git a/lisp/acdw-shell.el b/lisp/acdw-shell.el index 7c542aa..ce63bdc 100644 --- a/lisp/acdw-shell.el +++ b/lisp/acdw-shell.el
@@ -52,8 +52,8 @@
52 (concat (if (= 0 eshell-last-command-status) 52 (concat (if (= 0 eshell-last-command-status)
53 "^_^ " 53 "^_^ "
54 ";_; ") 54 ";_; ")
55 (abbreviate-file-name (eshell/pwd)) 55 (abbreviate-file-name (eshell/pwd))
56 (if (= (user-uid) 0) " # " " $ "))) 56 (if (= (user-uid) 0) " # " " $ ")))
57 57
58 58
59;;; Packages 59;;; Packages
@@ -89,20 +89,20 @@
89 (require 'esh-module) 89 (require 'esh-module)
90 (require 'em-smart) 90 (require 'em-smart)
91 (require 'em-tramp) 91 (require 'em-tramp)
92 (setopt eshell-destroy-buffer-when-process-dies t 92 (setq eshell-destroy-buffer-when-process-dies t
93 eshell-error-if-no-glob t 93 eshell-error-if-no-glob t
94 eshell-hist-ignoredups t 94 eshell-hist-ignoredups t
95 eshell-kill-on-exit t 95 eshell-kill-on-exit t
96 eshell-prefer-lisp-functions t 96 eshell-prefer-lisp-functions t
97 eshell-prefer-lisp-variables t 97 eshell-prefer-lisp-variables t
98 eshell-scroll-to-bottom-on-input 'this 98 eshell-scroll-to-bottom-on-input 'this
99 eshell-banner-message "" 99 eshell-banner-message ""
100 eshell-hist-ignoredups 'erase 100 eshell-hist-ignoredups 'erase
101 eshell-history-size 512 101 eshell-history-size 512
102 eshell-input-filter (lambda (input) 102 eshell-input-filter (lambda (input)
103 (or (eshell-input-filter-default input) 103 (or (eshell-input-filter-default input)
104 (eshell-input-filter-initial-space input))) 104 (eshell-input-filter-initial-space input)))
105 eshell-prompt-function #'acdw/eshell-prompt) 105 eshell-prompt-function #'acdw/eshell-prompt)
106 (add-hook 'eshell-mode-hook 106 (add-hook 'eshell-mode-hook
107 (defun eshell-setup () 107 (defun eshell-setup ()
108 (hungry-delete-mode -1) 108 (hungry-delete-mode -1)
diff --git a/lisp/acdw-web.el b/lisp/acdw-web.el index 40e1a3d..3b78e4d 100644 --- a/lisp/acdw-web.el +++ b/lisp/acdw-web.el
@@ -30,6 +30,7 @@ This is a good function to use in key positions in `browse-url-handlers'."
30 (cl-loop for regexp in ',regexps 30 (cl-loop for regexp in ',regexps
31 if (string-match-p regexp url) 31 if (string-match-p regexp url)
32 return regexp))) 32 return regexp)))
33
33;;; External URL handlers 34;;; External URL handlers
34 35
35(cl-defmacro +browse-url-make-external-viewer-handler 36(cl-defmacro +browse-url-make-external-viewer-handler
@@ -93,9 +94,8 @@ for some reason."
93 "--cache-pause-initial=yes") 94 "--cache-pause-initial=yes")
94 :prompt "Video URL: ") 95 :prompt "Video URL: ")
95 96
96(+browse-url-make-external-viewer-handler mpv-image 97(+browse-url-make-external-viewer-handler miv
97 :program (executable-find "mpv") 98 :program (executable-find "miv")
98 :args '("--image-display-duration=inf")
99 :prompt "Image URL: ") 99 :prompt "Image URL: ")
100 100
101;;; External domains 101;;; External domains
@@ -187,6 +187,17 @@ This function will also save `custom-file' with the updated value."
187 (message "Saved %s" file) 187 (message "Saved %s" file)
188 file))) 188 file)))
189 189
190;;; Unfucking the internet
191
192(defun eww-archiveis-url (url)
193 "Run URL through archive.is and browse the result."
194 (interactive (list (plist-get eww-data :url)))
195 (letrec ((nonce (lambda ()
196 (unwind-protect (eww-readable)
197 (remove-hook 'eww-after-render-hook nonce)))))
198 (add-hook 'eww-after-render-hook nonce)
199 (eww (format "https://archive.is/submit/?url=%s" url))))
200
190 201
191;;; Packages 202;;; Packages
192 203
@@ -240,7 +251,8 @@ This function will also save `custom-file' with the updated value."
240 (define-key eww-mode-map "b" #'bookmark-set) 251 (define-key eww-mode-map "b" #'bookmark-set)
241 (define-key eww-mode-map "B" #'bookmark-jump) 252 (define-key eww-mode-map "B" #'bookmark-jump)
242 (define-key eww-mode-map (kbd "M-n") nil) 253 (define-key eww-mode-map (kbd "M-n") nil)
243 (define-key eww-mode-map (kbd "M-p") nil)) 254 (define-key eww-mode-map (kbd "M-p") nil)
255 (define-key eww-mode-map (kbd "*") #'eww-archiveis-url))
244 256
245(use-package browse-url 257(use-package browse-url
246 :demand t 258 :demand t
@@ -248,6 +260,9 @@ This function will also save `custom-file' with the updated value."
248 (put 'browse-url-browser-function 'safe-local-variable 260 (put 'browse-url-browser-function 'safe-local-variable
249 '+browse-url-browser-function-safe-p) 261 '+browse-url-browser-function-safe-p)
250 (setopt browse-url-browser-function #'eww-browse-url 262 (setopt browse-url-browser-function #'eww-browse-url
263 browse-url-secondary-browser-function #'browse-url-firefox
264 browse-url-firefox-program (executable-find "firefox")
265 browse-url-firefox-arguments '("--new-tab")
251 ;; Dispatch browser based on URL 266 ;; Dispatch browser based on URL
252 browse-url-handlers 267 browse-url-handlers
253 `(;; Videos 268 `(;; Videos
@@ -266,7 +281,7 @@ This function will also save `custom-file' with the updated value."
266 (rx "." (or "jpeg" "jpg" "png" "pn" 281 (rx "." (or "jpeg" "jpg" "png" "pn"
267 "bmp" "webp") 282 "bmp" "webp")
268 eos)) 283 eos))
269 . +browse-url-with-mpv-image) 284 . +browse-url-with-miv)
270 ;; Blobs 285 ;; Blobs
271 (,(+browse-url-matches (rx "." (or ".tar.gz" ".pdf") eos)) 286 (,(+browse-url-matches (rx "." (or ".tar.gz" ".pdf") eos))
272 . +browse-url-download) 287 . +browse-url-download)
@@ -294,7 +309,8 @@ This function will also save `custom-file' with the updated value."
294 browse-url-firefox-arguments '("--new-tab") 309 browse-url-firefox-arguments '("--new-tab")
295 browse-url-generic-program firefox 310 browse-url-generic-program firefox
296 browse-url-generic-args browse-url-firefox-arguments)) 311 browse-url-generic-args browse-url-firefox-arguments))
297 (when-let ((chromium (choose-executable "chromium"))) 312 (when-let ((chromium (choose-executable "chromium"
313 "chromium-browser")))
298 (setopt browse-url-chromium-program chromium 314 (setopt browse-url-chromium-program chromium
299 browse-url-generic-program chromium)) 315 browse-url-generic-program chromium))
300 (when-let ((chrome (choose-executable "chrome" 316 (when-let ((chrome (choose-executable "chrome"
@@ -304,7 +320,7 @@ This function will also save `custom-file' with the updated value."
304 320
305(use-package browse-url-transform 321(use-package browse-url-transform
306 :after browse-url 322 :after browse-url
307 :load-path "~/src/emacs/browse-url-transform/" 323 :load-path "~/src/browse-url-transform.el/"
308 :config 324 :config
309 (setopt browse-url-transform-alist 325 (setopt browse-url-transform-alist
310 `(;; Privacy-respecting alternatives 326 `(;; Privacy-respecting alternatives
diff --git a/lisp/acdw.el b/lisp/acdw.el index 63291d3..b76b947 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -59,6 +59,13 @@ enables passing arguments to a calling function."
59 ("—" "---")))) 59 ("—" "---"))))
60 (replace-match replace nil nil))))) 60 (replace-match replace nil nil)))))
61 61
62(defun unsmartify-dwim ()
63 "Unsmartify the current region or the entire buffer."
64 (interactive)
65 (if (region-active-p)
66 (unsmartify-region (region-beginning) (region-end))
67 (unsmartify-region (point-min) (point-max))))
68
62(defun ++concat (func strings) 69(defun ++concat (func strings)
63 "Concat STRINGS processed by FUNC. 70 "Concat STRINGS processed by FUNC.
64Each of STRINGS can be a bare string or a list. Strings are 71Each of STRINGS can be a bare string or a list. Strings are