about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.gitignore12
-rw-r--r--early-init.el6
-rw-r--r--gnus.el45
-rw-r--r--init.el137
4 files changed, 135 insertions, 65 deletions
diff --git a/.gitignore b/.gitignore index 8de33a1..474457c 100644 --- a/.gitignore +++ b/.gitignore
@@ -1,10 +1,12 @@
1*~
1.org-id-locations 2.org-id-locations
2eln-cache/
3auto-save-list/ 3auto-save-list/
4server/ 4eln-cache/
5var/
6etc/ 5etc/
6gnus/
7racket-mode/
8server/
7straight/ 9straight/
8transient/ 10transient/
9racket-mode/ 11var/
10*~ \ No newline at end of file 12pkg/ \ No newline at end of file
diff --git a/early-init.el b/early-init.el index 9711df3..412a2c9 100644 --- a/early-init.el +++ b/early-init.el
@@ -30,7 +30,8 @@
30 30
31(setq load-prefer-newer noninteractive 31(setq load-prefer-newer noninteractive
32 orig-file-name-handler-alist file-name-handler-alist 32 orig-file-name-handler-alist file-name-handler-alist
33 file-name-handler-alist nil) 33 file-name-handler-alist nil
34 inhibit-x-resources t)
34(acdw/gc-disable) 35(acdw/gc-disable)
35 36
36(hook-defun post-init-reset after-init-hook 37(hook-defun post-init-reset after-init-hook
@@ -110,7 +111,8 @@
110 package-quickstart nil 111 package-quickstart nil
111 straight-host-usernames '((github . "duckwork") 112 straight-host-usernames '((github . "duckwork")
112 (gitlab . "acdw")) 113 (gitlab . "acdw"))
113 straight-base-dir (acdw/dir)) 114 straight-base-dir (acdw/dir)
115 straight-check-for-modifications '(check-on-save find-when-checking))
114 116
115;; 3. Bootstrap `straight'. 117;; 3. Bootstrap `straight'.
116(defvar bootstrap-version) 118(defvar bootstrap-version)
diff --git a/gnus.el b/gnus.el new file mode 100644 index 0000000..d211f70 --- /dev/null +++ b/gnus.el
@@ -0,0 +1,45 @@
1;;; gnus.el -*- lexical-binding: t; coding: utf-8-unix -*-
2
3;; Author: Case Duckworth <acdw@acdw.net>
4;; Created: Sometime during Covid-19, 2020
5;; Keywords: configuration
6;; URL: https://tildegit.org/acdw/emacs
7
8;; This file is NOT part of GNU Emacs.
9
10;;; License:
11;; Everyone is permitted to do whatever with this software, without
12;; limitation. This software comes without any warranty whatsoever,
13;; but with two pieces of advice:
14;; - Don't hurt yourself.
15;; - Make good choices.
16
17;;; Code:
18
19;; https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org
20
21;; searching (?)
22(require 'nnir)
23
24;; contacts
25(setup (:straight bbdb)
26 (require 'bbdb)
27 (bbdb-initialize 'message 'gnus 'sendmail)
28 (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
29 (:option bbdb/mail-auto-create-p t
30 bbdb/news-auto-create-p t))
31
32;; select methods
33(setq gnus-select-method '(nnimap "fastmail"
34 (nnimap-address "imap.fastmail.com")
35 (nnimap-server-port 993)
36 (nnimap-stream ssl)
37 (nnir-search-engine imap)))
38
39;; options
40(setq gnus-thread-sort-functions '(gnus-thread-sort-by-most-recent-date
41 (not gnus-thread-sort-by-number))
42 gnus-use-cache t
43 gnus-summary-thread-gathering-function #'gnus-gather-threads-by-subject
44 gnus-thread-hide-subtree t
45 gnus-thread-ignore-subject t)
diff --git a/init.el b/init.el index a92520b..e8ec188 100644 --- a/init.el +++ b/init.el
@@ -15,6 +15,10 @@
15;; - Make good choices. 15;; - Make good choices.
16 16
17;;; Code: 17;;; Code:
18
19;; Let's use lexical binding by default, shall we?
20(setq-default lexical-binding t)
21
18 22
19;;; Necessary packages 23;;; Necessary packages
20 24
@@ -47,7 +51,7 @@
47 51
48(setup-define :mode 52(setup-define :mode
49 (lambda (ext) 53 (lambda (ext)
50 `(add-to-list 'auto-mode-alist '(,ext . setup-mode))) 54 `(add-to-list 'auto-mode-alist (cons ,ext setup-mode)))
51 :documentation "Add SETUP-MODE to `auto-mode-alist' for EXTENSION." 55 :documentation "Add SETUP-MODE to `auto-mode-alist' for EXTENSION."
52 :repeatable t) 56 :repeatable t)
53 57
@@ -57,6 +61,10 @@
57 no-littering-var-directory (acdw/dir)) 61 no-littering-var-directory (acdw/dir))
58 (require 'no-littering)) 62 (require 'no-littering))
59 63
64;;; My packages
65(let ((default-directory (expand-file-name "pkg/" user-emacs-directory)))
66 (normal-top-level-add-subdirs-to-load-path))
67
60 68
61;;; Good defaults 69;;; Good defaults
62 70
@@ -101,7 +109,7 @@
101 (delete-selection-mode +1) 109 (delete-selection-mode +1)
102 110
103 ;; Encoding 111 ;; Encoding
104 (:option local-coding-system 'utf-8-unix 112 (:option locale-coding-system 'utf-8-unix
105 coding-system-for-read 'utf-8-unix 113 coding-system-for-read 'utf-8-unix
106 coding-system-for-write 'utf-8-unix 114 coding-system-for-write 'utf-8-unix
107 buffer-file-coding-system 'utf-8-unix 115 buffer-file-coding-system 'utf-8-unix
@@ -117,8 +125,13 @@
117 (set-default-coding-systems 'utf-8-unix) 125 (set-default-coding-systems 'utf-8-unix)
118 (set-terminal-coding-system 'utf-8-unix) 126 (set-terminal-coding-system 'utf-8-unix)
119 (set-keyboard-coding-system 'utf-8-unix) 127 (set-keyboard-coding-system 'utf-8-unix)
120 (set-selection-coding-system 'utf-8-unix)
121 128
129 (pcase acdw/system
130 (:work (set-clipboard-coding-system 'utf-16-le)
131 (set-selection-coding-system 'utf-16-le))
132 (_ (set-selection-coding-system 'utf-8)
133 (set-clipboard-coding-system 'utf-8)))
134
122 ;; Cursor 135 ;; Cursor
123 (:option cursor-type 'bar 136 (:option cursor-type 'bar
124 cursor-in-non-selected-windows 'hollow 137 cursor-in-non-selected-windows 'hollow
@@ -144,6 +157,7 @@
144 157
145 (minibuffer-depth-indicate-mode +1) 158 (minibuffer-depth-indicate-mode +1)
146 (file-name-shadow-mode +1) 159 (file-name-shadow-mode +1)
160 (minibuffer-electric-default-mode +1)
147 (fset 'yes-or-no-p #'y-or-n-p) 161 (fset 'yes-or-no-p #'y-or-n-p)
148 162
149 ;; Completion 163 ;; Completion
@@ -183,7 +197,7 @@
183 tab-bar-show 1 197 tab-bar-show 1
184 use-dialog-box nil 198 use-dialog-box nil
185 use-file-dialog nil 199 use-file-dialog nil
186 echo-keystrokes 0.25 200 echo-keystrokes 0.01
187 recenter-positions '(top middle bottom) 201 recenter-positions '(top middle bottom)
188 attempt-stack-overflow-recovery nil 202 attempt-stack-overflow-recovery nil
189 attempt-orderly-shutdown-on-fatal-signal nil 203 attempt-orderly-shutdown-on-fatal-signal nil
@@ -356,28 +370,30 @@
356(setup (:straight (org :host nil 370(setup (:straight (org :host nil
357 :repo "https://code.orgmode.org/bzg/org-mode.git")) 371 :repo "https://code.orgmode.org/bzg/org-mode.git"))
358 (require 'acdw-org) 372 (require 'acdw-org)
359 (:option org-directory "~/org" 373 (:option org-adapt-indentation nil
360 org-hide-emphasis-markers t
361 org-fontify-whole-heading-line t
362 org-fontify-done-headline t
363 org-fontify-quote-and-verse-blocks t
364 org-src-fontify-natively t
365 org-pretty-entities t
366 org-tags-column (- 0 fill-column -3)
367 org-src-tab-acts-natively t
368 org-src-window-setup 'current-window
369 org-confirm-babel-evaluate nil
370 org-adapt-indentation nil
371 org-catch-invisible-edits 'smart 374 org-catch-invisible-edits 'smart
372 org-special-ctrl-a/e t 375 org-confirm-babel-evaluate nil
373 org-special-ctrl-k t 376 org-export-coding-system 'utf-8-unix
374 org-imenu-depth 3
375 org-export-headline-levels 8 377 org-export-headline-levels 8
378 org-export-with-section-numbers nil
376 org-export-with-smart-quotes t 379 org-export-with-smart-quotes t
377 org-export-with-sub-superscripts t 380 org-export-with-sub-superscripts t
378 org-export-coding-system 'utf-8-unix 381 org-export-with-toc nil
382 org-fontify-done-headline t
383 org-fontify-quote-and-verse-blocks t
384 org-fontify-whole-heading-line t
385 org-hide-emphasis-markers t
379 org-html-coding-system 'utf-8-unix 386 org-html-coding-system 'utf-8-unix
380 org-startup-truncated nil) 387 org-imenu-depth 3
388 org-pretty-entities t
389 org-special-ctrl-a/e t
390 org-special-ctrl-k t
391 org-src-fontify-natively t
392 org-src-tab-acts-natively t
393 org-src-window-setup 'current-window
394 org-startup-truncated nil
395 org-tags-column (- 0 fill-column -3)
396 org-directory "~/org")
381 (:bind "RET" unpackaged/org-return-dwim) 397 (:bind "RET" unpackaged/org-return-dwim)
382 (add-hook 'before-save-hook #'acdw/hook--org-mode-fix-blank-lines) 398 (add-hook 'before-save-hook #'acdw/hook--org-mode-fix-blank-lines)
383 (advice-add 'org-delete-backward-char :override #'acdw-org/delete-backward-char)) 399 (advice-add 'org-delete-backward-char :override #'acdw-org/delete-backward-char))
@@ -434,6 +450,7 @@
434 "o" elpher-follow-current-link 450 "o" elpher-follow-current-link
435 "G" elpher-go-current) 451 "G" elpher-go-current)
436 (:hook acdw/reading-mode) 452 (:hook acdw/reading-mode)
453 (autoload 'elpher-bookmarks "elpher" nil t)
437 ;; Make `eww' gemini/gopher aware. From Emacswiki. 454 ;; Make `eww' gemini/gopher aware. From Emacswiki.
438 (advice-add 'eww-browse-url :around 455 (advice-add 'eww-browse-url :around
439 (defun elpher:eww-browse-url (original url &optional new-window) 456 (defun elpher:eww-browse-url (original url &optional new-window)
@@ -480,21 +497,30 @@
480 497
481(setup (:straight magit) 498(setup (:straight magit)
482 (:leader "g" magit-status) 499 (:leader "g" magit-status)
483 (:option magit-display-buffer-function 500
484 (defun magit-display-buffer-same-window (buffer) 501 (defun magit-display-buffer-same-window (buffer)
485 "Display BUFFER in the selected window like God intended." 502 "Display BUFFER in the selected window like God intended."
486 (display-buffer buffer '(display-buffer-same-window))) 503 (display-buffer buffer '(display-buffer-same-window)))
487 magit-popup-display-buffer-action '((display-buffer-same-window)))) 504
505 (:option magit-display-buffer-function #'magit-display-buffer-same-window
506 magit-popup-display-buffer-action '((display-buffer-same-window))
507 magit-refresh-status-buffer nil))
488 508
489(setup (:straight nov) 509(setup (:straight nov)
490 (:option nov-text-width fill-column) 510 (:option nov-text-width fill-column)
491 (:mode "\\.epub\\'")) 511 (:mode "\\.epub\\'"))
492 512
513(setup gnus
514 (:option gnus-home-directory (expand-file-name "gnus" user-emacs-directory)
515 gnus-directory (expand-file-name "gnus/News" user-emacs-directory)
516 gnus-init-file (expand-file-name "gnus.el" user-emacs-directory))
517 (when (not (file-exists-p gnus-directory))
518 (make-directory gnus-directory :parents)))
519
493(when (eq acdw/system :home) 520(when (eq acdw/system :home)
494 (setup (:straight pdf-tools) 521 (setup (:straight pdf-tools)
495 (pdf-loader-install))) 522 (pdf-loader-install))
496 523
497(when (eq acdw/system :home)
498 (setup (:straight vterm))) 524 (setup (:straight vterm)))
499 525
500 526
@@ -568,28 +594,24 @@ call `zzz-to-char'."
568 594
569 (global-undo-fu-session-mode +1)) 595 (global-undo-fu-session-mode +1))
570 596
571;; (setup (:straight icomplete-vertical) 597(setup (:straight (vertico
572;; (:with-map icomplete-minibuffer-map 598 :host github
573;; (:bind "<down>" icomplete-forward-completions 599 :repo "minad/vertico"))
574;; "C-n" icomplete-forward-completions 600 (setq resize-mini-windows t)
575;; "<up>" icomplete-backward-completions 601 (if (boundp 'comp-deferred-compilation-deny-list)
576;; "C-p" icomplete-backward-completions 602 (add-to-list 'comp-deferred-compilation-deny-list "vertico"))
577;; "C-v" icomplete-vertical-toggle
578;; "RET" icomplete-force-complete-and-exit
579;; "C-RET" minibuffer-complete-and-exit))
580;; (icomplete-vertical-mode +1))
581
582(setup (:straight vertico)
583 (if (bound-and-true-p comp-deferred-compilation-deny-list)
584 (add-to-list 'comp-deferred-compilation-deny-list 'vertico))
585 (icomplete-mode -1) 603 (icomplete-mode -1)
586 (icomplete-vertical-mode -1)
587 (vertico-mode +1)) 604 (vertico-mode +1))
588 605
589(setup (:straight orderless) 606(setup (:straight (orderless
607 :host github
608 :repo "oantolin/orderless"))
609 (require 'orderless)
590 (:option (prepend completion-styles) 'orderless)) 610 (:option (prepend completion-styles) 'orderless))
591 611
592(setup (:straight consult) 612(setup (:straight (consult
613 :host github
614 :repo "minad/consult"))
593 615
594 ;; "Sensible" functions 616 ;; "Sensible" functions
595 (defun consult-sensible-grep () 617 (defun consult-sensible-grep ()
@@ -743,18 +765,17 @@ if ripgrep is installed, otherwise `consult-grep'."
743 (apheleia--get-formatter-command))) 765 (apheleia--get-formatter-command)))
744 (indent-region (point-min) (point-max))))) 766 (indent-region (point-min) (point-max)))))
745 767
746(setup (:straight company) 768(setup (:straight (corfu
747 (:hook-into prog-mode) 769 :host github
748 (:hook company-tng-mode) 770 :repo "minad/corfu"))
749 771 (:option completion-cycle-threshold 3
750 (if (eq acdw/system :home) 772 tab-always-indent 'complete
751 (setq company-idle-delay 0.25) 773 corfu-cycle t)
752 (setq company-idle-delay nil)) 774 (:with-map corfu-map
753 775 (:bind "TAB" corfu-next
754 (:global "M-/" company-complete) 776 "S-TAB" corfu-previous))
755 (:with-map company-active-map 777 (:hook-into prog-mode
756 (:bind "C-d" company-show-doc-buffer 778 eshell-mode))
757 "M-." company-show-location)))
758 779
759;;; Lisps 780;;; Lisps
760(defvar lispy-modes '(emacs-lisp-mode 781(defvar lispy-modes '(emacs-lisp-mode
@@ -818,7 +839,7 @@ if ripgrep is installed, otherwise `consult-grep'."
818 (with-eval-after-load 'company 839 (with-eval-after-load 'company
819 (setup (:straight slime-company) 840 (setup (:straight slime-company)
820 (:option slime-company-completion 'fuzzy 841 (:option slime-company-completion 'fuzzy
821 slime-company-after-completion 'slime-company-just-one-space) 842 slime-company-after-completion nil)
822 (slime-setup '(slime-fancy slime-company)))))) 843 (slime-setup '(slime-fancy slime-company))))))
823 844
824(when (executable-find "fennel") 845(when (executable-find "fennel")