diff options
-rw-r--r-- | early-init.el | 7 | ||||
-rw-r--r-- | init.el | 45 | ||||
-rw-r--r-- | lisp/+elfeed.el | 88 | ||||
-rw-r--r-- | lisp/+emacs.el | 11 | ||||
-rw-r--r-- | lisp/+ispell.el | 52 | ||||
-rw-r--r-- | lisp/+kmacro.el | 1 | ||||
-rw-r--r-- | lisp/+modeline.el | 23 | ||||
-rw-r--r-- | lisp/+org.el | 4 | ||||
-rw-r--r-- | lisp/+tab-bar.el | 6 | ||||
-rw-r--r-- | lisp/acdw.el | 57 | ||||
-rw-r--r-- | machines/bob.el | 15 | ||||
-rw-r--r-- | snippets/org-mode/sc | 4 | ||||
-rw-r--r-- | snippets/sh-mode/getopts | 10 |
13 files changed, 204 insertions, 119 deletions
diff --git a/early-init.el b/early-init.el index 113f261..e50d99e 100644 --- a/early-init.el +++ b/early-init.el | |||
@@ -140,10 +140,9 @@ See `no-littering' for examples.") | |||
140 | 140 | ||
141 | (add-to-list 'setup-modifier-list 'setup-wrap-to-demote-errors) | 141 | (add-to-list 'setup-modifier-list 'setup-wrap-to-demote-errors) |
142 | (unless (memq debug-on-error '(nil init)) | 142 | (unless (memq debug-on-error '(nil init)) |
143 | (define-advice setup (:before (head &rest args) +setup-before) | 143 | (define-advice setup (:around (fn head &rest args) +setup-report) |
144 | (message "[Setup] %S" head)) | 144 | (+with-progress ((format "[Setup] %S..." head)) |
145 | (define-advice setup (:after (head &rest args) +setup-after) | 145 | (apply fn head args)))) |
146 | (message "[Setup] %S...done" head))) | ||
147 | 146 | ||
148 | ;;; Appendix | 147 | ;;; Appendix |
149 | 148 | ||
diff --git a/init.el b/init.el index 63214a6..1a9c6a9 100644 --- a/init.el +++ b/init.el | |||
@@ -464,7 +464,7 @@ | |||
464 | 464 | ||
465 | (setup notmuch | 465 | (setup notmuch |
466 | (:load-from "~/usr/share/emacs/site-lisp/") | 466 | (:load-from "~/usr/share/emacs/site-lisp/") |
467 | ;;(:load-after org-contacts) | 467 | (:load-after org-contacts) |
468 | (:also-load +notmuch +message) | 468 | (:also-load +notmuch +message) |
469 | (+define-dir notmuch/ (sync/ "emacs/notmuch") | 469 | (+define-dir notmuch/ (sync/ "emacs/notmuch") |
470 | "Notmuch configuration and data.") | 470 | "Notmuch configuration and data.") |
@@ -567,11 +567,11 @@ | |||
567 | org-startup-truncated nil | 567 | org-startup-truncated nil |
568 | org-startup-with-inline-images t | 568 | org-startup-with-inline-images t |
569 | org-tags-column (- (- fill-column (length org-ellipsis))) | 569 | org-tags-column (- (- fill-column (length org-ellipsis))) |
570 | org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" | 570 | org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "ONGOING(o@)" |
571 | "|" "DONE(d!)") | 571 | "|" "DONE(d!)") |
572 | (sequence "ONGOING(o@)") | ||
573 | (sequence "|" "CANCELED(k@)") | 572 | (sequence "|" "CANCELED(k@)") |
574 | (sequence "MEETING(m)")) | 573 | (sequence "MEETING(m)") |
574 | (sequence "ASSIGNED(a@/!)" "REVIEW(r)" "|" "DONE(d!)")) | ||
575 | org-emphasis-alist '(("*" org-bold) | 575 | org-emphasis-alist '(("*" org-bold) |
576 | ("/" org-italic) | 576 | ("/" org-italic) |
577 | ("_" org-underline) | 577 | ("_" org-underline) |
@@ -698,7 +698,7 @@ | |||
698 | (+org-capture-sort)) | 698 | (+org-capture-sort)) |
699 | 699 | ||
700 | (setup org-contacts (:quit) | 700 | (setup org-contacts (:quit) |
701 | (:load-after org) | 701 | (:require) |
702 | (:also-straight org-vcard) ; for importing Vcard files | 702 | (:also-straight org-vcard) ; for importing Vcard files |
703 | (:option org-contacts-matcher "contact") ; Contacts are tagged "contact" | 703 | (:option org-contacts-matcher "contact") ; Contacts are tagged "contact" |
704 | ) | 704 | ) |
@@ -854,6 +854,12 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers." | |||
854 | (:when-loaded | 854 | (:when-loaded |
855 | (setf (alist-get ?. avy-dispatch-alist) #'avy-action-embark))) | 855 | (setf (alist-get ?. avy-dispatch-alist) #'avy-action-embark))) |
856 | 856 | ||
857 | (setup (:straight bbdb) | ||
858 | (:require bbdb-autoloads | ||
859 | bbdb) | ||
860 | (:also-straight bbdb-vcard) | ||
861 | (bbdb-initialize 'gnus 'message)) | ||
862 | |||
857 | (setup (:straight (bongo :type git | 863 | (setup (:straight (bongo :type git |
858 | :flavor melpa | 864 | :flavor melpa |
859 | :files ("*.el" "*.texi" "images" "*.rb" "bongo-pkg.el" "*.info") | 865 | :files ("*.el" "*.texi" "images" "*.rb" "bongo-pkg.el" "*.info") |
@@ -1344,7 +1350,9 @@ See also `crux-reopen-as-root-mode'." | |||
1344 | (:+leader "f" #'elfeed "C-f" #'elfeed) | 1350 | (:+leader "f" #'elfeed "C-f" #'elfeed) |
1345 | (advice-add #'elfeed-search-fetch :after #'beginning-of-buffer) | 1351 | (advice-add #'elfeed-search-fetch :after #'beginning-of-buffer) |
1346 | (:with-mode elfeed-search-mode | 1352 | (:with-mode elfeed-search-mode |
1347 | (:bind "&" #'+elfeed-search-browse-generic) | 1353 | (:bind "&" #'+elfeed-search-browse-generic |
1354 | "w" #'elfeed-search-yank | ||
1355 | "y" nil) | ||
1348 | (:hook #'hl-line-mode) | 1356 | (:hook #'hl-line-mode) |
1349 | ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/ | 1357 | ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/ |
1350 | (advice-add #'elfeed-search-update--force :after #'elfeed-db-save) | 1358 | (advice-add #'elfeed-search-update--force :after #'elfeed-db-save) |
@@ -1353,7 +1361,9 @@ See also `crux-reopen-as-root-mode'." | |||
1353 | (:bind "SPC" #'+elfeed-scroll-up-command | 1361 | (:bind "SPC" #'+elfeed-scroll-up-command |
1354 | "S-SPC" #'+elfeed-scroll-down-command | 1362 | "S-SPC" #'+elfeed-scroll-down-command |
1355 | "&" #'+elfeed-show-browse-generic | 1363 | "&" #'+elfeed-show-browse-generic |
1356 | "RET" #'shr-browse-url) | 1364 | "RET" #'shr-browse-url |
1365 | "w" #'elfeed-show-yank | ||
1366 | "y" nil) | ||
1357 | (:hook #'reading-mode) | 1367 | (:hook #'reading-mode) |
1358 | (:option +elfeed--update-repeat (* 60 30) ; 1/2 hour | 1368 | (:option +elfeed--update-repeat (* 60 30) ; 1/2 hour |
1359 | +elfeed--update-first-time 60)) | 1369 | +elfeed--update-first-time 60)) |
@@ -1744,9 +1754,10 @@ See also `crux-reopen-as-root-mode'." | |||
1744 | (:option +mwim-passthrough-modes '(comint-mode | 1754 | (:option +mwim-passthrough-modes '(comint-mode |
1745 | eshell-mode | 1755 | eshell-mode |
1746 | vterm-mode | 1756 | vterm-mode |
1747 | crossword-mode)) | 1757 | crossword-mode |
1748 | (:global "C-a" #'+mwim-beginning-maybe | 1758 | geiser-repl-mode)) |
1749 | "C-e" #'+mwim-end-maybe)) | 1759 | (:global "C-a" #'mwim-beginning |
1760 | "C-e" #'mwim-end)) | ||
1750 | 1761 | ||
1751 | (setup (:straight notmuch-bookmarks) | 1762 | (setup (:straight notmuch-bookmarks) |
1752 | (:load-after notmuch) | 1763 | (:load-after notmuch) |
@@ -1780,6 +1791,7 @@ See also `crux-reopen-as-root-mode'." | |||
1780 | (:hook-into org-mode)) | 1791 | (:hook-into org-mode)) |
1781 | 1792 | ||
1782 | (setup (:straight org-download) | 1793 | (setup (:straight org-download) |
1794 | (:require) | ||
1783 | (:option org-download-method 'attach | 1795 | (:option org-download-method 'attach |
1784 | org-download-backend (cond ((executable-find "curl") 'curl) | 1796 | org-download-backend (cond ((executable-find "curl") 'curl) |
1785 | ((executable-find "wget") 'wget) | 1797 | ((executable-find "wget") 'wget) |
@@ -1787,6 +1799,9 @@ See also `crux-reopen-as-root-mode'." | |||
1787 | (add-hook 'dired-mode-hook 'org-download-enable)) | 1799 | (add-hook 'dired-mode-hook 'org-download-enable)) |
1788 | 1800 | ||
1789 | (setup (:straight org-mime) | 1801 | (setup (:straight org-mime) |
1802 | (:option org-mime-export-ascii 'utf-8)) | ||
1803 | |||
1804 | (setup (:straight org-mime) | ||
1790 | (add-hook 'message-mode-hook | 1805 | (add-hook 'message-mode-hook |
1791 | (defun org-mime-setup@message-mode () | 1806 | (defun org-mime-setup@message-mode () |
1792 | (local-set-key (kbd "C-c M-o") 'org-mime-htmlize))) | 1807 | (local-set-key (kbd "C-c M-o") 'org-mime-htmlize))) |
@@ -1801,9 +1816,9 @@ See also `crux-reopen-as-root-mode'." | |||
1801 | (setup (:straight (org-taskwise | 1816 | (setup (:straight (org-taskwise |
1802 | :host github | 1817 | :host github |
1803 | :repo "duckwork/org-taskwise.el")) | 1818 | :repo "duckwork/org-taskwise.el")) |
1804 | (:load-after org) | 1819 | (with-eval-after-load 'org |
1805 | (:bind-into org-mode | 1820 | (require 'org-taskwise) |
1806 | "C-x n t" #'org-taskwise-narrow-to-task)) | 1821 | (define-key org-mode-map (kbd "C-x n t") #'org-taskwise-narrow-to-task))) |
1807 | 1822 | ||
1808 | (setup (:straight org-visibility) | 1823 | (setup (:straight org-visibility) |
1809 | (:require org-visibility) | 1824 | (:require org-visibility) |
@@ -1834,7 +1849,8 @@ See also `crux-reopen-as-root-mode'." | |||
1834 | lisp-interaction-mode-hook | 1849 | lisp-interaction-mode-hook |
1835 | lisp-mode-hook | 1850 | lisp-mode-hook |
1836 | scheme-mode-hook | 1851 | scheme-mode-hook |
1837 | geiser-mode-hook)) | 1852 | geiser-mode-hook |
1853 | geiser-repl-mode-hook)) | ||
1838 | (add-hook hook #'enable-paredit-mode)) | 1854 | (add-hook hook #'enable-paredit-mode)) |
1839 | (:also-load eldoc) | 1855 | (:also-load eldoc) |
1840 | (eldoc-add-command #'paredit-backward-delete #'paredit-close-round)) | 1856 | (eldoc-add-command #'paredit-backward-delete #'paredit-close-round)) |
@@ -1916,6 +1932,7 @@ See also `crux-reopen-as-root-mode'." | |||
1916 | +modeline-text-scale | 1932 | +modeline-text-scale |
1917 | ,(+modeline-concat | 1933 | ,(+modeline-concat |
1918 | '(+modeline-god-mode | 1934 | '(+modeline-god-mode |
1935 | +modeline-kmacro-indicator | ||
1919 | +modeline-reading-mode | 1936 | +modeline-reading-mode |
1920 | +modeline-narrowed) | 1937 | +modeline-narrowed) |
1921 | ",") | 1938 | ",") |
diff --git a/lisp/+elfeed.el b/lisp/+elfeed.el index ac316c4..8f7f17a 100644 --- a/lisp/+elfeed.el +++ b/lisp/+elfeed.el | |||
@@ -60,49 +60,51 @@ | |||
60 | (make-directory (file-name-directory script) :parents) | 60 | (make-directory (file-name-directory script) :parents) |
61 | (with-temp-buffer | 61 | (with-temp-buffer |
62 | (insert | 62 | (insert |
63 | (prin1-to-string ;; Print the following s-expression to a string | 63 | (let ((print-level nil) |
64 | `(progn | 64 | (print-length nil)) |
65 | ;; Set up the environment | 65 | (prin1-to-string ;; Print the following s-expression to a string |
66 | (setq lexical-binding t) | 66 | `(progn |
67 | (load (locate-user-emacs-file "early-init")) | 67 | ;; Set up the environment |
68 | (dolist (pkg '(elfeed elfeed-org)) | 68 | (setq lexical-binding t) |
69 | (straight-use-package pkg) | 69 | (load (locate-user-emacs-file "early-init")) |
70 | (require pkg)) | 70 | (dolist (pkg '(elfeed elfeed-org)) |
71 | ;; Copy variables from current environment | 71 | (straight-use-package pkg) |
72 | (progn | 72 | (require pkg)) |
73 | ,@(cl-loop for copy-var in '(rmh-elfeed-org-files | 73 | ;; Copy variables from current environment |
74 | elfeed-db-directory | 74 | (progn |
75 | elfeed-curl-program-name | 75 | ,@(cl-loop for copy-var in '(rmh-elfeed-org-files |
76 | elfeed-use-curl | 76 | elfeed-db-directory |
77 | elfeed-curl-extra-arguments | 77 | elfeed-curl-program-name |
78 | elfeed-enclosure-default-dir) | 78 | elfeed-use-curl |
79 | collect `(progn (message "%S = %S" ',copy-var ',(symbol-value copy-var)) | 79 | elfeed-curl-extra-arguments |
80 | (setq ,copy-var ',(symbol-value copy-var))))) | 80 | elfeed-enclosure-default-dir) |
81 | ;; Define new variables for this environment | 81 | collect `(progn (message "%S = %S" ',copy-var ',(symbol-value copy-var)) |
82 | (progn | 82 | (setq ,copy-var ',(symbol-value copy-var))))) |
83 | ,@(cl-loop for (new-var . new-val) in '((elfeed-curl-max-connections . 4)) | 83 | ;; Define new variables for this environment |
84 | collect `(progn (message "%S = %S" ',new-var ',new-val) | 84 | (progn |
85 | (setq ,new-var ',new-val)))) | 85 | ,@(cl-loop for (new-var . new-val) in '((elfeed-curl-max-connections . 4)) |
86 | ;; Redefine `elfeed-log' to log everything | 86 | collect `(progn (message "%S = %S" ',new-var ',new-val) |
87 | (defun elfeed-log (level fmt &rest objects) | 87 | (setq ,new-var ',new-val)))) |
88 | (princ (format "[%s] [%s]: %s\n" | 88 | ;; Redefine `elfeed-log' to log everything |
89 | (format-time-string "%F %T") | 89 | (defun elfeed-log (level fmt &rest objects) |
90 | level | 90 | (princ (format "[%s] [%s]: %s\n" |
91 | (apply #'format fmt objects)))) | 91 | (format-time-string "%F %T") |
92 | ;; Run elfeed | 92 | level |
93 | (elfeed-org) | 93 | (apply #'format fmt objects)))) |
94 | (elfeed) | 94 | ;; Run elfeed |
95 | (elfeed-db-load) | 95 | (elfeed-org) |
96 | (elfeed-update) | 96 | (elfeed) |
97 | ;; Wait for `elfeed-update' to finish | 97 | (elfeed-db-load) |
98 | (while (> (elfeed-queue-count-total) 0) | 98 | (elfeed-update) |
99 | (sleep-for 5) | 99 | ;; Wait for `elfeed-update' to finish |
100 | (message "%s" (elfeed-queue-count-total)) | 100 | (while (> (elfeed-queue-count-total) 0) |
101 | (accept-process-output)) | 101 | (sleep-for 5) |
102 | ;; Garbage collect and save the database | 102 | (message "%s" (elfeed-queue-count-total)) |
103 | (elfeed-db-gc) | 103 | (accept-process-output)) |
104 | (elfeed-db-save) | 104 | ;; Garbage collect and save the database |
105 | (princ (format ,update-message-format "done."))))) | 105 | (elfeed-db-gc) |
106 | (elfeed-db-save) | ||
107 | (princ (format ,update-message-format "done.")))))) | ||
106 | (write-file script)) | 108 | (write-file script)) |
107 | (chmod script #o777) | 109 | (chmod script #o777) |
108 | (message update-message-format "start") | 110 | (message update-message-format "start") |
diff --git a/lisp/+emacs.el b/lisp/+emacs.el index f26dc98..b7e31e2 100644 --- a/lisp/+emacs.el +++ b/lisp/+emacs.el | |||
@@ -60,15 +60,18 @@ Do this only if the buffer is not visiting a file." | |||
60 | enable-recursive-minibuffers t | 60 | enable-recursive-minibuffers t |
61 | executable-prefix-env t | 61 | executable-prefix-env t |
62 | fast-but-imprecise-scrolling t | 62 | fast-but-imprecise-scrolling t |
63 | find-file-visit-truename t | ||
64 | file-name-shadow-properties '(invisible t intangible t) | 63 | file-name-shadow-properties '(invisible t intangible t) |
65 | fill-column 80 | 64 | fill-column 80 |
65 | find-file-visit-truename t | ||
66 | frame-resize-pixelwise t | 66 | frame-resize-pixelwise t |
67 | global-auto-revert-non-file-buffers t | 67 | global-auto-revert-non-file-buffers t |
68 | global-mark-ring-max 100 | 68 | global-mark-ring-max 100 |
69 | hscroll-margin 1 | 69 | hscroll-margin 1 |
70 | hscroll-step 1 | 70 | hscroll-step 1 |
71 | imenu-auto-rescan t | 71 | imenu-auto-rescan t |
72 | image-use-external-converter (or (executable-find "convert") | ||
73 | (executable-find "gm") | ||
74 | (executable-find "ffmpeg")) | ||
72 | indent-tabs-mode nil | 75 | indent-tabs-mode nil |
73 | indicate-buffer-boundaries 'left | 76 | indicate-buffer-boundaries 'left |
74 | indicate-empty-lines nil | 77 | indicate-empty-lines nil |
@@ -104,7 +107,7 @@ Do this only if the buffer is not visiting a file." | |||
104 | save-interprogram-paste-before-kill t | 107 | save-interprogram-paste-before-kill t |
105 | scroll-conservatively 101 | 108 | scroll-conservatively 101 |
106 | scroll-down-aggressively 0.01 | 109 | scroll-down-aggressively 0.01 |
107 | scroll-margin 1 | 110 | scroll-margin 2 |
108 | scroll-preserve-screen-position 1 | 111 | scroll-preserve-screen-position 1 |
109 | scroll-step 1 | 112 | scroll-step 1 |
110 | scroll-up-aggressively 0.01 | 113 | scroll-up-aggressively 0.01 |
@@ -148,6 +151,9 @@ Do this only if the buffer is not visiting a file." | |||
148 | 151 | ||
149 | ;;; Encodings | 152 | ;;; Encodings |
150 | 153 | ||
154 | ;; Allegedly, this is the only one you need... | ||
155 | (set-language-environment "UTF-8") | ||
156 | ;; But I still set all of these, for fun. | ||
151 | (setq-default locale-coding-system 'utf-8-unix | 157 | (setq-default locale-coding-system 'utf-8-unix |
152 | coding-system-for-read 'utf-8-unix | 158 | coding-system-for-read 'utf-8-unix |
153 | coding-system-for-write 'utf-8-unix | 159 | coding-system-for-write 'utf-8-unix |
@@ -159,7 +165,6 @@ Do this only if the buffer is not visiting a file." | |||
159 | STRING)) | 165 | STRING)) |
160 | 166 | ||
161 | (set-charset-priority 'unicode) | 167 | (set-charset-priority 'unicode) |
162 | (set-language-environment "UTF-8") | ||
163 | (prefer-coding-system 'utf-8-unix) | 168 | (prefer-coding-system 'utf-8-unix) |
164 | (set-default-coding-systems 'utf-8-unix) | 169 | (set-default-coding-systems 'utf-8-unix) |
165 | (set-terminal-coding-system 'utf-8-unix) | 170 | (set-terminal-coding-system 'utf-8-unix) |
diff --git a/lisp/+ispell.el b/lisp/+ispell.el index c3ee417..697233f 100644 --- a/lisp/+ispell.el +++ b/lisp/+ispell.el | |||
@@ -58,30 +58,34 @@ prefix ARG is non-nil; then it just saves them." | |||
58 | (unless (buffer-file-name) | 58 | (unless (buffer-file-name) |
59 | (user-error "Buffer not attached to file")) | 59 | (user-error "Buffer not attached to file")) |
60 | (hack-dir-local-variables) | 60 | (hack-dir-local-variables) |
61 | (when-let ((new-words (+ispell-append-removing-duplicates | 61 | (let ((print-level nil) |
62 | :test #'string= | 62 | (print-length nil)) |
63 | ispell-buffer-session-localwords | 63 | (when-let ((new-words (cl-remove-if (lambda (el) (eq el '\.\.\.)) ; XXX: NO IDEA |
64 | (alist-get 'ispell-buffer-session-localwords | 64 | ; where this came from |
65 | dir-local-variables-alist) | 65 | (+ispell-append-removing-duplicates |
66 | (alist-get 'ispell-buffer-session-localwords | 66 | :test #'string= |
67 | file-local-variables-alist) | 67 | ispell-buffer-session-localwords |
68 | (+ispell-buffer-local-words-list)))) | 68 | (alist-get 'ispell-buffer-session-localwords |
69 | (save-excursion | 69 | dir-local-variables-alist) |
70 | (add-dir-local-variable | 70 | (alist-get 'ispell-buffer-session-localwords |
71 | major-mode | 71 | file-local-variables-alist) |
72 | 'ispell-buffer-session-localwords | 72 | (+ispell-buffer-local-words-list))))) |
73 | (setq ispell-buffer-session-localwords | 73 | (save-excursion |
74 | new-words)) | 74 | (add-dir-local-variable |
75 | (when (or arg | 75 | major-mode |
76 | (y-or-n-p "Save .dir-locals.el?")) | 76 | 'ispell-buffer-session-localwords |
77 | (save-buffer)) | 77 | (setq ispell-buffer-session-localwords |
78 | (bury-buffer)) | 78 | new-words)) |
79 | (or ispell-buffer-local-name | 79 | (when (or arg |
80 | (setq ispell-buffer-local-name (buffer-name))) | 80 | (y-or-n-p "Save .dir-locals.el?")) |
81 | (save-excursion | 81 | (save-buffer)) |
82 | (goto-char (point-min)) | 82 | (bury-buffer)) |
83 | (while (search-forward ispell-words-keyword nil t) | 83 | (or ispell-buffer-local-name |
84 | (delete-region (point-at-bol) (1+ (point-at-eol))))))) | 84 | (setq ispell-buffer-local-name (buffer-name))) |
85 | (save-excursion | ||
86 | (goto-char (point-min)) | ||
87 | (while (search-forward ispell-words-keyword nil t) | ||
88 | (delete-region (point-at-bol) (1+ (point-at-eol)))))))) | ||
85 | 89 | ||
86 | ;;;###autoload | 90 | ;;;###autoload |
87 | (defun +ispell-move-buffer-words-to-dir-locals-hook () | 91 | (defun +ispell-move-buffer-words-to-dir-locals-hook () |
diff --git a/lisp/+kmacro.el b/lisp/+kmacro.el index 2b2916f..a3cde61 100644 --- a/lisp/+kmacro.el +++ b/lisp/+kmacro.el | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | (defun +kmacro-change-mode-line (&rest _) | 22 | (defun +kmacro-change-mode-line (&rest _) |
23 | "Remap the mode-line face when recording a kmacro." | 23 | "Remap the mode-line face when recording a kmacro." |
24 | |||
24 | (add-to-list 'face-remapping-alist '(mode-line . +kmacro-modeline))) | 25 | (add-to-list 'face-remapping-alist '(mode-line . +kmacro-modeline))) |
25 | 26 | ||
26 | (defun +kmacro-restore-mode-line (&rest _) | 27 | (defun +kmacro-restore-mode-line (&rest _) |
diff --git a/lisp/+modeline.el b/lisp/+modeline.el index c8dab4e..7bef5c6 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el | |||
@@ -296,7 +296,7 @@ See `line-number-mode', `column-number-mode', `file-percentage-mode'" | |||
296 | (interactive "e") | 296 | (interactive "e") |
297 | (with-selected-window | 297 | (with-selected-window |
298 | (posn-window | 298 | (posn-window |
299 | (event-start ev)) | 299 | (event-start e)) |
300 | (god-local-mode -1) | 300 | (god-local-mode -1) |
301 | (force-mode-line-update))))) | 301 | (force-mode-line-update))))) |
302 | 'mouse-face 'mode-line-highlight)))) | 302 | 'mouse-face 'mode-line-highlight)))) |
@@ -326,5 +326,26 @@ See `line-number-mode', `column-number-mode', `file-percentage-mode'" | |||
326 | map)) | 326 | map)) |
327 | 'mouse-face 'mode-line-highlight)))) | 327 | 'mouse-face 'mode-line-highlight)))) |
328 | 328 | ||
329 | (defface +modeline-kmacro-indicator '((t :foreground "Firebrick")) | ||
330 | "Face for the kmacro indicator in the modeline.") | ||
331 | |||
332 | (defun +modeline-kmacro-indicator (&optional spacer) | ||
333 | "Display an indicator when recording a kmacro." | ||
334 | (when defining-kbd-macro | ||
335 | (concat (or spacer +modeline-default-spacer) | ||
336 | (propertize "●" | ||
337 | 'face '+modeline-kmacro-indicator | ||
338 | 'help-echo (format (concat "Defining a macro\n" | ||
339 | "Current step: %d\n" | ||
340 | "mouse-1: Stop recording") | ||
341 | kmacro-counter) | ||
342 | 'local-map (purecopy (simple-modeline-make-mouse-map | ||
343 | 'mouse-1 (lambda (e) | ||
344 | (interactive "e") | ||
345 | (with-selected-window | ||
346 | (posn-window (event-start e)) | ||
347 | (kmacro-end-macro nil))))) | ||
348 | 'mouse-face 'mode-line-highlight)))) | ||
349 | |||
329 | (provide '+modeline) | 350 | (provide '+modeline) |
330 | ;;; +modeline.el ends here | 351 | ;;; +modeline.el ends here |
diff --git a/lisp/+org.el b/lisp/+org.el index 2ff3e11..3d14c52 100644 --- a/lisp/+org.el +++ b/lisp/+org.el | |||
@@ -550,6 +550,7 @@ language name.") | |||
550 | "Export region to HTML, and copy it to the clipboard. | 550 | "Export region to HTML, and copy it to the clipboard. |
551 | Arguments ASYNC, SUBTREEP, VISIBLE-ONLY, BODY-ONLY, EXT-PLIST, | 551 | Arguments ASYNC, SUBTREEP, VISIBLE-ONLY, BODY-ONLY, EXT-PLIST, |
552 | and POST-PROCESS are passed to `org-export-to-file'." | 552 | and POST-PROCESS are passed to `org-export-to-file'." |
553 | (interactive) ; XXX: hould this be interactive? | ||
553 | (message "Exporting Org to HTML...") | 554 | (message "Exporting Org to HTML...") |
554 | (let ((org-tmp-file "/tmp/org.html")) | 555 | (let ((org-tmp-file "/tmp/org.html")) |
555 | (org-export-to-file 'html org-tmp-file | 556 | (org-export-to-file 'html org-tmp-file |
@@ -567,8 +568,5 @@ and POST-PROCESS are passed to `org-export-to-file'." | |||
567 | (interactive) | 568 | (interactive) |
568 | (+org-export-clip-to-html nil :subtree)) | 569 | (+org-export-clip-to-html nil :subtree)) |
569 | 570 | ||
570 | ;;; Taskwise functions | ||
571 | ;; TODO: break out into another library | ||
572 | |||
573 | (provide '+org) | 571 | (provide '+org) |
574 | ;;; +org.el ends here | 572 | ;;; +org.el ends here |
diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index c4b7420..e328146 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el | |||
@@ -27,7 +27,8 @@ | |||
27 | "Display `tracking-mode-line-buffers' in the tab-bar." | 27 | "Display `tracking-mode-line-buffers' in the tab-bar." |
28 | ;; TODO: write something to convert a mode-line construct to a tab-bar | 28 | ;; TODO: write something to convert a mode-line construct to a tab-bar |
29 | ;; construct. | 29 | ;; construct. |
30 | (when tracking-mode | 30 | (when (and tracking-mode |
31 | (not (bound-and-true-p org-clock-current-task))) | ||
31 | (cons (when (> (length tracking-mode-line-buffers) 0) | 32 | (cons (when (> (length tracking-mode-line-buffers) 0) |
32 | '(track-mode-line-separator menu-item " " ignore)) | 33 | '(track-mode-line-separator menu-item " " ignore)) |
33 | (cl-loop for i from 0 below (length tracking-mode-line-buffers) | 34 | (cl-loop for i from 0 below (length tracking-mode-line-buffers) |
@@ -63,7 +64,8 @@ | |||
63 | 64 | ||
64 | (defun +tab-bar-org-clock () | 65 | (defun +tab-bar-org-clock () |
65 | "Display `org-mode-line-string' in the tab-bar." | 66 | "Display `org-mode-line-string' in the tab-bar." |
66 | (when (org-clocking-p) | 67 | (when (and (fboundp 'org-clocking-p) |
68 | (org-clocking-p)) | ||
67 | ;; org-mode-line-string | 69 | ;; org-mode-line-string |
68 | `((org-clocking menu-item | 70 | `((org-clocking menu-item |
69 | ,org-mode-line-string | 71 | ,org-mode-line-string |
diff --git a/lisp/acdw.el b/lisp/acdw.el index 7012b16..de2b8e7 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -281,24 +281,30 @@ always nil; this function is mostly intended for use in init." | |||
281 | (defun chat-disconnect () | 281 | (defun chat-disconnect () |
282 | "Disconnect from all chats." | 282 | "Disconnect from all chats." |
283 | (interactive) | 283 | (interactive) |
284 | (ignore-errors | 284 | (+with-progress "Quitting circe..." |
285 | (circe-command-GQUIT "☮ 🫀 🍞")) | ||
286 | (ignore-errors | ||
287 | (jabber-disconnect)) | ||
288 | (dolist (team +slack-teams) | ||
289 | (ignore-errors | 285 | (ignore-errors |
290 | (slack-team-disconnect team))) | 286 | (circe-command-GQUIT "☮ 🫀 🍞") |
291 | (ignore-errors (slack-ws-close)) | 287 | (cancel-timer (irc-connection-get conn :flood-timer)))) |
292 | (+mapc-some-buffers (lambda () "Remove the buffer from tracking and kill it unconditionally." | 288 | (+with-progress "Quitting jabber..." |
293 | (let ((kill-buffer-query-functions nil)) | 289 | (ignore-errors |
294 | (tracking-remove-buffer (current-buffer)) | 290 | (jabber-disconnect))) |
295 | (kill-buffer))) | 291 | (+with-progress "Quitting-slack..." |
296 | (lambda () "Return t if derived from the following modes." | 292 | (dolist (team +slack-teams) |
297 | (derived-mode-p 'lui-mode | 293 | (ignore-errors |
298 | 'jabber-chat-mode | 294 | (slack-team-disconnect team))) |
299 | 'jabber-roster-mode | 295 | (ignore-errors (slack-ws-close))) |
300 | 'jabber-browse-mode | 296 | (+with-progress "Killing buffers..." |
301 | 'slack-mode)))) | 297 | (ignore-errors |
298 | (+mapc-some-buffers (lambda () "Remove the buffer from tracking and kill it unconditionally." | ||
299 | (let ((kill-buffer-query-functions nil)) | ||
300 | (tracking-remove-buffer (current-buffer)) | ||
301 | (kill-buffer))) | ||
302 | (lambda () "Return t if derived from the following modes." | ||
303 | (derived-mode-p 'lui-mode | ||
304 | 'jabber-chat-mode | ||
305 | 'jabber-roster-mode | ||
306 | 'jabber-browse-mode | ||
307 | 'slack-mode)))))) | ||
302 | 308 | ||
303 | ;; I can never remember all the damn chat things I run, so this just does all of em. | 309 | ;; I can never remember all the damn chat things I run, so this just does all of em. |
304 | (defun chat (&optional arg) | 310 | (defun chat (&optional arg) |
@@ -306,7 +312,9 @@ always nil; this function is mostly intended for use in init." | |||
306 | With optional ARG, kill all chat-related buffers first." | 312 | With optional ARG, kill all chat-related buffers first." |
307 | (interactive "P") | 313 | (interactive "P") |
308 | (when arg (chat-disconnect)) | 314 | (when arg (chat-disconnect)) |
309 | (mapc #'call-interactively chat-functions)) | 315 | (dolist-with-progress-reporter (fn chat-functions) |
316 | "Connecting to chat..." | ||
317 | (call-interactively fn))) | ||
310 | 318 | ||
311 | (defun +forward-paragraph (arg) | 319 | (defun +forward-paragraph (arg) |
312 | "Move forward ARG (simple) paragraphs. | 320 | "Move forward ARG (simple) paragraphs. |
@@ -353,5 +361,18 @@ SEPARATOR defaults to the newline (\\n)." | |||
353 | (with-current-buffer (find-file-noselect file) | 361 | (with-current-buffer (find-file-noselect file) |
354 | (buffer-string))) | 362 | (buffer-string))) |
355 | 363 | ||
364 | (defmacro +with-progress (pr-args &rest body) | ||
365 | "Perform BODY wrapped in a progress reporter. | ||
366 | PR-ARGS is the list of arguments to pass to | ||
367 | `make-progress-reporter'; it can be a single string for the | ||
368 | message, as well. If you want to use a formatted string, wrap | ||
369 | the `format' call in a list." | ||
370 | (declare (indent 1)) | ||
371 | (let ((reporter (gensym)) | ||
372 | (pr-args (if (listp pr-args) pr-args (list pr-args)))) | ||
373 | `(let ((,reporter (make-progress-reporter ,@pr-args))) | ||
374 | (prog1 (progn ,@body) | ||
375 | (progress-reporter-done ,reporter))))) | ||
376 | |||
356 | (provide 'acdw) | 377 | (provide 'acdw) |
357 | ;;; acdw.el ends here | 378 | ;;; acdw.el ends here |
diff --git a/machines/bob.el b/machines/bob.el index 8a2aefc..3455c44 100644 --- a/machines/bob.el +++ b/machines/bob.el | |||
@@ -10,8 +10,8 @@ | |||
10 | ;; Other ideas: [[https://twitter.com/NPRougier/status/1488570192561160195][from Nic Rougier]] | 10 | ;; Other ideas: [[https://twitter.com/NPRougier/status/1488570192561160195][from Nic Rougier]] |
11 | (add-function :after machine-after-load-theme | 11 | (add-function :after machine-after-load-theme |
12 | (defun +bob-set-faces (&rest _) | 12 | (defun +bob-set-faces (&rest _) |
13 | (let ((base-face "Monego") | 13 | (let ((base-face "Roboto Mono") |
14 | (italic-face "Victor Mono") | 14 | (italic-face nil) |
15 | ;; (bold-face nil) | 15 | ;; (bold-face nil) |
16 | (mono-face nil) | 16 | (mono-face nil) |
17 | (var-face "Lato") | 17 | (var-face "Lato") |
@@ -22,16 +22,17 @@ | |||
22 | :height ,base-size) | 22 | :height ,base-size) |
23 | ;; (bold :family ,(or bold-face base-face) | 23 | ;; (bold :family ,(or bold-face base-face) |
24 | ;; :weight bold) | 24 | ;; :weight bold) |
25 | (italic :family ,(or italic-face base-face) | 25 | ;; (italic :family ,(or italic-face base-face) |
26 | :weight medium | 26 | ;; :weight medium |
27 | :slant italic | 27 | ;; :slant italic |
28 | :height ,base-size) | 28 | ;; :height ,base-size) |
29 | (fixed-pitch :family ,(or mono-face base-face) | 29 | (fixed-pitch :family ,(or mono-face base-face) |
30 | :weight regular | 30 | :weight regular |
31 | :height ,base-size) | 31 | :height ,base-size) |
32 | (variable-pitch :family ,(or var-face base-face) | 32 | (variable-pitch :family ,(or var-face base-face) |
33 | :height 1.2) | 33 | :height 1.2) |
34 | (org-italic :family ,(or var-face base-face) | 34 | (org-italic :family ,(or var-face base-face) |
35 | :slant italic)))))) | 35 | :slant italic)))) |
36 | )) | ||
36 | 37 | ||
37 | ;;; bob.el ends here | 38 | ;;; bob.el ends here |
diff --git a/snippets/org-mode/sc b/snippets/org-mode/sc new file mode 100644 index 0000000..977fe22 --- /dev/null +++ b/snippets/org-mode/sc | |||
@@ -0,0 +1,4 @@ | |||
1 | # key: sc | ||
2 | # name: sc | ||
3 | # -- | ||
4 | [sc="${1: $(yas-choose-value '("total-recovery" "br-location-page" "_locationnameslisted" "organizations-helped" "other-results" "truck-accident-results" "car-wreck-results" "personal-injury-results" "number-locations" "experience" "employees" "mon-number" "mon-address" "lc-number" "lc-address" "ham-number" "ham-address" "zac-number" "zac-address" "liv-number" "liv-address" "asc-number" "asc-address" "shrev-number" "shrev-address" "alx-address" "alx-number" "laf-number" "laf-address" "toll-free" "br-number" "br-address" "gmia"))}"][/sc] $0 \ No newline at end of file | ||
diff --git a/snippets/sh-mode/getopts b/snippets/sh-mode/getopts new file mode 100644 index 0000000..8f6fc39 --- /dev/null +++ b/snippets/sh-mode/getopts | |||
@@ -0,0 +1,10 @@ | |||
1 | # -*- mode: snippet -*- | ||
2 | # name: getopts | ||
3 | # key: getopts | ||
4 | # -- | ||
5 | while getopts ${1:h} opt; do | ||
6 | case "$opt" in | ||
7 | $0 | ||
8 | esac | ||
9 | done | ||
10 | shift $(( OPTIND -1 )) \ No newline at end of file | ||