summary refs log tree commit diff stats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md201
1 files changed, 170 insertions, 31 deletions
diff --git a/README.md b/README.md index 39430ab..1347bdc 100644 --- a/README.md +++ b/README.md
@@ -29,6 +29,8 @@ Let’s configure Emacs using Org mode, they said. It’ll be fun, they said.
29 29
30### Straight.el 30### Straight.el
31 31
32This still doesn’t work under Windows – I have to manually download the [repo archive](https://github.com/raxod502/straight.el/archive/master.zip) and unzip it. Not the biggest burden, I suppose.
33
32 (defvar bootstrap-version) 34 (defvar bootstrap-version)
33 (let ((bootstrap-file 35 (let ((bootstrap-file
34 (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) 36 (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
@@ -100,7 +102,7 @@ Let’s configure Emacs using Org mode, they said. It’ll be fun, they said.
100 "autosaves" 102 "autosaves"
101 "undos" 103 "undos"
102 "elpher-certificates")) 104 "elpher-certificates"))
103 (make-directory (no-littering-expand-var-file-name dir) t)) 105 (make-directory (no-littering-expand-var-file-name dir) 'parents))
104 106
105 107
106## About me 108## About me
@@ -247,7 +249,8 @@ Let’s configure Emacs using Org mode, they said. It’ll be fun, they said.
247 (modus-themes-diffs nil) 249 (modus-themes-diffs nil)
248 (modus-themes-org-blocks 'grayscale) 250 (modus-themes-org-blocks 'grayscale)
249 (modus-themes-headings 251 (modus-themes-headings
250 '()) 252 '((1 . line)
253 (t . t)))
251 (modus-themes-variable-pitch-headings t) 254 (modus-themes-variable-pitch-headings t)
252 (modus-themes-scale-headings t) 255 (modus-themes-scale-headings t)
253 (modus-themes-scale-1 1.1) 256 (modus-themes-scale-1 1.1)
@@ -262,6 +265,27 @@ Let’s configure Emacs using Org mode, they said. It’ll be fun, they said.
262 (load-theme 'modus-operandi t)) 265 (load-theme 'modus-operandi t))
263 266
264 267
268### Change theme based on time of day
269
270 (cuss calendar-latitude 30.4515)
271 (cuss calendar-longitude -91.1871)
272
273 (use-package circadian
274 :after solar
275 :custom
276 (circadian-themes '((:sunrise . modus-operandi)
277 (:sunset . modus-vivendi)))
278 :config
279 (circadian-setup))
280
281
282### Modeline
283
284 (use-package mood-line
285 :config
286 (mood-line-mode +1))
287
288
265### Fonts 289### Fonts
266 290
2671. Define fonts 2911. Define fonts
@@ -301,9 +325,9 @@ Let’s configure Emacs using Org mode, they said. It’ll be fun, they said.
301 "Linux Libertine O-12" 325 "Linux Libertine O-12"
302 "Georgia-11")) 326 "Georgia-11"))
303 327
304 (remove-hook 'after-init-hook #'acdw/setup-fonts))) 328 (remove-function after-focus-change-function #'acdw/setup-fonts)))
305 329
306 (add-hook 'after-init-hook #'acdw/setup-fonts) 330 (add-function :before after-focus-change-function #'acdw/setup-fonts)
307 331
3082. Variable-pitch in text modes 3322. Variable-pitch in text modes
309 333
@@ -618,6 +642,41 @@ I add it to the `find-file-hook` *and* `before-save-hook` because I don't want t
618 (global-aggressive-indent-mode +1)) 642 (global-aggressive-indent-mode +1))
619 643
620 644
645## Completion
646
647 (use-package company
648 :custom
649 (company-idle-delay 0.1)
650
651 :init
652 (defun acdw/company-complete-common-or-cycle+1 ()
653 (interactive)
654 (company-complete-common-or-cycle +1))
655
656 (defun acdw/company-complete-common-or-cycle-1 ()
657 (interactive)
658 (company-complete-common-or-cycle -1))
659
660 :bind
661 (:map company-active-map
662 ("C-n" . acdw/company-complete-common-or-cycle+1)
663 ("C-p" . acdw/company-complete-common-or-cycle-1))
664
665 :hook
666 (prog-mode-hook . company-mode))
667
668 (use-package company-prescient
669 :hook
670 (company-mode-hook . company-prescient-mode))
671
672 ;; this comes with company-quickhelp, so....
673
674 (use-package company-posframe
675 :after (company)
676 :config
677 (company-posframe-mode +1))
678
679
621# Writing 680# Writing
622 681
623 682
@@ -774,8 +833,9 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
774 (interactive "P") 833 (interactive "P")
775 (org-map-entries (lambda () 834 (org-map-entries (lambda ()
776 (org-with-wide-buffer 835 (org-with-wide-buffer
777 ;; `org-map-entries' narrows the buffer, which prevents us from seeing 836 ;; `org-map-entries' narrows the buffer, which prevents us
778 ;; newlines before the current heading, so we do this part widened. 837 ;; from seeing newlines before the current heading, so we
838 ;; do this part widened.
779 (while (not (looking-back "\n\n" nil)) 839 (while (not (looking-back "\n\n" nil))
780 ;; Insert blank lines before heading. 840 ;; Insert blank lines before heading.
781 (insert "\n"))) 841 (insert "\n")))
@@ -787,9 +847,10 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
787 ;; Skip planning lines 847 ;; Skip planning lines
788 (forward-line)) 848 (forward-line))
789 (while (re-search-forward org-drawer-regexp end t) 849 (while (re-search-forward org-drawer-regexp end t)
790 ;; Skip drawers. You might think that `org-at-drawer-p' would suffice, but 850 ;; Skip drawers. You might think that `org-at-drawer-p'
791 ;; for some reason it doesn't work correctly when operating on hidden text. 851 ;; would suffice, but for some reason it doesn't work
792 ;; This works, taken from `org-agenda-get-some-entry-text'. 852 ;; correctly when operating on hidden text. This
853 ;; works, taken from `org-agenda-get-some-entry-text'.
793 (re-search-forward "^[ \t]*:END:.*\n?" end t) 854 (re-search-forward "^[ \t]*:END:.*\n?" end t)
794 (goto-char (match-end 0))) 855 (goto-char (match-end 0)))
795 (unless (or (= (point) (point-max)) 856 (unless (or (= (point) (point-max))
@@ -810,6 +871,82 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
810 (add-hook 'before-save-hook #'cribbed/org-mode-fix-blank-lines) 871 (add-hook 'before-save-hook #'cribbed/org-mode-fix-blank-lines)
811 872
812 873
874## Elpher
875
876 (use-package elpher
877 :straight (elpher
878 :repo "git://thelambdalab.xyz/elpher.git"
879 :branch "patch_multiple_buffers")
880
881 :custom
882 (elpher-ipv4-always t)
883
884 :custom-face
885 (elpher-gemini-heading1
886 ((t (:inherit (modus-theme-heading-1)))))
887 (elpher-gemini-heading2
888 ((t (:inherit (modus-theme-heading-2)))))
889 (elpher-gemini-heading3
890 ((t (:inherit (modus-theme-heading-3)))))
891
892 :config
893 (defun elpher:eww-browse-url (original url &optional new-window)
894 "Handle gemini/gopher links with eww."
895 (cond ((string-match-p "\\`\\(gemini\\|gopher\\)://" url)
896 (require 'elpher)
897 (elpher-go url))
898 (t (funcall original url new-window))))
899 (advice-add 'eww-browse-url :around 'elpher:eww-browse-url)
900
901 :bind (:map elpher-mode-map
902 ("n" . elpher-next-link)
903 ("p" . elpher-prev-link)
904 ("o" . elpher-follow-current-link)
905 ("G" . elpher-go-current))
906
907 :hook
908 (elpher-mode-hook . visual-fill-column-mode))
909
910
911### Gemini mode
912
913 (use-package gemini-mode
914 :straight (gemini-mode
915 :repo "https://git.carcosa.net/jmcbray/gemini.el.git")
916
917 :mode "\\.\\(gemini|gmi\\)\\'"
918
919 :custom-face
920 (gemini-heading-face-1
921 ((t (:inherit (elpher-gemini-heading1)))))
922 (gemini-heading-face2
923 ((t (:inherit (elpher-gemini-heading2)))))
924 (gemini-heading-face3
925 ((t (:inherit (elpher-gemini-heading3)))))
926
927 :init
928 (defun acdw/setup-gemini-mode ()
929 (visual-fill-column-mode 1)
930 (variable-pitch-mode -1))
931
932 :hook
933 (gemini-mode-hook . acdw/setup-gemini-mode))
934
935
936### Gemini write
937
938 (use-package gemini-write
939 :straight (gemini-write
940 :repo "https://alexschroeder.ch/cgit/gemini-write"))
941
942
943## Pastebin
944
945 (use-package 0x0
946 :custom
947 (0x0-default-service 'ttm))
948
949
813# Appendices 950# Appendices
814 951
815 952
@@ -822,17 +959,13 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
822 959
8231. Load config 9601. Load config
824 961
825 from [Protesilaos Stavrou](https://protesilaos.com/dotemacs/#h:584c3604-55a1-49d0-9c31-abe46cb1f028). 962 inspired by [Protesilaos Stavrou](https://protesilaos.com/dotemacs/#h:584c3604-55a1-49d0-9c31-abe46cb1f028).
826 963
827 (let* ((conf (expand-file-name "config" 964 (let ((conf (expand-file-name "config"
828 user-emacs-directory)) 965 user-emacs-directory)))
829 (elc (concat conf ".elc")) 966 (unless (load conf 'no-error)
830 (el (concat conf ".el")) 967 (require 'org)
831 (org (concat conf ".org"))) 968 (org-babel-load-file (concat conf ".org"))))
832 (cond ((file-exists-p elc) (load-file elc))
833 ((file-exists-p el) (load-file el))
834 (t (require 'org)
835 (org-babel-load-file org))))
836 969
837 970
838### early-init.el 971### early-init.el
@@ -852,23 +985,29 @@ from [unpackaged.el](https://github.com/alphapapa/unpackaged.el#ensure-blank-lin
852 (let ((config (expand-file-name "config.org" user-emacs-directory))) 985 (let ((config (expand-file-name "config.org" user-emacs-directory)))
853 (save-mark-and-excursion 986 (save-mark-and-excursion
854 (with-current-buffer (find-file config) 987 (with-current-buffer (find-file config)
855 (let ((prog-mode-hook nil)) 988 (let ((prog-mode-hook nil))
856 ;; generate the readme 989 ;; generate the readme
857 (require 'ox-md) 990 (when (file-newer-than-file-p config (expand-file-name
858 (org-md-export-to-markdown) 991 "README.md"
859 ;; tangle config.org 992 user-emacs-directory))
860 (require 'org) 993 (require 'ox-md)
861 (let ((inits (org-babel-tangle))) 994 (org-md-export-to-markdown))
862 ;; byte-compile resulting files 995 ;; tangle config.org
863 (dolist (f inits) 996 (when (file-newer-than-file-p config (expand-file-name
864 (when (string-match "\\.el\\'" f) 997 "config.el"
865 (byte-compile-file f (not disable-load)))))))))) 998 user-emacs-directory))
999 (require 'org)
1000 (let ((inits (org-babel-tangle)))
1001 ;; byte-compile resulting files
1002 (dolist (f inits)
1003 (when (string-match "\\.el\\'" f)
1004 (byte-compile-file f (not disable-load)))))))))))
866 1005
867 1006
868### Add a hook to tangle when quitting 1007### Add a hook to tangle when quitting
869 1008
870 (defun acdw/refresh-emacs-no-load () 1009 (defun acdw/refresh-emacs-no-load ()
871 (refresh-emacs t)) 1010 (refresh-emacs 'disable-load))
872 1011
873 (add-hook 'kill-emacs-hook #'acdw/refresh-emacs-no-load) 1012 (add-hook 'kill-emacs-hook #'acdw/refresh-emacs-no-load)
874 1013