diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 99 |
1 files changed, 57 insertions, 42 deletions
diff --git a/init.el b/init.el index 47f672f..4a4c57c 100644 --- a/init.el +++ b/init.el | |||
@@ -113,7 +113,8 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
113 | (:option auth-sources '("~/.authinfo" "~/.authinfo.gpg"))) | 113 | (:option auth-sources '("~/.authinfo" "~/.authinfo.gpg"))) |
114 | 114 | ||
115 | (setup autorevert | 115 | (setup autorevert |
116 | (:option global-auto-revert-non-file-buffers t) | 116 | (:option global-auto-revert-non-file-buffers t |
117 | auto-revert-verbose nil) | ||
117 | (global-auto-revert-mode +1)) | 118 | (global-auto-revert-mode +1)) |
118 | 119 | ||
119 | (setup (:straight avy) | 120 | (setup (:straight avy) |
@@ -257,15 +258,28 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
257 | 258 | ||
258 | circe-command-QUIT :after | 259 | circe-command-QUIT :after |
259 | (defun circe-quit@kill-buffer (&rest _) | 260 | (defun circe-quit@kill-buffer (&rest _) |
260 | (let ((circe-server-killed-confirmation 'kill-all)) | 261 | ;; `circe-server-killed-confirmation' set to nil, and manually |
262 | ;; deleting all chat buffers, pending Github issue #402 | ||
263 | ;; (https://github.com/emacs-circe/circe/issues/402) | ||
264 | (let ((circe-server-killed-confirmation nil)) | ||
261 | (with-circe-server-buffer | 265 | (with-circe-server-buffer |
266 | (dolist (buf (circe-server-chat-buffers)) | ||
267 | (let ((circe-channel-killed-confirmation nil)) | ||
268 | (kill-buffer buf))) | ||
262 | (kill-buffer)))) | 269 | (kill-buffer)))) |
263 | 270 | ||
264 | circe-command-GQUIT :after | 271 | circe-command-GQUIT :after |
265 | (defun circe-gquit@kill-buffer (&rest _) | 272 | (defun circe-gquit@kill-buffer (&rest _) |
266 | (let ((circe-server-killed-confirmation 'kill-all)) | 273 | ;; `circe-server-killed-confirmation' set to nil, and manually |
274 | ;; deleting all chat buffers, pending Github issue #402 | ||
275 | ;; (https://github.com/emacs-circe/circe/issues/402) | ||
276 | (let ((circe-server-killed-confirmation nil)) | ||
267 | (dolist (buf (circe-server-buffers)) | 277 | (dolist (buf (circe-server-buffers)) |
268 | (with-current-buffer buf | 278 | (with-current-buffer buf |
279 | (dolist (buf (circe-server-chat-buffers)) | ||
280 | (let ((circe-channel-killed-confirmation nil)) | ||
281 | (kill-buffer buf))) | ||
282 | (message "%s: %s" buf circe-server-killed-confirmation) | ||
269 | (kill-buffer)))))) | 283 | (kill-buffer)))))) |
270 | 284 | ||
271 | (defun circe-command-SHORTEN (url) | 285 | (defun circe-command-SHORTEN (url) |
@@ -469,8 +483,8 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
469 | (:hook visual-line-mode)) | 483 | (:hook visual-line-mode)) |
470 | 484 | ||
471 | (setup (:straight-if (define-repeat-map | 485 | (setup (:straight-if (define-repeat-map |
472 | :host nil | 486 | :host nil |
473 | :repo "https://tildegit.org/acdw/define-repeat-map.el") | 487 | :repo "https://tildegit.org/acdw/define-repeat-map.el") |
474 | (acdw/system :home)) | 488 | (acdw/system :home)) |
475 | 489 | ||
476 | (defun acdw/other-window-or-switch-buffer-backward () | 490 | (defun acdw/other-window-or-switch-buffer-backward () |
@@ -607,8 +621,7 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
607 | 621 | ||
608 | ;; requires extension: | 622 | ;; requires extension: |
609 | ;; https://addons.mozilla.org/en-US/firefox/addon/edit-with-emacs1/ | 623 | ;; https://addons.mozilla.org/en-US/firefox/addon/edit-with-emacs1/ |
610 | (setup (:straight-if edit-server | 624 | (setup (:straight edit-server) |
611 | (daemonp)) | ||
612 | (:require edit-server) | 625 | (:require edit-server) |
613 | (edit-server-start) | 626 | (edit-server-start) |
614 | 627 | ||
@@ -769,8 +782,7 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
769 | "C-x o" #'acdw/other-window-or-switch-buffer | 782 | "C-x o" #'acdw/other-window-or-switch-buffer |
770 | "C-x O" #'acdw/other-window-or-switch-buffer-backward | 783 | "C-x O" #'acdw/other-window-or-switch-buffer-backward |
771 | "C-c _" #'add-file-local-variable | 784 | "C-c _" #'add-file-local-variable |
772 | "C-x C-c" #'delete-frame ; I keep fat-fingering and exiting | 785 | "C-x C-c" #'acdw/fat-finger-exit) |
773 | ) | ||
774 | 786 | ||
775 | (:with-map toggle-map | 787 | (:with-map toggle-map |
776 | (:bind "c" #'column-number-mode | 788 | (:bind "c" #'column-number-mode |
@@ -923,8 +935,19 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
923 | (load (expand-file-name "eshell" user-emacs-directory)))))) | 935 | (load (expand-file-name "eshell" user-emacs-directory)))))) |
924 | 936 | ||
925 | (setup eww | 937 | (setup eww |
938 | (defvar-local eww-readable-p nil | ||
939 | "Whether current buffer is in readable-mode.") | ||
926 | (:option eww-search-prefix "https://duckduckgo.com/html?q=" | 940 | (:option eww-search-prefix "https://duckduckgo.com/html?q=" |
927 | url-privacy-level '(email agent cookies lastloc)) | 941 | url-privacy-level '(email agent cookies lastloc)) |
942 | |||
943 | (defun eww@is-readable (&rest _) | ||
944 | (setq-local eww-readable-p t)) | ||
945 | (defun eww@is-not-readable (&rest _) | ||
946 | (setq-local eww-readable-p nil)) | ||
947 | |||
948 | (advice-add 'eww-readable :after #'eww@is-readable) | ||
949 | (advice-add 'eww-render :after #'eww@is-not-readable) | ||
950 | (advice-add 'eww-back-url :after #'eww@is-not-readable) | ||
928 | 951 | ||
929 | (:hook #'reading-mode)) | 952 | (:hook #'reading-mode)) |
930 | 953 | ||
@@ -934,29 +957,7 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
934 | (exec-path-from-shell-initialize))) | 957 | (exec-path-from-shell-initialize))) |
935 | 958 | ||
936 | (setup (:straight expand-region) | 959 | (setup (:straight expand-region) |
937 | (:global "C-=" #'er/expand-region | 960 | (:global "C-=" #'er/expand-region)) |
938 | "C-SPC" | ||
939 | (defun acdw/set-mark-or-expand-region (arg) | ||
940 | "Set mark at point and activate, jump to mark, or expand region. | ||
941 | See `set-mark-command' and `expand-region'. | ||
942 | |||
943 | With no prefix argument, either run `set-mark-command' on first | ||
944 | invocation and `er/expand-region' on each successive invocation. | ||
945 | |||
946 | With any prefix argument | ||
947 | (e.g., \\[universal-argument] \\[set-mark-command]), act as with | ||
948 | `set-mark-command' (i.e., pop the mark). Don't care about | ||
949 | successive invocations." | ||
950 | (interactive "P") | ||
951 | (cond | ||
952 | ((or arg | ||
953 | (and set-mark-command-repeat-pop | ||
954 | (eq last-command 'pop-to-mark-command))) | ||
955 | (setq this-command 'set-mark-command) | ||
956 | (set-mark-command arg)) | ||
957 | ((eq last-command 'acdw/set-mark-or-expand-region) | ||
958 | (er/expand-region 1)) | ||
959 | (t (set-mark-command arg)))))) | ||
960 | 961 | ||
961 | (setup (:straight-if fennel-mode | 962 | (setup (:straight-if fennel-mode |
962 | (executable-find "fennel")) | 963 | (executable-find "fennel")) |
@@ -1046,11 +1047,18 @@ specific to most general, they are these: | |||
1046 | 1047 | ||
1047 | (setup (:straight flyspell-correct) | 1048 | (setup (:straight flyspell-correct) |
1048 | (:option flyspell-correct-interface #'flyspell-correct-completing-read | 1049 | (:option flyspell-correct-interface #'flyspell-correct-completing-read |
1049 | flyspell-correct--cr-key "`") | 1050 | flyspell-correct--cr-key ";") |
1051 | |||
1052 | (defun acdw/flyspell-correct-f7 () | ||
1053 | "Run a full spell correction on the current buffer." | ||
1054 | (interactive) | ||
1055 | (save-mark-and-excursion | ||
1056 | (flyspell-correct-move 0 :forward :rapid))) | ||
1057 | |||
1050 | (:with-feature flyspell | 1058 | (:with-feature flyspell |
1051 | (:hook (defun flyspell@correct () | 1059 | (:bind "C-." #'flyspell-correct-wrapper |
1052 | (:bind "C-;" #'flyspell-correct-wrapper) | 1060 | "<f7>" #'acdw/flyspell-correct-f7) |
1053 | (:unbind "C-," "C-." "C-M-i"))))) | 1061 | (:unbind "C-," "C-." "C-M-i"))) |
1054 | 1062 | ||
1055 | (setup (:straight-if forge | 1063 | (setup (:straight-if forge |
1056 | (acdw/system :home)) | 1064 | (acdw/system :home)) |
@@ -1338,9 +1346,11 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1338 | (setup (:straight markdown-mode) | 1346 | (setup (:straight markdown-mode) |
1339 | (:file-match (rx ".md" eos) | 1347 | (:file-match (rx ".md" eos) |
1340 | (rx ".markdown" eos)) | 1348 | (rx ".markdown" eos)) |
1349 | (:hook #'variable-pitch-mode) | ||
1341 | 1350 | ||
1342 | (:with-mode gfm-mode | 1351 | (:with-mode gfm-mode |
1343 | (:file-match (rx "README.md" eos))) | 1352 | (:file-match (rx "README.md" eos)) |
1353 | (:hook #'variable-pitch-mode)) | ||
1344 | 1354 | ||
1345 | (when (executable-find "markdownfmt") | 1355 | (when (executable-find "markdownfmt") |
1346 | (with-eval-after-load 'apheleia | 1356 | (with-eval-after-load 'apheleia |
@@ -1480,10 +1490,11 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1480 | (:option | 1490 | (:option |
1481 | org-adapt-indentation nil | 1491 | org-adapt-indentation nil |
1482 | org-agenda-files nil ; only until I set this up | 1492 | org-agenda-files nil ; only until I set this up |
1483 | org-catch-invisible-edits 'smart | 1493 | org-catch-invisible-edits 'show-and-error |
1484 | org-clock-clocked-in-display 'mode-line | 1494 | org-clock-clocked-in-display 'mode-line |
1485 | org-clock-string-limit 7 ; gives time and not title | 1495 | org-clock-string-limit 7 ; gives time and not title |
1486 | org-confirm-babel-evaluate nil | 1496 | org-confirm-babel-evaluate nil |
1497 | org-cycle-separator-lines 0 | ||
1487 | org-directory "~/org" | 1498 | org-directory "~/org" |
1488 | org-ellipsis " …" | 1499 | org-ellipsis " …" |
1489 | org-export-coding-system 'utf-8-unix | 1500 | org-export-coding-system 'utf-8-unix |
@@ -1499,6 +1510,9 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1499 | org-html-coding-system 'utf-8-unix | 1510 | org-html-coding-system 'utf-8-unix |
1500 | org-image-actual-width '(300) | 1511 | org-image-actual-width '(300) |
1501 | org-imenu-depth 3 | 1512 | org-imenu-depth 3 |
1513 | org-list-demote-modify-bullet '(("-" . "+") | ||
1514 | ("+" . "*") | ||
1515 | ("*" . "-")) | ||
1502 | org-outline-path-complete-in-steps nil | 1516 | org-outline-path-complete-in-steps nil |
1503 | org-pretty-entities t | 1517 | org-pretty-entities t |
1504 | org-refile-use-outline-path 'file | 1518 | org-refile-use-outline-path 'file |
@@ -1603,7 +1617,7 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1603 | (paredit-mode +1)) | 1617 | (paredit-mode +1)) |
1604 | 1618 | ||
1605 | (dolist (mode lispy-modes) | 1619 | (dolist (mode lispy-modes) |
1606 | (add-hook (intern (concat (symbol-name mode) "-hook")) | 1620 | (add-hook (intern (format "%s-hook" mode)) |
1607 | #'paredit@setup)) | 1621 | #'paredit@setup)) |
1608 | 1622 | ||
1609 | (:also-load eldoc) | 1623 | (:also-load eldoc) |
@@ -1611,7 +1625,7 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1611 | 1625 | ||
1612 | (setup (:straight paren-face) | 1626 | (setup (:straight paren-face) |
1613 | (dolist (mode lispy-modes) | 1627 | (dolist (mode lispy-modes) |
1614 | (add-hook (intern (concat (symbol-name mode) "-hook")) #'paren-face-mode))) | 1628 | (add-hook (intern (format "%s-hook" mode)) #'paren-face-mode))) |
1615 | 1629 | ||
1616 | (setup (:straight-if (pdf-tools | 1630 | (setup (:straight-if (pdf-tools |
1617 | :host github | 1631 | :host github |
@@ -1641,8 +1655,8 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1641 | (:global "C-c l t" #'powerthesaurus-lookup-word-dwim)) | 1655 | (:global "C-c l t" #'powerthesaurus-lookup-word-dwim)) |
1642 | 1656 | ||
1643 | (setup (:straight prism) | 1657 | (setup (:straight prism) |
1644 | (:hook-into lisp-mode | 1658 | (dolist (mode lispy-modes) |
1645 | c-mode)) | 1659 | (add-hook (intern (format "%s-hook" mode)) #'prism-mode))) |
1646 | 1660 | ||
1647 | (setup prog | 1661 | (setup prog |
1648 | (:option show-paren-delay 0 | 1662 | (:option show-paren-delay 0 |
@@ -1813,6 +1827,7 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1813 | simple-modeline-segment-process | 1827 | simple-modeline-segment-process |
1814 | acdw-modeline/god-mode-indicator | 1828 | acdw-modeline/god-mode-indicator |
1815 | acdw-modeline/minions | 1829 | acdw-modeline/minions |
1830 | acdw-modeline/reading-mode | ||
1816 | acdw-modeline/narrowed | 1831 | acdw-modeline/narrowed |
1817 | acdw-modeline/major-mode))) | 1832 | acdw-modeline/major-mode))) |
1818 | 1833 | ||