From 0ea7241c664644302938a42810cbc8bcc15d8977 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 25 Feb 2021 17:53:46 -0600 Subject: W h I t E s P a C e --- config.org | 1307 +++++++++++++++++++++++++++++---------------------------- early-init.el | 72 ++-- init.el | 4 +- 3 files changed, 704 insertions(+), 679 deletions(-) diff --git a/config.org b/config.org index f68f3e9..b35ed30 100644 --- a/config.org +++ b/config.org @@ -8,15 +8,15 @@ #+begin_src emacs-lisp :noweb-ref settings (setq user-full-name "Case Duckworth" - user-mail-address "acdw@acdw.net") + user-mail-address "acdw@acdw.net") #+end_src ** Where I am #+begin_src emacs-lisp :noweb-ref settings (setq calendar-location-name "Baton Rouge, LA" - calendar-latitude 30.4 - calendar-longitude -91.1) + calendar-latitude 30.4 + calendar-longitude -91.1) #+end_src ** Auth-sources @@ -46,7 +46,7 @@ of unstyled content" thing. #+begin_src emacs-lisp (add-to-list 'default-frame-alist - '(tool-bar-lines . 0)) + '(tool-bar-lines . 0)) (tool-bar-mode -1) #+end_src @@ -55,7 +55,7 @@ of unstyled content" thing. #+begin_src emacs-lisp (add-to-list 'default-frame-alist - '(menu-bar-lines . 0)) + '(menu-bar-lines . 0)) (menu-bar-mode -1) #+end_src @@ -64,8 +64,8 @@ of unstyled content" thing. #+begin_src emacs-lisp (add-to-list 'default-frame-alist - '(vertical-scroll-bars . nil) - '(horizontal-scroll-bars . nil)) + '(vertical-scroll-bars . nil) + '(horizontal-scroll-bars . nil)) (scroll-bar-mode -1) (horizontal-scroll-bar-mode -1) @@ -78,21 +78,21 @@ want it to resize by pixels -- we /are/ using a GUI, after all. #+begin_src emacs-lisp (setq-default frame-inhibit-implied-resize t - frame-resize-pixelwise t) + frame-resize-pixelwise t) #+end_src *** Frame titles #+begin_src emacs-lisp :noweb-ref settings (setq-default frame-title-format - '("Emacs " - mode-line-client - mode-line-modified - " " - (:eval (if (buffer-file-name) - (abbreviate-file-name (buffer-file-name)) - "%b")) - )) + '("Emacs " + mode-line-client + mode-line-modified + " " + (:eval (if (buffer-file-name) + (abbreviate-file-name (buffer-file-name)) + "%b")) + )) #+end_src *** Fringes @@ -130,16 +130,16 @@ and have made a custom fringe bitmap. (defun hook--setup-fringes-curly-arrows () "Set up curly-arrow fringes." (define-fringe-bitmap 'left-curly-arrow - [#b11000000 - #b01100000 - #b00110000 - #b00011000]) + [#b11000000 + #b01100000 + #b00110000 + #b00011000]) (define-fringe-bitmap 'right-curly-arrow - [#b00011000 - #b00110000 - #b01100000 - #b11000000])) + [#b00011000 + #b00110000 + #b01100000 + #b11000000])) (add-hook 'after-init-hook #'hook--setup-fringes-curly-arrows) #+end_src @@ -150,16 +150,16 @@ and have made a custom fringe bitmap. (defun hook--setup-fringes-arrows () "Setup arrow fringe bitmaps." (define-fringe-bitmap 'left-arrow - [#b00000000 - #b01010100 - #b01010100 - #b00000000]) + [#b00000000 + #b01010100 + #b01010100 + #b00000000]) (define-fringe-bitmap 'right-arrow - [#b00000000 - #b00101010 - #b00101010 - #b00000000])) + [#b00000000 + #b00101010 + #b00101010 + #b00000000])) (add-hook 'after-init-hook #'hook--setup-fringes-arrows) #+end_src @@ -170,8 +170,8 @@ and have made a custom fringe bitmap. #+begin_src emacs-lisp :noweb-ref settings (setq-default window-divider-default-places 'right-only ; only right - window-divider-default-bottom-width 2 - window-divider-default-right-width 2) + window-divider-default-bottom-width 2 + window-divider-default-right-width 2) #+end_src #+begin_src emacs-lisp :noweb-ref modes @@ -185,7 +185,7 @@ This is extremely fiddly and I'd love another option. #+begin_src emacs-lisp :noweb-ref settings (setq-default split-width-threshold 100 - split-height-threshold 50) + split-height-threshold 50) #+end_src *** Window layouts @@ -231,9 +231,9 @@ filesystem paths. #+begin_src emacs-lisp :noweb-ref settings (setq-default uniquify-buffer-name-style 'forward - uniquify-separator "/" - uniquify-after-kill-buffer-p t - uniquify-ignore-buffers-re "^\\*") + uniquify-separator "/" + uniquify-after-kill-buffer-p t + uniquify-ignore-buffers-re "^\\*") #+end_src *** Startup buffers @@ -243,12 +243,12 @@ also want it to show a cute little message to myself. #+begin_src emacs-lisp :noweb-ref settings (setq-default inhibit-startup-screen t ; Don't show that splash screen thing. - initial-buffer-choice t ; Start on *scratch* - initial-scratch-message - (concat ";; Howdy, " - (nth 0 (split-string user-full-name)) "!" - " Welcome to Emacs." - "\n\n")) + initial-buffer-choice t ; Start on *scratch* + initial-scratch-message + (concat ";; Howdy, " + (nth 0 (split-string user-full-name)) "!" + " Welcome to Emacs." + "\n\n")) #+end_src *** Immortal =*scratch*= buffer @@ -260,7 +260,7 @@ function to the =kill-buffer-query-functions= hook that will return #+begin_src emacs-lisp :noweb-ref functions (defun immortal-scratch () (if (not (eq (current-buffer) (get-buffer "*scratch*"))) - t + t (bury-buffer) nil)) #+end_src @@ -299,12 +299,12 @@ someday. (interactive "P") (pcase (or (car prefix) 0) (0 (kill-current-buffer) - (unless (one-window-p) (delete-window))) + (unless (one-window-p) (delete-window))) (4 (other-window 1) - (kill-current-buffer) - (unless (one-window-p) (delete-window))) + (kill-current-buffer) + (unless (one-window-p) (delete-window))) (16 (let ((current-prefix-arg nil)) - (kill-buffer))))) + (kill-buffer))))) #+end_src #+begin_src emacs-lisp :noweb-ref bindings @@ -327,9 +327,9 @@ have =clean-buffer-list= run at 8:00 PM. #+begin_src emacs-lisp :noweb-ref settings (setq-default acdw/clean-buffer-list-timer - (run-at-time "20:00" 86400 #'clean-buffer-list) - clean-buffer-list-delay-general 5 - clean-buffer-list-delay-special (* 7 24 60 60)) + (run-at-time "20:00" 86400 #'clean-buffer-list) + clean-buffer-list-delay-general 5 + clean-buffer-list-delay-special (* 7 24 60 60)) (add-to-list 'clean-buffer-list-kill-buffer-names "*Completions*") (add-to-list 'clean-buffer-list-kill-buffer-names "*Calendar*") @@ -343,7 +343,7 @@ I like a vertical bar, but only in the selected window. #+begin_src emacs-lisp :noweb-ref settings (setq-default cursor-type 'bar - cursor-in-non-selected-windows nil) + cursor-in-non-selected-windows nil) #+end_src *** Don't blink the cursor @@ -358,9 +358,9 @@ I like a vertical bar, but only in the selected window. #+begin_src emacs-lisp :noweb-ref settings (setq-default tab-bar-show 1 ; show the tab bar when more than 1 tab - tab-bar-new-tab-choice "*scratch*" - tab-bar-tab-name-function - #'tab-bar-tab-name-current-with-count) + tab-bar-new-tab-choice "*scratch*" + tab-bar-tab-name-function + #'tab-bar-tab-name-current-with-count) #+end_src *** Tab bar history @@ -379,32 +379,32 @@ On Linux, I have a custom build of Iosevka that I like. #+begin_src emacs-lisp :noweb-ref linux-specific (set-face-attribute 'default nil - :family "Iosevka Acdw" - :height 105) + :family "Iosevka Acdw" + :height 105) (set-face-attribute 'fixed-pitch nil - :family "Iosevka Acdw" - :height 105) + :family "Iosevka Acdw" + :height 105) (set-face-attribute 'variable-pitch nil - :family "DejaVu Serif" - :height 110) + :family "DejaVu Serif" + :height 110) #+end_src But on Windows, I use Consolas. #+begin_src emacs-lisp :noweb-ref windows-specific (set-face-attribute 'default nil - :family "Consolas" - :height 100) + :family "Consolas" + :height 100) (set-face-attribute 'fixed-pitch nil - :family "Consolas" - :height 100) + :family "Consolas" + :height 100) (set-face-attribute 'variable-pitch nil - :family "Cambria" - :height 105) + :family "Cambria" + :height 105) #+end_src *** Underlines @@ -437,18 +437,18 @@ complains), I need to fork and change that to a =cl-lib=. #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(list-utils - :host github - :repo "rolandwalker/list-utils" - :fork (:repo "duckwork/list-utils"))) + :host github + :repo "rolandwalker/list-utils" + :fork (:repo "duckwork/list-utils"))) #+end_src ***** Persistent-soft #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(persistent-soft - :host github - :repo "rolandwalker/persistent-soft" - :fork (:repo "duckwork/persistent-soft"))) + :host github + :repo "rolandwalker/persistent-soft" + :fork (:repo "duckwork/persistent-soft"))) #+end_src ***** Font-utils @@ -460,9 +460,9 @@ to stay hopeful. #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(font-utils - :host github - :repo "rolandwalker/font-utils" - :fork (:repo "duckwork/font-utils"))) + :host github + :repo "rolandwalker/font-utils" + :fork (:repo "duckwork/font-utils"))) #+end_src ***** A function in case it comes up again @@ -489,8 +489,8 @@ So... function! #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(unicode-fonts - :host github - :repo "rolandwalker/unicode-fonts")) + :host github + :repo "rolandwalker/unicode-fonts")) (require 'unicode-fonts) #+end_src @@ -534,19 +534,19 @@ I want the git version. #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(modus-themes - :host gitlab - :repo "protesilaos/modus-themes")) + :host gitlab + :repo "protesilaos/modus-themes")) #+end_src #+begin_src emacs-lisp :noweb-ref settings (setq-default modus-themes-slanted-constructs t - modus-themes-bold-constructs t - modus-themes-region 'bg-only - modus-themes-org-blocks 'grayscale - modus-themes-headings '((1 . section) - (t . no-color)) - modus-themes-scale-headings nil - modus-themes-mode-line nil) + modus-themes-bold-constructs t + modus-themes-region 'bg-only + modus-themes-org-blocks 'grayscale + modus-themes-headings '((1 . section) + (t . no-color)) + modus-themes-scale-headings nil + modus-themes-mode-line nil) #+end_src **** Force headings to be =fixed-pitch= @@ -557,15 +557,15 @@ To enable the proper alignment of Org tags, I want headings to inherit from the #+begin_src emacs-lisp :noweb-ref settings (dolist (face '(modus-theme-heading-1 - modus-theme-heading-2 - modus-theme-heading-3 - modus-theme-heading-4 - modus-theme-heading-5 - modus-theme-heading-6 - modus-theme-heading-7 - modus-theme-heading-8)) + modus-theme-heading-2 + modus-theme-heading-3 + modus-theme-heading-4 + modus-theme-heading-5 + modus-theme-heading-6 + modus-theme-heading-7 + modus-theme-heading-8)) (doremi-face-set face - '((t (:inherit (face fixed-pitch bold)))))) + '((t (:inherit (face fixed-pitch bold)))))) #+end_src *** Change themes based on time of day @@ -574,27 +574,27 @@ To enable the proper alignment of Org tags, I want headings to inherit from the (defun acdw/run-with-sun (sunrise-command sunset-command) "Run commands at sunrise and sunset." (let* ((times-regex (rx (* nonl) - (: (any ?s ?S) "unrise") " " - (group (repeat 1 2 digit) ":" - (repeat 1 2 digit) - (: (any ?a ?A ?p ?P) (any ?m ?M))) - (* nonl) - (: (any ?s ?S) "unset") " " - (group (repeat 1 2 digit) ":" - (repeat 1 2 digit) - (: (any ?a ?A ?p ?P) (any ?m ?M))) - (* nonl))) - (ss (sunrise-sunset)) - (_m (string-match times-regex ss)) - (sunrise-time (match-string 1 ss)) - (sunset-time (match-string 2 ss))) + (: (any ?s ?S) "unrise") " " + (group (repeat 1 2 digit) ":" + (repeat 1 2 digit) + (: (any ?a ?A ?p ?P) (any ?m ?M))) + (* nonl) + (: (any ?s ?S) "unset") " " + (group (repeat 1 2 digit) ":" + (repeat 1 2 digit) + (: (any ?a ?A ?p ?P) (any ?m ?M))) + (* nonl))) + (ss (sunrise-sunset)) + (_m (string-match times-regex ss)) + (sunrise-time (match-string 1 ss)) + (sunset-time (match-string 2 ss))) (run-at-time sunrise-time (* 60 60 24) sunrise-command) (run-at-time sunset-time (* 60 60 24) sunset-command))) #+end_src #+begin_src emacs-lisp :noweb-ref hooks (acdw/run-with-sun #'modus-themes-load-operandi - #'modus-themes-load-vivendi) + #'modus-themes-load-vivendi) #+end_src *** Mode line @@ -617,8 +617,8 @@ minor-modes from the modeline. #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(blackout - :host github - :repo "raxod502/blackout")) + :host github + :repo "raxod502/blackout")) #+end_src **** Which-function mode @@ -633,11 +633,11 @@ Shows where we are in the modeline. #+begin_src emacs-lisp :noweb-ref linux-specific (doremi-face-set 'mode-line - '((t (:family "Terminus" - :height 1.0)))) + '((t (:family "Terminus" + :height 1.0)))) (doremi-face-set 'mode-line-inactive - '((t (:family "Terminus" - :height 1.0)))) + '((t (:family "Terminus" + :height 1.0)))) #+end_src *** Setting faces @@ -683,7 +683,7 @@ systems. #+begin_src emacs-lisp :noweb-ref settings (setq-default visible-bell nil - ring-bell-function #'flash-mode-line) + ring-bell-function #'flash-mode-line) #+end_src **** Flash the mode-line @@ -700,9 +700,9 @@ systems. #+begin_src emacs-lisp :noweb-ref settings (setq-default minibuffer-prompt-properties - '(read-only t - cursor-intangible t - face minibuffer-prompt)) + '(read-only t + cursor-intangible t + face minibuffer-prompt)) #+end_src *** Enable a recursive minibuffer @@ -738,8 +738,8 @@ to /hide/ those contents. #+begin_src emacs-lisp :noweb-ref (setq-default completion-ignore-case t - read-buffer-completion-ignore-case t - read-file-name-completion-ignore-case t) + read-buffer-completion-ignore-case t + read-file-name-completion-ignore-case t) #+end_src *** Icomplete @@ -752,7 +752,7 @@ to /hide/ those contents. (setq-default completion-styles '(partial-completion substring flex) completion-category-overrides '((file - (styles basic substring flex)))) + (styles basic substring flex)))) (setq-default icomplete-delay-completions-threshold 0 icomplete-max-delay-chars 0 @@ -771,8 +771,8 @@ to /hide/ those contents. ("C-p" #'icomplete-backward-completions))) (acdw/bind "C-v" #'icomplete-vertical-toggle - :after 'icomplete-vertical - :map icomplete-minibuffer-map) + :after 'icomplete-vertical + :map icomplete-minibuffer-map) #+end_src #+begin_src emacs-lisp :noweb-ref modes @@ -825,10 +825,10 @@ default completion system. These all come from the [[https://github.com/minad/c ("M-g e" #'consult-error) ;; M-s bindings (`search-map') ("M-s g" #'consult-grep) ; alts: - ; consult-git-grep, - ; consult-ripgrep + ; consult-git-grep, + ; consult-ripgrep ("M-s f" #'consult-find) ; alts: - ; consult-locate + ; consult-locate ("M-s l" #'consult-line) ("M-s m" #'consult-multi-occur) ("M-s k" #'consult-keep-lines) @@ -842,7 +842,7 @@ default completion system. These all come from the [[https://github.com/minad/c #+begin_src emacs-lisp :noweb-ref settings (autoload 'consult-register-preview "consult") ; make the compiler happy (setq-default register-preview-delay 0 - register-preview-function #'consult-register-preview) + register-preview-function #'consult-register-preview) #+end_src *** Marginalia :package: @@ -863,9 +863,9 @@ I like the rich annotations provided by =marginalia=. #+begin_src emacs-lisp :noweb-ref settings (setq-default marginalia-annotators - '(marginalia-annotators-heavy - marginalia-annotators-light - nil)) + '(marginalia-annotators-heavy + marginalia-annotators-light + nil)) #+end_src ** Imenu @@ -931,13 +931,13 @@ little sugar on top of =define-key= et al. :after PACKAGE-OR-FEATURE .. wrap key definition in `with-eval-after-load' :map KEYMAP .. define key in KEYMAP instead of `acdw/map'" (let* ((after (plist-get args :after)) - (map (or (plist-get args :map) 'acdw/map)) - (key (if (vectorp key) key `(kbd ,key))) - (def-key `(define-key ,map ,key ,def))) + (map (or (plist-get args :map) 'acdw/map)) + (key (if (vectorp key) key `(kbd ,key))) + (def-key `(define-key ,map ,key ,def))) (if after - `(with-eval-after-load ,after - ,def-key) - def-key))) + `(with-eval-after-load ,after + ,def-key) + def-key))) (defmacro acdw/bind-after-map (feature keymap bindings) "Wrap multiple calls to `acdw/bind' in a `with-eval-after-load' form. @@ -947,11 +947,11 @@ little sugar on top of =define-key= et al. (declare (indent 2)) (let (bind-list) (dolist (bind bindings bind-list) - (if keymap - (push `(acdw/bind ,@bind :map ,keymap) bind-list) - (push `(acdw/bind ,@bind) bind-list))) + (if keymap + (push `(acdw/bind ,@bind :map ,keymap) bind-list) + (push `(acdw/bind ,@bind) bind-list))) `(with-eval-after-load ,feature - ,@bind-list))) + ,@bind-list))) #+end_src **** Turn off acdw/mode in the minibuffer @@ -973,8 +973,8 @@ generally use it as a leader for entering applications. #+begin_src emacs-lisp :noweb-ref acdw-mode (defvar acdw/leader (let ((map (make-sparse-keymap)) - (c-z (global-key-binding "\C-z"))) - ;(global-unset-key "\C-z") + (c-z (global-key-binding "\C-z"))) + ;(global-unset-key "\C-z") (define-key acdw/map "\C-z" map) (define-key map "\C-z" c-z) map)) @@ -1003,15 +1003,15 @@ According to [[https://github.com/mpereira/.emacs.d#make-cursor-movement-an-orde #+begin_src emacs-lisp :noweb-ref settings (setq-default auto-window-vscroll nil - fast-but-imprecise-scrolling t) + fast-but-imprecise-scrolling t) #+end_src *** Scroll margins #+begin_src emacs-lisp :noweb-ref settings (setq-default scroll-margin 0 - scroll-conservatively 101 ; if greater than 100 ... - scroll-preserve-screen-position 1) + scroll-conservatively 101 ; if greater than 100 ... + scroll-preserve-screen-position 1) #+end_src ** Enable commands @@ -1030,8 +1030,8 @@ including here myself. This is kind of an experiment, to be honest. #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(crux - :host github - :repo "bbatsov/crux")) + :host github + :repo "bbatsov/crux")) (require 'crux) #+end_src @@ -1052,12 +1052,12 @@ I keep all of it. #+begin_src emacs-lisp :noweb-ref modes (setq-default savehist-additional-variables - '(kill-ring - search-ring - regexp-search-ring) - history-length t ; Don't truncate - history-delete-duplicates t - savehist-autosave-interval 60) + '(kill-ring + search-ring + regexp-search-ring) + history-length t ; Don't truncate + history-delete-duplicates t + savehist-autosave-interval 60) #+end_src #+begin_src emacs-lisp :noweb-ref modes @@ -1078,7 +1078,7 @@ of are readable or not when I'm not at home. #+begin_src emacs-lisp :noweb-ref settings (setq-default save-place-forget-unreadable-files - (memq system-type '(gnu gnu/linux gnu/kfreebsd))) + (memq system-type '(gnu gnu/linux gnu/kfreebsd))) #+end_src #+begin_src emacs-lisp :noweb-ref modes @@ -1096,8 +1096,8 @@ with that. #+begin_src emacs-lisp :noweb-ref settings (setq-default recentf-max-menu-items 100 - recentf-max-saved-items nil - recentf-auto-cleanup 'never) + recentf-max-saved-items nil + recentf-auto-cleanup 'never) #+end_src #+begin_src emacs-lisp :noweb-ref modes @@ -1121,14 +1121,14 @@ I also want to ignore the =no-littering-var-directory= and "When we last saved the `recentf-save-list'.") (when (> (time-convert (time-since recentf--last-save) 'integer) - (* 60 5)) + (* 60 5)) (setq-default recentf--last-save (time-convert nil 'integer)) (when-unfocused #'recentf-save-list))) #+end_src #+begin_src emacs-lisp :noweb-ref hooks (add-function :after after-focus-change-function - #'maybe-save-recentf) + #'maybe-save-recentf) #+end_src * Responsiveness @@ -1182,7 +1182,7 @@ I'm going to try it for now. (when-unfocused #'garbage-collect)) (add-function :after after-focus-change-function - #'hook--gc-when-unfocused) + #'hook--gc-when-unfocused) #+end_src ** Startup time @@ -1197,10 +1197,10 @@ As a benchmark, on Windows, =emacs -Q= starts up in *0.188585* seconds, and (defun hook--message-startup-time () "Message Emacs' startup time." (message "Emacs ready in %s with %d garbage collections." - (format "%.2f seconds" - (float-time (time-subtract after-init-time - before-init-time))) - gcs-done)) + (format "%.2f seconds" + (float-time (time-subtract after-init-time + before-init-time))) + gcs-done)) (add-hook 'emacs-startup-hook #'hook--message-startup-time) #+end_src @@ -1224,15 +1224,15 @@ It's 2020. Let's encode files like it is. (set-selection-coding-system 'utf-8-unix) (setq-default locale-coding-system 'utf-8-unix - coding-system-for-read 'utf-8-unix - coding-system-for-write 'utf-8-unix - buffer-file-coding-system 'utf-8-unix - - org-export-coding-system 'utf-8-unix - org-html-coding-system 'utf-8-unix ; doesn't take from above + coding-system-for-read 'utf-8-unix + coding-system-for-write 'utf-8-unix + buffer-file-coding-system 'utf-8-unix - default-process-coding-system '(utf-8-unix . utf-8-unix) - x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) + org-export-coding-system 'utf-8-unix + org-html-coding-system 'utf-8-unix ; doesn't take from above + + default-process-coding-system '(utf-8-unix . utf-8-unix) + x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) #+end_src *** UNIX-style line endings @@ -1244,7 +1244,7 @@ This function is from the [[https://www.emacswiki.org/emacs/EndOfLineTips][Emacs "Convert line endings to UNIX, dammit." (let ((coding-str (symbol-name buffer-file-coding-system))) (when (string-match "-\\(?:dos\\|mac\\)$" coding-str) - (set-buffer-file-coding-system 'unix)))) + (set-buffer-file-coding-system 'unix)))) #+end_src I add it to both =file-find-hook= /and/ =before-save-hook= because I'm @@ -1271,19 +1271,19 @@ Notepad can handle UNIX line endings, so I don't want to hear it. #+begin_src emacs-lisp :noweb-ref settings (setq-default backup-by-copying t - ;; Don't delete old versions - delete-old-versions -1 - ;; Make numeric backups unconditionally - version-control t - ;; Also backup files covered by version control - vc-make-backup-files t) + ;; Don't delete old versions + delete-old-versions -1 + ;; Make numeric backups unconditionally + version-control t + ;; Also backup files covered by version control + vc-make-backup-files t) #+end_src #+begin_src emacs-lisp :noweb-ref no-littering (let ((dir (no-littering-expand-var-file-name "backup"))) (make-directory dir :parents) (setq-default backup-directory-alist - `((".*" . ,dir)))) + `((".*" . ,dir)))) #+end_src ** Autosaves :package: @@ -1295,8 +1295,8 @@ Bozhidar Batsov's [[https://github.com/bbatsov/super-save][super-save]] package. (setq-default auto-save-default nil) (setq-default super-save-remote-files nil - super-save-exclude '(".gpg") - super-save-auto-save-when-idle t) + super-save-exclude '(".gpg") + super-save-auto-save-when-idle t) #+end_src #+begin_src emacs-lisp :noweb-ref packages @@ -1360,7 +1360,7 @@ that's the only time I accidentally call it, anyway. 1. Enable =auto-fill-mode= with text modes. #+begin_src emacs-lisp :noweb-ref hooks - (add-hook 'text-mode-hook #'auto-fill-mode) + (add-hook 'text-mode-hook #'auto-fill-mode) #+end_src 2a. Enable =visual-line-mode= everywhere. I do this because when I'm typing a @@ -1402,19 +1402,19 @@ This has to be done /before/ loading the package. It's included in (dolist (margin '(right-margin left-margin)) (dolist (button '(mouse-1 mouse-2 mouse-3)) (global-set-key (vector margin button) - (global-key-binding (vector button))))) + (global-key-binding (vector button))))) (mouse-wheel-mode +1) (when (bound-and-true-p mouse-wheel-mode) (dolist (margin '(right-margin left-margin)) (dolist (event '(mouse-wheel-down-event - mouse-wheel-up-event - wheel-down - wheel-up - mouse-4 - mouse-5)) - (global-set-key (vector margin event) #'mwheel-scroll)))) + mouse-wheel-up-event + wheel-down + wheel-up + mouse-4 + mouse-5)) + (global-set-key (vector margin event) #'mwheel-scroll)))) #+END_SRC **** Then: =visual-fill-column= :package: @@ -1454,10 +1454,10 @@ enabled). #+begin_src emacs-lisp :noweb-ref settings (setq-default whitespace-style '(empty ; remove blank lines at buffer edges - indentation ; clean up indentation - ;; fix mixed spaces and tabs - space-before-tab - space-after-tab)) + indentation ; clean up indentation + ;; fix mixed spaces and tabs + space-before-tab + space-after-tab)) #+end_src *** Clean up whitespace on save @@ -1600,8 +1600,8 @@ from =undo-fu=. #+begin_src emacs-lisp :noweb-ref settings (setq-default undo-fu-session-incompatible-files - '("/COMMIT_EDITMSG\\'" - "/git-rebase-todo\\'")) + '("/COMMIT_EDITMSG\\'" + "/git-rebase-todo\\'")) #+end_src #+begin_src emacs-lisp :noweb-ref no-littering @@ -1644,12 +1644,12 @@ I want to search by regexp by default. #+begin_src emacs-lisp :noweb-ref settings (setq-default anzu-mode-lighter "" ; hide anzu-mode in the modeline - anzu-replace-to-string-separator " → ") + anzu-replace-to-string-separator " → ") ;; Set up anzu in the modeline (setq-default anzu-cons-mode-line-p nil) (setcar (cdr (assq 'isearch-mode minor-mode-alist)) - '(:eval (concat " " (anzu--update-mode-line)))) + '(:eval (concat " " (anzu--update-mode-line)))) #+end_src *** Regex @@ -1721,7 +1721,7 @@ Let's use =hunspell=. (with-eval-after-load "ispell" (setenv "LANG" "en_US") (setq-default ispell-program-name "hunspell" - ispell-dictionary "en_US") + ispell-dictionary "en_US") (ispell-set-spellchecker-params)) (setq ispell-personal-dictionary "~/.hunspell_personal") @@ -1750,8 +1750,8 @@ Display corrections with =completing-read=. #+begin_src emacs-lisp :noweb-ref bindings (acdw/bind "C-;" #'flyspell-correct-wrapper - :after 'flyspell - :map flyspell-mode-map) + :after 'flyspell + :map flyspell-mode-map) #+end_src * Reading @@ -1768,7 +1768,7 @@ Display corrections with =completing-read=. #+begin_src emacs-lisp :noweb-ref modes (add-hook 'iscroll-mode-hook - #'(lambda () (blackout 'iscroll-mode))) + #'(lambda () (blackout 'iscroll-mode))) #+end_src ** Reading mode @@ -1780,16 +1780,16 @@ A custom mode to make reading comfy "Make reading comfier." :lighter " Read" ; later: book emoji (if acdw/reading-mode - (progn ;; turn on - (text-scale-increase +1) - (visual-fill-column-mode +1) - (iscroll-mode +1) - (display-fill-column-indicator-mode -1)) + (progn ;; turn on + (text-scale-increase +1) + (visual-fill-column-mode +1) + (iscroll-mode +1) + (display-fill-column-indicator-mode -1)) (progn ;; turn off - (text-scale-increase 0) - (visual-fill-column-mode -1) - (iscroll-mode -1) - (display-fill-column-indicator-mode +1)))) + (text-scale-increase 0) + (visual-fill-column-mode -1) + (iscroll-mode -1) + (display-fill-column-indicator-mode +1)))) #+end_src * Programming @@ -1819,18 +1819,18 @@ to auto-fill in programming modes, but /only/ the comments. #+begin_src emacs-lisp :noweb-ref settings (setq-default show-paren-delay 0 - ;; Show the matching paren if visible, else the whole expression - show-paren-style 'mixed - show-paren-when-point-inside-paren t - show-paren-when-point-in-periphery t) + ;; Show the matching paren if visible, else the whole expression + show-paren-style 'mixed + show-paren-when-point-inside-paren t + show-paren-when-point-in-periphery t) #+end_src *** COMMENT Smart parentheses :package: #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(smartparens - :host github - :repo "Fuco1/smartparens")) + :host github + :repo "Fuco1/smartparens")) (require 'smartparens-config) #+end_src @@ -1838,7 +1838,7 @@ to auto-fill in programming modes, but /only/ the comments. #+begin_src emacs-lisp :noweb-ref settings (setq-default sp-show-pair-delay 0 - sp-show-pair-from-inside t) + sp-show-pair-from-inside t) #+end_src #+begin_src emacs-lisp :noweb-ref hooks @@ -1857,7 +1857,7 @@ to auto-fill in programming modes, but /only/ the comments. (add-hook 'prog-mode-hook #'smartparens-mode) (dolist (hook '(lisp-mode-hook - emacs-lisp-mode-hook)) + emacs-lisp-mode-hook)) (add-hook hook #'smartparens-strict-mode)) #+end_src @@ -1937,15 +1937,15 @@ checks for a shebang). #+begin_src emacs-lisp :noweb-ref hooks (add-hook 'after-save-hook - #'executable-make-buffer-file-executable-if-script-p) + #'executable-make-buffer-file-executable-if-script-p) #+end_src ** Compilation #+begin_src emacs-lisp :noweb-ref settings (setq-default compilation-ask-about-save nil ; just save - compilation-always-kill t ; kill the old processes - compilation-scroll-output 'first-error) + compilation-always-kill t ; kill the old processes + compilation-scroll-output 'first-error) #+end_src #+begin_src emacs-lisp :noweb-ref bindings @@ -1969,7 +1969,7 @@ of (I suppose) generic files. #+begin_src emacs-lisp :noweb-ref settings (setq-default eval-expression-print-length nil - eval-expression-print-level nil) + eval-expression-print-level nil) #+end_src **** Indent Elisp like Common Lisp @@ -2021,6 +2021,31 @@ installed. (straight-use-package 'i3wm-config-mode)) #+end_src +*** Shell scripts + +**** Shellcheck + +#+begin_src emacs-lisp :noweb-ref packages + (straight-use-package 'flymake-shellcheck) + (autoload 'flymake-shellcheck-load "flymake-shellcheck") +#+end_src + +#+begin_src emacs-lisp :noweb-ref hooks + (add-hook 'sh-mode-hook #'flymake-shellcheck-load) +#+end_src + +**** Formatting + +#+begin_src emacs-lisp :noweb-ref modes + (when (executable-find "shfmt") + (reformatter-define sh-format + :program "shfmt" + + :lighter "Shfmt") + + (add-hook 'sh-mode-hook #'sh-format-on-save-mode)) +#+end_src + * Applications Emacs is well-known for its ability to subsume one's entire computing @@ -2039,8 +2064,8 @@ I like using Firefox. #+begin_src emacs-lisp :noweb-ref settings (setq-default browse-url-browser-function 'browse-url-firefox - browse-url-new-window-flag t - browse-url-firefox-new-window-is-tab t) + browse-url-new-window-flag t + browse-url-firefox-new-window-is-tab t) #+end_src At work, I need to tell Emacs where Firefox is. @@ -2053,7 +2078,7 @@ At work, I need to tell Emacs where Firefox is. #+begin_src emacs-lisp :noweb-ref settings (setq-default shr-max-width fill-column - shr-width fill-column) + shr-width fill-column) #+end_src ** Dired @@ -2071,10 +2096,10 @@ move up a directory with a keybinding, I'll change =-a= to =-A=. #+begin_src emacs-lisp :noweb-ref settings (setq-default dired-recursive-copies 'always - dired-recursive-deletes 'always - delete-by-moving-to-trash t - dired-listing-switches "-AFgho --group-directories-first" - dired-dwim-target t) + dired-recursive-deletes 'always + delete-by-moving-to-trash t + dired-listing-switches "-AFgho --group-directories-first" + dired-dwim-target t) #+end_src #+begin_src emacs-lisp :noweb-ref bindings @@ -2156,8 +2181,8 @@ true, please feel free to hack this repo and change this paragraph. #+begin_src emacs-lisp :noweb-ref packages (dolist (feat '(gitattributes-mode - gitconfig-mode - gitignore-mode)) + gitconfig-mode + gitignore-mode)) (straight-use-package feat) (require feat)) #+end_src @@ -2168,8 +2193,8 @@ I love crosswords. I love Emacs. There ya go. #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(crossword - :host github - :repo "Boruch-Baum/emacs-crossword")) + :host github + :repo "Boruch-Baum/emacs-crossword")) #+end_src #+begin_src emacs-lisp :noweb-ref settings @@ -2178,7 +2203,7 @@ I love crosswords. I love Emacs. There ya go. #+begin_src emacs-lisp :noweb-ref no-littering (setq-default crossword-save-path - (no-littering-expand-var-file-name "crosswords/")) + (no-littering-expand-var-file-name "crosswords/")) (unless (file-exists-p crossword-save-path) (make-directory crossword-save-path :parents)) #+end_src @@ -2195,30 +2220,30 @@ bad, to be honest. Let's change em. #+begin_src emacs-lisp :noweb-ref settings (doremi-face-set 'crossword-current-face - '((((class color) - (background light)) - (:inherit 'normal :foreground "black" - :background "lightgreen")) - (((class color) - (background dark)) - (:inherit 'normal :foreground "white" - :background "darkgreen")) - (t - (:inherit 'normal :foreground "black" - :background "darkgreen")))) + '((((class color) + (background light)) + (:inherit 'normal :foreground "black" + :background "lightgreen")) + (((class color) + (background dark)) + (:inherit 'normal :foreground "white" + :background "darkgreen")) + (t + (:inherit 'normal :foreground "black" + :background "darkgreen")))) (doremi-face-set 'crossword-other-dir-face - '((((class color) - (background light)) - (:inherit 'normal :foreground "black" - :background "darkgrey")) - (((class color) - (background dark)) - (:inherit 'normal :foreground "black" - :background "darkgrey")) - (t - (:inherit 'normal :foreground "black" - :background "darkgrey")))) + '((((class color) + (background light)) + (:inherit 'normal :foreground "black" + :background "darkgrey")) + (((class color) + (background dark)) + (:inherit 'normal :foreground "black" + :background "darkgrey")) + (t + (:inherit 'normal :foreground "black" + :background "darkgrey")))) #+end_src ** TODO Gnus @@ -2243,9 +2268,9 @@ See [[https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/mast #+begin_src emacs-lisp :noweb-ref settings (setq-default elfeed-db-directory - (expand-file-name "elfeed/db" - (or (getenv "XDG_CACHE_HOME") - "~/.cache"))) + (expand-file-name "elfeed/db" + (or (getenv "XDG_CACHE_HOME") + "~/.cache"))) #+end_src #+begin_src emacs-lisp :noweb-ref hooks @@ -2260,92 +2285,92 @@ See [[https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/mast #+begin_src emacs-lisp :noweb-ref settings (setq elfeed-feeds - `( - ("https://computer.rip/rss.xml" tech newsletter) - ("https://weather-broker-cdn.api.bbci.co.uk/en/forecast/rss/3day/4315588" weather) - ("https://www.realbakingwithrose.com/month?format=rss" food) - ("https://xfnw.tilde.institute/sandcats/feed.rss" fwend pix) - ("https://www.makeworld.gq/feed.xml" blag) - ("https://whyarentyoucoding.com/feed.xml" comix) - ("https://xkcd.com/atom.xml" comix) - ("https://falseknees.com/rss.xml" comix) - ("https://chrisman.github.io/rss.xml" fwend dozens blag) - ("https://tilde.team/~dozens/dreams/rss.xml" fwend dozens blag) - ("https://society.neocities.org/rss.xml" fwend dozens) - ("https://supervegan.neocities.org/feed.xml" fwend dozens food) - ("https://blog.astrosnail.pt.eu.org/feed.atom" tech blag) - ("https://www.greghendershott.com/feeds/all.atom.xml" tech blag) - ("https://hans.gerwitz.com/feeds/writing.rss" fwend) - ("http://planet.lisp.org/rss20.xml" tech lisp) - ("https://wflewis.com/feed.xml" blag fwend) - ("HTTPS://atthis.link/rss.xml" blag tech) - ("https://rachelbythebay.com/w/atom.xml" blag tech) - ("https://notes.neeasade.net/rss_full.xml" blag tech) - ("https://www.uninformativ.de/blog/feeds/en.atom" blag tech) - ("http://blog.z3bra.org/rss/feed.xml" blag tech) - ("https://blog.sanctum.geek.nz/feed/" blag tech) - ("https://drewdevault.com/blog/index.xml" blag tech) - ("https://usesthis.com/feed.atom" tech) - ("https://occasionallycogent.com/feed.xml" blag) - ("https://www.murilopereira.com/index.xml" blag tech) - ("https://botanistinthekitchen.blog/feed/" blag food) - ("https://www.careercenterbr.com/feed/" work) - ("https://blog.ebrpl.com/feed/" work) - (,(concat ; long-ass url - "https://lemmy.ml/feeds/front/" - "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9." - "eyJpZCI6MTY4MjQsImlzcyI6ImxlbW15Lm1sIn0" - ".yE2zUGjvlEuTZZi3TiF9HR7L7ITM9f_" - "fQnquyYLgdJ4.xml?sort=Active") - news) - ("https://lobste.rs/rss" news tech) - ("https://feeds.npr.org/1001/rss.xml" news) - (,(concat ; long-ass url - "https://tilde.news/rss?token=" - "FvdFj8rQkhrBy9j1yON1t6RYKDdcuG1MoUlyvRICmbgDGCf2JTWAEObDhdgt") - news tildes tech) - ("https://www.acdw.net/atom.xml" fwend) - ("https://envs.net/~lucidiot/rsrsss/feed.xml" fwend) - ("https://planet.emacslife.com/atom.xml" emacs tech) - ("http://tilde.town/~lucidiot/fridaypostcard.xml" tildes art) - ("https://quasivoid.net/feed.atom" tildes) - ("https://benjaminwil.info/feed.xml" tildes fwend) - ("https://benjaminwil.info/antisocial/feed.xml" tildes) - ("https://blog.ryliejamesthomas.net/feed/" tildes) - ("https://p1k3.com/feed" tildes) - ("https://cosmic.voyage/rss.xml" tildes fiction sci-fi) - ("https://jackreid.xyz/index.xml" tildes) - ("http://lambdacreate.com/static/feed.rss" tildes fwend) - ("https://gaffen.co.uk/feed.xml" tildes) - ("https://gmb.21x2.net/rss.xml" tildes) - ("https://www.insom.me.uk/feed.xml" tildes) - ("https://invisibleup.com/atom.xml" tildes) - ("https://m455.casa/feed.rss" tildes fwend) - ("https://petras.space/index.xml" tildes) - ("https://www.benovermyer.com/post/index.xml" tildes) - ("https://tilde.town/~trm/blog/atom.xml" tildes) - ("https://tilde.team/feed.rss" tildes) - ("http://ajroach42.com/feed.xml" tildes) - ("http://tilde.town/~mroik/blog/rss.xml" tildes) - ("https://hamster.dance/blog/rss/" tildes) - ("https://m455.neocities.org/feed.rss" tildes fwend) - ("https://eli.li/feed.rss" tildes fwend) - ("https://aiweirdness.com/rss" tech) - ("http://tilde.town/~m455/javapool.rss" tilde) - ("https://spwhitton.name/blog/index.rss" blag) - (,(concat "https://www.theadvocate.com/search/?" - ;; Let's Build A URL!!! - "f=rss" ; RSS feed - "&l=10" ; 10 most recent (length) - "&c[]=" ; I'm guessing ... categories? - "baton_rouge/news*," - "baton_rouge/opinion*" - "?t=article" ; type=article - ) - news) - ("https://esoteric.codes/rss" tech) - ("https://wphicks.github.io/feed.xml" blag) - )) + `( + ("https://computer.rip/rss.xml" tech newsletter) + ("https://weather-broker-cdn.api.bbci.co.uk/en/forecast/rss/3day/4315588" weather) + ("https://www.realbakingwithrose.com/month?format=rss" food) + ("https://xfnw.tilde.institute/sandcats/feed.rss" fwend pix) + ("https://www.makeworld.gq/feed.xml" blag) + ("https://whyarentyoucoding.com/feed.xml" comix) + ("https://xkcd.com/atom.xml" comix) + ("https://falseknees.com/rss.xml" comix) + ("https://chrisman.github.io/rss.xml" fwend dozens blag) + ("https://tilde.team/~dozens/dreams/rss.xml" fwend dozens blag) + ("https://society.neocities.org/rss.xml" fwend dozens) + ("https://supervegan.neocities.org/feed.xml" fwend dozens food) + ("https://blog.astrosnail.pt.eu.org/feed.atom" tech blag) + ("https://www.greghendershott.com/feeds/all.atom.xml" tech blag) + ("https://hans.gerwitz.com/feeds/writing.rss" fwend) + ("http://planet.lisp.org/rss20.xml" tech lisp) + ("https://wflewis.com/feed.xml" blag fwend) + ("HTTPS://atthis.link/rss.xml" blag tech) + ("https://rachelbythebay.com/w/atom.xml" blag tech) + ("https://notes.neeasade.net/rss_full.xml" blag tech) + ("https://www.uninformativ.de/blog/feeds/en.atom" blag tech) + ("http://blog.z3bra.org/rss/feed.xml" blag tech) + ("https://blog.sanctum.geek.nz/feed/" blag tech) + ("https://drewdevault.com/blog/index.xml" blag tech) + ("https://usesthis.com/feed.atom" tech) + ("https://occasionallycogent.com/feed.xml" blag) + ("https://www.murilopereira.com/index.xml" blag tech) + ("https://botanistinthekitchen.blog/feed/" blag food) + ("https://www.careercenterbr.com/feed/" work) + ("https://blog.ebrpl.com/feed/" work) + (,(concat ; long-ass url + "https://lemmy.ml/feeds/front/" + "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9." + "eyJpZCI6MTY4MjQsImlzcyI6ImxlbW15Lm1sIn0" + ".yE2zUGjvlEuTZZi3TiF9HR7L7ITM9f_" + "fQnquyYLgdJ4.xml?sort=Active") + news) + ("https://lobste.rs/rss" news tech) + ("https://feeds.npr.org/1001/rss.xml" news) + (,(concat ; long-ass url + "https://tilde.news/rss?token=" + "FvdFj8rQkhrBy9j1yON1t6RYKDdcuG1MoUlyvRICmbgDGCf2JTWAEObDhdgt") + news tildes tech) + ("https://www.acdw.net/atom.xml" fwend) + ("https://envs.net/~lucidiot/rsrsss/feed.xml" fwend) + ("https://planet.emacslife.com/atom.xml" emacs tech) + ("http://tilde.town/~lucidiot/fridaypostcard.xml" tildes art) + ("https://quasivoid.net/feed.atom" tildes) + ("https://benjaminwil.info/feed.xml" tildes fwend) + ("https://benjaminwil.info/antisocial/feed.xml" tildes) + ("https://blog.ryliejamesthomas.net/feed/" tildes) + ("https://p1k3.com/feed" tildes) + ("https://cosmic.voyage/rss.xml" tildes fiction sci-fi) + ("https://jackreid.xyz/index.xml" tildes) + ("http://lambdacreate.com/static/feed.rss" tildes fwend) + ("https://gaffen.co.uk/feed.xml" tildes) + ("https://gmb.21x2.net/rss.xml" tildes) + ("https://www.insom.me.uk/feed.xml" tildes) + ("https://invisibleup.com/atom.xml" tildes) + ("https://m455.casa/feed.rss" tildes fwend) + ("https://petras.space/index.xml" tildes) + ("https://www.benovermyer.com/post/index.xml" tildes) + ("https://tilde.town/~trm/blog/atom.xml" tildes) + ("https://tilde.team/feed.rss" tildes) + ("http://ajroach42.com/feed.xml" tildes) + ("http://tilde.town/~mroik/blog/rss.xml" tildes) + ("https://hamster.dance/blog/rss/" tildes) + ("https://m455.neocities.org/feed.rss" tildes fwend) + ("https://eli.li/feed.rss" tildes fwend) + ("https://aiweirdness.com/rss" tech) + ("http://tilde.town/~m455/javapool.rss" tilde) + ("https://spwhitton.name/blog/index.rss" blag) + (,(concat "https://www.theadvocate.com/search/?" + ;; Let's Build A URL!!! + "f=rss" ; RSS feed + "&l=10" ; 10 most recent (length) + "&c[]=" ; I'm guessing ... categories? + "baton_rouge/news*," + "baton_rouge/opinion*" + "?t=article" ; type=article + ) + news) + ("https://esoteric.codes/rss" tech) + ("https://wphicks.github.io/feed.xml" blag) + )) #+end_src ** 0x0 (null pointer) :package: @@ -2355,7 +2380,7 @@ others. #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(0x0 - :repo "https://git.sr.ht/~zge/nullpointer-emacs")) + :repo "https://git.sr.ht/~zge/nullpointer-emacs")) #+end_src #+begin_src emacs-lisp :noweb-ref settings @@ -2368,27 +2393,27 @@ others. #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(elpher - :repo "git://thelambdalab.xyz/elpher.git")) + :repo "git://thelambdalab.xyz/elpher.git")) #+end_src #+begin_src emacs-lisp :noweb-ref settings (setq-default elpher-ipv4-always t) (doremi-face-set 'elpher-gemini-heading1 - '((t (:inherit (modus-theme-heading-1) - :height 1.0)))) + '((t (:inherit (modus-theme-heading-1) + :height 1.0)))) (doremi-face-set 'elpher-gemini-heading2 - '((t (:inherit (modus-theme-heading-2) - :height 1.0)))) + '((t (:inherit (modus-theme-heading-2) + :height 1.0)))) (doremi-face-set 'elpher-gemini-heading3 - '((t (:inherit (modus-theme-heading-3) - :height 1.0)))) + '((t (:inherit (modus-theme-heading-3) + :height 1.0)))) #+end_src #+begin_src emacs-lisp :noweb-ref no-littering (setq-default elpher-certificate-directory - (no-littering-expand-var-file-name - "elpher-certificates/")) + (no-littering-expand-var-file-name + "elpher-certificates/")) #+end_src #+begin_src emacs-lisp :noweb-ref bindings @@ -2407,28 +2432,28 @@ others. #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(gemini-mode - :repo "https://git.carcosa.net/jmcbray/gemini.el.git")) + :repo "https://git.carcosa.net/jmcbray/gemini.el.git")) #+end_src #+begin_src emacs-lisp :noweb-ref settings (add-to-list 'auto-mode-alist - '("\\.\\(gemini\\|gmi\\)\\'" . gemini-mode)) + '("\\.\\(gemini\\|gmi\\)\\'" . gemini-mode)) (doremi-face-set 'gemini-heading-face-1 - '((t (:inherit (elpher-gemini-heading1))))) + '((t (:inherit (elpher-gemini-heading1))))) (doremi-face-set 'gemini-heading-face2 - '((t (:inherit (elpher-gemini-heading2))))) + '((t (:inherit (elpher-gemini-heading2))))) (doremi-face-set 'gemini-heading-face3 - '((t (:inherit (elpher-gemini-heading3))))) + '((t (:inherit (elpher-gemini-heading3))))) #+end_src *** Gemini-write :package: #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(gemini-write - :repo "https://alexschroeder.ch/cgit/gemini-write" - :fork (:repo "https://tildegit.org/acdw/gemini-write" - :branch "main"))) + :repo "https://alexschroeder.ch/cgit/gemini-write" + :fork (:repo "https://tildegit.org/acdw/gemini-write" + :branch "main"))) (with-eval-after-load 'elpher (require 'gemini-write)) @@ -2448,7 +2473,7 @@ one day. "Start an `eshell', or bury its buffer if focused." (interactive) (if (string= (buffer-name) "*eshell*") ;; XXX: brittle - (bury-buffer) + (bury-buffer) (eshell))) #+end_src @@ -2526,10 +2551,10 @@ I want to use the newest version of Org that I can. (defun acdw/org-mode-prettify () "Prettify `org-mode'." (dolist (cell '(("[ ]" . ?☐) ("[X]" . ?☑) ("[-]" . ?◐) - ("#+BEGIN_SRC" . ?✎) ("#+begin_src" . ?✎) - ("#+BEGIN_QUOTE" . ?❝) ("#+begin_quote" . ?❝) - ("#+END_QUOTE" . ?❞) ("#+end_quote" . ?❞) - ("#+END_SRC" . ?■) ("#+end_src" . ?■))) + ("#+BEGIN_SRC" . ?✎) ("#+begin_src" . ?✎) + ("#+BEGIN_QUOTE" . ?❝) ("#+begin_quote" . ?❝) + ("#+END_QUOTE" . ?❞) ("#+end_quote" . ?❞) + ("#+END_SRC" . ?■) ("#+end_src" . ?■))) (add-to-list 'prettify-symbols-alist cell :append)) (prettify-symbols-mode +1)) #+end_src @@ -2545,23 +2570,23 @@ from [[https://github.com/KaratasFurkan/.emacs.d#org-1][Furkan Karataş]]. #+begin_src emacs-lisp :noweb-ref modes (with-eval-after-load 'org (font-lock-add-keywords 'org-mode - '(("^ *\\([-]\\) " - (0 (prog1 () - (compose-region (match-beginning 1) (match-end 1) "•")))))) + '(("^ *\\([-]\\) " + (0 (prog1 () + (compose-region (match-beginning 1) (match-end 1) "•")))))) (font-lock-add-keywords 'org-mode - '(("^ *\\([+]\\) " - (0 (prog1 () - (compose-region (match-beginning 1) (match-end 1) "◦")))))) + '(("^ *\\([+]\\) " + (0 (prog1 () + (compose-region (match-beginning 1) (match-end 1) "◦")))))) (defface org-checkbox-done-text - '((t (:inherit 'font-lock-comment-face :slant normal))) + '((t (:inherit 'font-lock-comment-face :slant normal))) "Face for the text part of a checked org-mode checkbox." :group 'org) (font-lock-add-keywords 'org-mode `(("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)" - 1 'org-checkbox-done-text prepend)) + 1 'org-checkbox-done-text prepend)) 'append)) #+end_src @@ -2569,14 +2594,14 @@ from [[https://github.com/KaratasFurkan/.emacs.d#org-1][Furkan Karataş]]. #+begin_src emacs-lisp :noweb-ref packages (straight-use-package '(org-appear - :host github - :repo "awth13/org-appear")) + :host github + :repo "awth13/org-appear")) #+end_src #+begin_src emacs-lisp :noweb-ref settings (setq-default org-appear-autoemphasis t - org-appear-autolinks nil - org-appear-autosubmarkers t) + org-appear-autolinks nil + org-appear-autosubmarkers t) #+end_src #+begin_src emacs-lisp :noweb-ref hooks @@ -2588,16 +2613,16 @@ from [[https://github.com/KaratasFurkan/.emacs.d#org-1][Furkan Karataş]]. #+begin_src emacs-lisp :noweb-ref settings (with-eval-after-load 'org-tempo (dolist (cell '(("el" . "src emacs-lisp") - ("cr" . "src emacs-lisp :noweb-ref requires") - ("cf" . "src emacs-lisp :noweb-ref functions") - ("cs" . "src emacs-lisp :noweb-ref settings") - ("cm" . "src emacs-lisp :noweb-ref modes") - ("cl" . "src emacs-lisp :noweb-ref linux-specific") - ("cw" . "src emacs-lisp :noweb-ref windows-specific") - ("cp" . "src emacs-lisp :noweb-ref packages") - ("ch" . "src emacs-lisp :noweb-ref hooks") - ("cb" . "src emacs-lisp :noweb-ref bindings") - ("cnl" . "src emacs-lisp :noweb-ref no-littering"))) + ("cr" . "src emacs-lisp :noweb-ref requires") + ("cf" . "src emacs-lisp :noweb-ref functions") + ("cs" . "src emacs-lisp :noweb-ref settings") + ("cm" . "src emacs-lisp :noweb-ref modes") + ("cl" . "src emacs-lisp :noweb-ref linux-specific") + ("cw" . "src emacs-lisp :noweb-ref windows-specific") + ("cp" . "src emacs-lisp :noweb-ref packages") + ("ch" . "src emacs-lisp :noweb-ref hooks") + ("cb" . "src emacs-lisp :noweb-ref bindings") + ("cnl" . "src emacs-lisp :noweb-ref no-littering"))) (add-to-list 'org-structure-template-alist cell))) #+end_src @@ -2611,7 +2636,7 @@ from [[https://github.com/KaratasFurkan/.emacs.d#org-1][Furkan Karataş]]. ;; MAYBE: Use `org-element-lineage'. (when-let* ((parent (org-element-property :parent element))) (or (eq type (car parent)) - (unpackaged/org-element-descendant-of type parent)))) + (unpackaged/org-element-descendant-of type parent)))) (defun unpackaged/org-return-dwim (&optional default) "A helpful replacement for `org-return'. With prefix, call `org-return'. @@ -2623,94 +2648,94 @@ from [[https://github.com/KaratasFurkan/.emacs.d#org-1][Furkan Karataş]]. ;; http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/ (interactive "P") (if default - (org-return) + (org-return) (cond - ;; Act depending on context around point. - - ;; NOTE: I prefer RET to not follow links, but by uncommenting - ;; this block, links will be followed. - ;; FURTHER NOTE: Ideally, I would follow links unless point - ;; /appeared/ to be at the end of the line (even if it's still - ;; inside the link) -- when it would do `org-return'. That - ;; would take some /doing/, however. - - ;; ((eq 'link (car (org-element-context))) - ;; ;; Link: Open it. - ;; (org-open-at-point-global)) - - ((org-at-heading-p) - ;; Heading: Move to position after entry content. - ;; NOTE: This is probably the most interesting feature of this function. - (let ((heading-start (org-entry-beginning-position))) - (goto-char (org-entry-end-position)) - (cond ((and (org-at-heading-p) - (= heading-start (org-entry-beginning-position))) - ;; Entry ends on its heading; add newline after - (end-of-line) - (insert "\n\n")) - (t - ;; Entry ends after its heading; back up - (forward-line -1) - (end-of-line) - (when (org-at-heading-p) - ;; At the same heading - (forward-line) - (insert "\n") - (forward-line -1)) - ;; FIXME: looking-back is supposed to be called with - ;; more arguments. - (while (not (looking-back (rx - (repeat 3 - (seq (optional blank) - "\n"))) - nil)) - (insert "\n")) - (forward-line -1))))) - - ((org-at-item-checkbox-p) - ;; Checkbox: Insert new item with checkbox. - (org-insert-todo-heading nil)) - - ((org-in-item-p) - ;; Plain list. Yes, this gets a little complicated... - (let ((context (org-element-context))) - (if (or (eq 'plain-list (car context)) ; First item in list - (and (eq 'item (car context)) - (not (eq (org-element-property :contents-begin context) - (org-element-property :contents-end context)))) - ;; Element in list item, e.g. a link - (unpackaged/org-element-descendant-of 'item context)) - ;; Non-empty item: Add new item. - (org-insert-item) - ;; Empty item: Close the list. - ;; TODO: Do this with org functions rather than operating - ;; on the text. Can't seem to find the right function. - (delete-region (line-beginning-position) (line-end-position)) - (insert "\n")))) - - ((when (fboundp 'org-inlinetask-in-task-p) - (org-inlinetask-in-task-p)) - ;; Inline task: Don't insert a new heading. - (org-return)) - - ((org-at-table-p) - (cond ((save-excursion - (beginning-of-line) - ;; See `org-table-next-field'. - (cl-loop with end = (line-end-position) - for cell = (org-element-table-cell-parser) - always (equal (org-element-property :contents-begin cell) - (org-element-property :contents-end cell)) - while (re-search-forward "|" end t))) - ;; Empty row: end the table. - (delete-region (line-beginning-position) (line-end-position)) - (org-return)) - (t - ;; Non-empty row: call `org-return'. - (org-return)))) - (t - ;; All other cases: call `org-return'. - (org-return))))) + ;; Act depending on context around point. + + ;; NOTE: I prefer RET to not follow links, but by uncommenting + ;; this block, links will be followed. + ;; FURTHER NOTE: Ideally, I would follow links unless point + ;; /appeared/ to be at the end of the line (even if it's still + ;; inside the link) -- when it would do `org-return'. That + ;; would take some /doing/, however. + + ;; ((eq 'link (car (org-element-context))) + ;; ;; Link: Open it. + ;; (org-open-at-point-global)) + + ((org-at-heading-p) + ;; Heading: Move to position after entry content. + ;; NOTE: This is probably the most interesting feature of this function. + (let ((heading-start (org-entry-beginning-position))) + (goto-char (org-entry-end-position)) + (cond ((and (org-at-heading-p) + (= heading-start (org-entry-beginning-position))) + ;; Entry ends on its heading; add newline after + (end-of-line) + (insert "\n\n")) + (t + ;; Entry ends after its heading; back up + (forward-line -1) + (end-of-line) + (when (org-at-heading-p) + ;; At the same heading + (forward-line) + (insert "\n") + (forward-line -1)) + ;; FIXME: looking-back is supposed to be called with + ;; more arguments. + (while (not (looking-back (rx + (repeat 3 + (seq (optional blank) + "\n"))) + nil)) + (insert "\n")) + (forward-line -1))))) + + ((org-at-item-checkbox-p) + ;; Checkbox: Insert new item with checkbox. + (org-insert-todo-heading nil)) + + ((org-in-item-p) + ;; Plain list. Yes, this gets a little complicated... + (let ((context (org-element-context))) + (if (or (eq 'plain-list (car context)) ; First item in list + (and (eq 'item (car context)) + (not (eq (org-element-property :contents-begin context) + (org-element-property :contents-end context)))) + ;; Element in list item, e.g. a link + (unpackaged/org-element-descendant-of 'item context)) + ;; Non-empty item: Add new item. + (org-insert-item) + ;; Empty item: Close the list. + ;; TODO: Do this with org functions rather than operating + ;; on the text. Can't seem to find the right function. + (delete-region (line-beginning-position) (line-end-position)) + (insert "\n")))) + + ((when (fboundp 'org-inlinetask-in-task-p) + (org-inlinetask-in-task-p)) + ;; Inline task: Don't insert a new heading. + (org-return)) + + ((org-at-table-p) + (cond ((save-excursion + (beginning-of-line) + ;; See `org-table-next-field'. + (cl-loop with end = (line-end-position) + for cell = (org-element-table-cell-parser) + always (equal (org-element-property :contents-begin cell) + (org-element-property :contents-end cell)) + while (re-search-forward "|" end t))) + ;; Empty row: end the table. + (delete-region (line-beginning-position) (line-end-position)) + (org-return)) + (t + ;; Non-empty row: call `org-return'. + (org-return)))) + (t + ;; All other cases: call `org-return'. + (org-return))))) #+end_src #+begin_src emacs-lisp :noweb-ref bindings @@ -2727,34 +2752,34 @@ from [[https://github.com/KaratasFurkan/.emacs.d#org-1][Furkan Karataş]]. exist after each headings's drawers." (interactive "P") (org-map-entries (lambda () - (org-with-wide-buffer - ;; `org-map-entries' narrows the buffer, which prevents us - ;; from seeing newlines before the current heading, so we - ;; do this part widened. - (while (not (looking-back "\n\n" nil)) - ;; Insert blank lines before heading. - (insert "\n"))) - (let ((end (org-entry-end-position))) - ;; Insert blank lines before entry content - (forward-line) - (while (and (org-at-planning-p) - (< (point) (point-max))) - ;; Skip planning lines - (forward-line)) - (while (re-search-forward org-drawer-regexp end t) - ;; Skip drawers. You might think that `org-at-drawer-p' - ;; would suffice, but for some reason it doesn't work - ;; correctly when operating on hidden text. This - ;; works, taken from `org-agenda-get-some-entry-text'. - (re-search-forward "^[ \t]*:END:.*\n?" end t) - (goto-char (match-end 0))) - (unless (or (= (point) (point-max)) - (org-at-heading-p) - (looking-at-p "\n")) - (insert "\n")))) - t (if prefix - nil - 'tree))) + (org-with-wide-buffer + ;; `org-map-entries' narrows the buffer, which prevents us + ;; from seeing newlines before the current heading, so we + ;; do this part widened. + (while (not (looking-back "\n\n" nil)) + ;; Insert blank lines before heading. + (insert "\n"))) + (let ((end (org-entry-end-position))) + ;; Insert blank lines before entry content + (forward-line) + (while (and (org-at-planning-p) + (< (point) (point-max))) + ;; Skip planning lines + (forward-line)) + (while (re-search-forward org-drawer-regexp end t) + ;; Skip drawers. You might think that `org-at-drawer-p' + ;; would suffice, but for some reason it doesn't work + ;; correctly when operating on hidden text. This + ;; works, taken from `org-agenda-get-some-entry-text'. + (re-search-forward "^[ \t]*:END:.*\n?" end t) + (goto-char (match-end 0))) + (unless (or (= (point) (point-max)) + (org-at-heading-p) + (looking-at-p "\n")) + (insert "\n")))) + t (if prefix + nil + 'tree))) #+end_src I fix the headline spacing every time I save. @@ -2763,7 +2788,7 @@ I fix the headline spacing every time I save. (defun hook--org-mode-fix-blank-lines () (when (eq major-mode 'org-mode) (let ((current-prefix-arg 4)) ; Emulate C-u - (call-interactively 'unpackaged/org-fix-blank-lines)))) + (call-interactively 'unpackaged/org-fix-blank-lines)))) (add-hook 'before-save-hook #'hook--org-mode-fix-blank-lines) #+end_src @@ -2780,19 +2805,19 @@ Inspo: #+begin_src emacs-lisp :noweb-ref settings (setq-default org-agenda-files ; look for files in ~/org - (list org-directory) - ;; agenda - org-agenda-span 5 - org-agenda-skip-scheduled-if-done t - org-agenda-skip-deadline-if-done t - org-deadline-warning-days 2 - ;; logging - org-log-into-drawer "LOGBOOK" - org-log-done t - ;; archive - org-archive-location (concat (expand-file-name ".archive.org" - org-directory) - "::")) + (list org-directory) + ;; agenda + org-agenda-span 5 + org-agenda-skip-scheduled-if-done t + org-agenda-skip-deadline-if-done t + org-deadline-warning-days 2 + ;; logging + org-log-into-drawer "LOGBOOK" + org-log-done t + ;; archive + org-archive-location (concat (expand-file-name ".archive.org" + org-directory) + "::")) #+end_src #+begin_src emacs-lisp :noweb-ref bindings @@ -2841,12 +2866,12 @@ altogether. Hm. #+begin_src emacs-lisp :noweb-ref settings (setq-default org-todo-keywords - '((sequence - "TODO(t)" "STARTED(s)" - "WAITING(w@/!)" "SOMEDAY(.)" - "|" "DONE(x!)" "CANCELLED(c@/!)") - (sequence "RECUR(r)" "|" "DONE(x!)") - (sequence "MEETING(m)"))) + '((sequence + "TODO(t)" "STARTED(s)" + "WAITING(w@/!)" "SOMEDAY(.)" + "|" "DONE(x!)" "CANCELLED(c@/!)") + (sequence "RECUR(r)" "|" "DONE(x!)") + (sequence "MEETING(m)"))) #+end_src ** Org Capture @@ -2871,29 +2896,29 @@ TODO, and Diary. org-capture-templates `(;; Todo -- these go to the Inbox for further processing ("t" "Quick Task" entry - (file ,acdw/org-inbox-file) - "* TODO %^{Task}\n" - :immediate-finish t) + (file ,acdw/org-inbox-file) + "* TODO %^{Task}\n" + :immediate-finish t) ("T" "Task" entry - (file ,acdw/org-inbox-file) - "* TODO %^{Task}\n") + (file ,acdw/org-inbox-file) + "* TODO %^{Task}\n") ("." "Today" entry - (file ,acdw/org-inbox-file) - "* TODO %^{Task}\nSCHEDULED: %t\n" - :immediate-finish t) + (file ,acdw/org-inbox-file) + "* TODO %^{Task}\nSCHEDULED: %t\n" + :immediate-finish t) ;; Meetings ("m" "Meeting" entry - (file ,acdw/org-inbox-file) - "* MEETING %^{Meeting}\n%^T\n\n%?") + (file ,acdw/org-inbox-file) + "* MEETING %^{Meeting}\n%^T\n\n%?") ;; Diary -- for the special Diary file ("j" "Diary entry" entry - (file+olp+datetree ,acdw/org-diary-file) - "* %U\n\n%?" - :empty-lines 1) + (file+olp+datetree ,acdw/org-diary-file) + "* %U\n\n%?" + :empty-lines 1) ;; Books to read ("b" "Book to read" entry - (file+headline "books.org" "Later") - "* TOREAD %^{Title} + (file+headline "books.org" "Later") + "* TOREAD %^{Title} :PROPERTIES: :Author: %^{Author} :END:\n" :immediate-finish t))) @@ -2939,23 +2964,23 @@ any data loss. Here's what all that looks like. #+begin_src emacs-lisp (let ((win-app-dir "~/Applications")) (dolist (path (list - ;; Windows - (expand-file-name "exe" win-app-dir) - (expand-file-name "exe/bin" win-app-dir) - (expand-file-name "Git/bin" win-app-dir) - (expand-file-name "Git/usr/bin" win-app-dir) - (expand-file-name "Git/mingw64/bin" win-app-dir) - (expand-file-name "Everything" win-app-dir) - (expand-file-name "Win-builds/bin" win-app-dir) - (expand-file-name "Z/bin" win-app-dir) - ;; Linux - (expand-file-name "bin" user-emacs-directory) - (expand-file-name "~/bin") - (expand-file-name "~/.local/bin") - (expand-file-name "~/Scripts") - )) + ;; Windows + (expand-file-name "exe" win-app-dir) + (expand-file-name "exe/bin" win-app-dir) + (expand-file-name "Git/bin" win-app-dir) + (expand-file-name "Git/usr/bin" win-app-dir) + (expand-file-name "Git/mingw64/bin" win-app-dir) + (expand-file-name "Everything" win-app-dir) + (expand-file-name "Win-builds/bin" win-app-dir) + (expand-file-name "Z/bin" win-app-dir) + ;; Linux + (expand-file-name "bin" user-emacs-directory) + (expand-file-name "~/bin") + (expand-file-name "~/.local/bin") + (expand-file-name "~/Scripts") + )) (when (file-exists-p path) - (add-to-list 'exec-path path :append)))) + (add-to-list 'exec-path path :append)))) ;; Set $PATH (setenv "PATH" (mapconcat #'identity exec-path path-separator)) @@ -2984,19 +3009,19 @@ function so I can call it in another wrapper. "Bootstrap straight.el." (defvar bootstrap-version) (let ((bootstrap-file - (expand-file-name - "straight/repos/straight.el/bootstrap.el" - user-emacs-directory)) - (bootstrap-version 5)) + (expand-file-name + "straight/repos/straight.el/bootstrap.el" + user-emacs-directory)) + (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) - (with-current-buffer - (url-retrieve-synchronously - (concat - "https://raw.githubusercontent.com/" - "raxod502/straight.el/develop/install.el") - 'silent 'inhibit-cookies) - (goto-char (point-max)) - (eval-print-last-sexp))) + (with-current-buffer + (url-retrieve-synchronously + (concat + "https://raw.githubusercontent.com/" + "raxod502/straight.el/develop/install.el") + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage))) #+end_src @@ -3008,22 +3033,22 @@ the repo using git, /then/ run the bootstrap code. (when (executable-find "git") (unless (ignore-errors (acdw/bootstrap-straight)) (let ((msg "Straight.el didn't bootstrap correctly. Cloning directly")) - (message "%s..." msg) - (call-process "git" nil - (get-buffer-create "*bootstrap-straight-messages*") nil - "clone" - "https://github.com/raxod502/straight.el" - (expand-file-name "straight/repos/straight.el" - user-emacs-directory)) - (message "%s...Done." msg) - (acdw/bootstrap-straight)))) + (message "%s..." msg) + (call-process "git" nil + (get-buffer-create "*bootstrap-straight-messages*") nil + "clone" + "https://github.com/raxod502/straight.el" + (expand-file-name "straight/repos/straight.el" + user-emacs-directory)) + (message "%s...Done." msg) + (acdw/bootstrap-straight)))) #+end_src ** Ignore =straight/build/= #+begin_src emacs-lisp :noweb-ref settings (add-to-list 'recentf-exclude (expand-file-name "straight/build/" - user-emacs-directory)) + user-emacs-directory)) #+end_src * System integration @@ -3059,13 +3084,13 @@ This function require [[https://github.com/simonthum/git-sync][git-sync]]. (interactive) (message "Git-Syncing %s..." directory) (let ((proc (start-process "git-sync" - (get-buffer-create (format "*git-sync:%s*" directory)) - "git" "-C" (expand-file-name directory) "sync"))) + (get-buffer-create (format "*git-sync:%s*" directory)) + "git" "-C" (expand-file-name directory) "sync"))) (add-function :after (process-sentinel proc) - (lambda (proc ev) - (cond - ((string-match "finished\n\\'" ev) - (message "Git-Syncing %s...Done." directory))))))) + (lambda (proc ev) + (cond + ((string-match "finished\n\\'" ev) + (message "Git-Syncing %s...Done." directory))))))) #+end_src **** ~/org @@ -3110,7 +3135,7 @@ machine git.example.com user acdw password hahayeahrightyamoroniwouldn'tgiveyout #+begin_src emacs-lisp :noweb-ref hooks (autoload 'magit-process-password-auth-source "magit") (add-hook 'magit-process-find-password-functions - #'magit-process-password-auth-source) + #'magit-process-password-auth-source) #+end_src *** TRAMP @@ -3131,9 +3156,9 @@ from [[https://github.com/grandfoobah/spartan-emacs/blob/master/spartan-layers/s #+begin_src emacs-lisp :noweb-ref settings (setq-default tramp-default-method "ssh" - tramp-copy-size-limit nil - tramp-use-ssh-controlmaster-options nil - tramp-default-remote-shell "/bin/bash") + tramp-copy-size-limit nil + tramp-use-ssh-controlmaster-options nil + tramp-default-remote-shell "/bin/bash") #+end_src ** Linux (home) @@ -3154,8 +3179,8 @@ your =$PATH= somewhere. #+begin_src sh :shebang "#!/bin/sh" :tangle (if (eq system-type 'gnu/linux) "~/bin/em" "") if ! emacsclient -nc "$@"; then - emacs --daemon - emacsclient -nc "$@" + emacs --daemon + emacsclient -nc "$@" fi #+end_src @@ -3195,7 +3220,7 @@ section come from [[https://github.com/termitereform/JunkPile/blob/master/emacs- #+begin_src emacs-lisp :noweb-ref windows-specific (setenv "DICPATH" (expand-file-name "exe/share/hunspell" - "~/Applications/")) + "~/Applications/")) #+end_src *** Settings @@ -3207,13 +3232,13 @@ See also [[https://github.com/bbatsov/prelude/blob/master/core/prelude-windows.e #+begin_src emacs-lisp (setq-default w32-allow-system-shell t ; enable cmd.exe as shell - ;; modifier keys - w32-pass-lwindow-to-system nil - w32-lwindow-modifier 'super - w32-pass-rwindow-to-system nil - w32-rwindow-modifier 'super - w32-pass-apps-to-system nil - w32-apps-modifier 'hyper) + ;; modifier keys + w32-pass-lwindow-to-system nil + w32-lwindow-modifier 'super + w32-pass-rwindow-to-system nil + w32-rwindow-modifier 'super + w32-pass-apps-to-system nil + w32-apps-modifier 'hyper) #+end_src *** Scripts @@ -3298,38 +3323,38 @@ have them all out of sync. #+begin_src gitconfig :tangle (if (eq system-type 'windows-nt) "~/.gitconfig" "") # tangled from ~/.emacs.d/config.org [github] - user = duckwork + user = duckwork [credential] - helper = store + helper = store [user] - name = Case Duckworth - email = acdw@acdw.net + name = Case Duckworth + email = acdw@acdw.net [pull] - rebase = false + rebase = false [core] - excludesfile = ~/.gitignore - attributesfile = ~/.gitattributes - autocrlf = false - eol = lf + excludesfile = ~/.gitignore + attributesfile = ~/.gitattributes + autocrlf = false + eol = lf [diff "lisp"] - # basic - #xfuncname = "^(\\(.*)$" - # advanced - xfuncname = "^(((;;;+ )|\\(|([ \t]+\\(((cl-|el-patch-)?def(un|var|macro|method|custom)|gb/))).*)$" + # basic + #xfuncname = "^(\\(.*)$" + # advanced + xfuncname = "^(((;;;+ )|\\(|([ \t]+\\(((cl-|el-patch-)?def(un|var|macro|method|custom)|gb/))).*)$" [diff "org"] - xfuncname = "^(\\*+ +.*)$" + xfuncname = "^(\\*+ +.*)$" [url "https://github.com/"] - insteadOf = gh: - pushInsteadOf = gh: + insteadOf = gh: + pushInsteadOf = gh: [url "https://gitlab.com/"] - insteadOf = gl: - pushInsteadOf = gl: + insteadOf = gl: + pushInsteadOf = gl: [url "https://git.sr.ht/"] - insteadOf = sr: - pushInsteadOf = sr: + insteadOf = sr: + pushInsteadOf = sr: #+end_src * Appendices @@ -3449,14 +3474,14 @@ Bind it to =C-z i= because =C-z C-c= is taken for capture. (let ((config (locate-user-emacs-file "config.org"))) ;; tangle (with-current-buffer (find-file-noselect config) - (message "Tangling config.org...") - (let ((prog-mode-hook nil) - (inhibit-redisplay t) - (inhibit-message t)) - (add-to-list 'load-path (locate-user-emacs-file - "straight/build/org/")) - (require 'org) - (org-babel-tangle))) + (message "Tangling config.org...") + (let ((prog-mode-hook nil) + (inhibit-redisplay t) + (inhibit-message t)) + (add-to-list 'load-path (locate-user-emacs-file + "straight/build/org/")) + (require 'org) + (org-babel-tangle))) (message "Tangling config.org... Done.") ;; load init files (load (locate-user-emacs-file "early-init.el")) @@ -3500,15 +3525,15 @@ the needed boolean expression to tangle config.org. Booleans, yall! #+begin_src emacs-lisp (message "%s..." "Loading init.el") (let* (;; Speed up init - (gc-cons-threshold most-positive-fixnum) - ;; (gc-cons-percentage 0.6) - (file-name-handler-alist nil) - ;; Config file names - (config (expand-file-name "config" - user-emacs-directory)) - (config.el (concat config ".el")) - (config.org (concat config ".org")) - (straight-org-dir (locate-user-emacs-file "straight/build/org"))) + (gc-cons-threshold most-positive-fixnum) + ;; (gc-cons-percentage 0.6) + (file-name-handler-alist nil) + ;; Config file names + (config (expand-file-name "config" + user-emacs-directory)) + (config.el (concat config ".el")) + (config.org (concat config ".org")) + (straight-org-dir (locate-user-emacs-file "straight/build/org"))) ;; Okay, let's figure this out. ;; `and' evaluates each form, and returns nil on the first that ;; returns nil. `unless' only executes its body if the test @@ -3518,12 +3543,12 @@ the needed boolean expression to tangle config.org. Booleans, yall! ;; 2. Try to load the config. If it errors (nil), it'll bubble that ;; to the `and' and the body will be evaluated. (unless (and (not (file-newer-than-file-p config.org config.el)) - (load config :noerror)) + (load config :noerror)) ;; A plain require here just loads the older `org' ;; in Emacs' install dir. We need to add the newer ;; one to the `load-path', hopefully that's all. (when (file-exists-p straight-org-dir) - (add-to-list 'load-path straight-org-dir)) + (add-to-list 'load-path straight-org-dir)) ;; Load config.org (message "%s..." "Loading config.org") (require 'org) diff --git a/early-init.el b/early-init.el index 1a26b03..056670a 100644 --- a/early-init.el +++ b/early-init.el @@ -18,21 +18,21 @@ ;; BOOTSTRAP PACKAGE MANAGEMENT (let ((win-app-dir "~/Applications")) (dolist (path (list - ;; Windows - (expand-file-name "exe" win-app-dir) - (expand-file-name "exe/bin" win-app-dir) - (expand-file-name "Git/bin" win-app-dir) - (expand-file-name "Git/usr/bin" win-app-dir) - (expand-file-name "Git/mingw64/bin" win-app-dir) - (expand-file-name "Everything" win-app-dir) - (expand-file-name "Win-builds/bin" win-app-dir) - (expand-file-name "Z/bin" win-app-dir) - ;; Linux - (expand-file-name "bin" user-emacs-directory) - (expand-file-name "~/bin") - (expand-file-name "~/.local/bin") - (expand-file-name "~/Scripts") - )) + ;; Windows + (expand-file-name "exe" win-app-dir) + (expand-file-name "exe/bin" win-app-dir) + (expand-file-name "Git/bin" win-app-dir) + (expand-file-name "Git/usr/bin" win-app-dir) + (expand-file-name "Git/mingw64/bin" win-app-dir) + (expand-file-name "Everything" win-app-dir) + (expand-file-name "Win-builds/bin" win-app-dir) + (expand-file-name "Z/bin" win-app-dir) + ;; Linux + (expand-file-name "bin" user-emacs-directory) + (expand-file-name "~/bin") + (expand-file-name "~/.local/bin") + (expand-file-name "~/Scripts") + )) (when (file-exists-p path) (add-to-list 'exec-path path :append)))) @@ -43,49 +43,49 @@ "Bootstrap straight.el." (defvar bootstrap-version) (let ((bootstrap-file - (expand-file-name - "straight/repos/straight.el/bootstrap.el" - user-emacs-directory)) - (bootstrap-version 5)) + (expand-file-name + "straight/repos/straight.el/bootstrap.el" + user-emacs-directory)) + (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer - (url-retrieve-synchronously - (concat - "https://raw.githubusercontent.com/" - "raxod502/straight.el/develop/install.el") - 'silent 'inhibit-cookies) - (goto-char (point-max)) - (eval-print-last-sexp))) + (url-retrieve-synchronously + (concat + "https://raw.githubusercontent.com/" + "raxod502/straight.el/develop/install.el") + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage))) (when (executable-find "git") (unless (ignore-errors (acdw/bootstrap-straight)) (let ((msg "Straight.el didn't bootstrap correctly. Cloning directly")) (message "%s..." msg) (call-process "git" nil - (get-buffer-create "*bootstrap-straight-messages*") nil - "clone" - "https://github.com/raxod502/straight.el" - (expand-file-name "straight/repos/straight.el" - user-emacs-directory)) + (get-buffer-create "*bootstrap-straight-messages*") nil + "clone" + "https://github.com/raxod502/straight.el" + (expand-file-name "straight/repos/straight.el" + user-emacs-directory)) (message "%s...Done." msg) (acdw/bootstrap-straight)))) ;; SETUP FRAME (add-to-list 'default-frame-alist - '(tool-bar-lines . 0)) + '(tool-bar-lines . 0)) (tool-bar-mode -1) (add-to-list 'default-frame-alist - '(menu-bar-lines . 0)) + '(menu-bar-lines . 0)) (menu-bar-mode -1) (add-to-list 'default-frame-alist - '(vertical-scroll-bars . nil) - '(horizontal-scroll-bars . nil)) + '(vertical-scroll-bars . nil) + '(horizontal-scroll-bars . nil)) (scroll-bar-mode -1) (horizontal-scroll-bar-mode -1) (setq-default frame-inhibit-implied-resize t - frame-resize-pixelwise t) + frame-resize-pixelwise t) (setq-default indicate-empty-lines t) (setq-default indicate-buffer-boundaries 'right) (setq-default visual-line-fringe-indicators '(left-curly-arrow nil)) diff --git a/init.el b/init.el index 28238aa..a0e072f 100644 --- a/init.el +++ b/init.el @@ -23,7 +23,7 @@ (file-name-handler-alist nil) ;; Config file names (config (expand-file-name "config" - user-emacs-directory)) + user-emacs-directory)) (config.el (concat config ".el")) (config.org (concat config ".org")) (straight-org-dir (locate-user-emacs-file "straight/build/org"))) @@ -36,7 +36,7 @@ ;; 2. Try to load the config. If it errors (nil), it'll bubble that ;; to the `and' and the body will be evaluated. (unless (and (not (file-newer-than-file-p config.org config.el)) - (load config :noerror)) + (load config :noerror)) ;; A plain require here just loads the older `org' ;; in Emacs' install dir. We need to add the newer ;; one to the `load-path', hopefully that's all. -- cgit 1.4.1-21-gabe81