From 97a02eb0a4e8998074ad5c01adc4d98c6fe3c52a Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jan 2022 22:31:45 -0600 Subject: Change fonts... again --- early-init.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/early-init.el b/early-init.el index 77a9ecf..2c9d2e6 100644 --- a/early-init.el +++ b/early-init.el @@ -68,9 +68,9 @@ See `no-littering' for examples.") ;; Fonts -(let ((font-name "Go Mono") +(let ((font-name "DejaVu Sans Mono") (font-size 105) - (variable-font-name "Go") + (variable-font-name "DejaVu Sans") (variable-font-size 1.0)) (set-face-attribute 'default nil :family font-name :height font-size :weight 'book) -- cgit 1.4.1-21-gabe81 From 9c6bd60e2db90d38f8528fa8b6dbc96be751382f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jan 2022 22:31:56 -0600 Subject: Re-indent --- early-init.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/early-init.el b/early-init.el index 2c9d2e6..da5d73c 100644 --- a/early-init.el +++ b/early-init.el @@ -55,16 +55,16 @@ See `no-littering' for examples.") ;;; Default frame settings (setq default-frame-alist '((tool-bar-lines . 0) - (menu-bar-lines . 0) - (vertical-scroll-bars) - (horizontal-scroll-bars)) + (menu-bar-lines . 0) + (vertical-scroll-bars) + (horizontal-scroll-bars)) frame-inhibit-implied-resize t frame-resize-pixelwise t window-resize-pixelwise t inhibit-x-resources t indicate-empty-lines nil indicate-buffer-boundaries '((top . right) - (bottom . right))) + (bottom . right))) ;; Fonts @@ -84,9 +84,9 @@ See `no-littering' for examples.") (setq package-enable-at-startup nil package-quickstart nil straight-host-usernames '((github . "duckwork") - (gitlab . "acdw")) + (gitlab . "acdw")) straight-check-for-modifications '(check-on-save - find-when-checking)) + find-when-checking)) (setq no-littering-etc-directory .etc no-littering-var-directory .etc @@ -117,8 +117,8 @@ See `no-littering' for examples.") (require 'straight-x) (dolist (pkg '(el-patch - no-littering - setup)) + no-littering + setup)) (straight-use-package pkg) (require pkg) (require (intern (format "+%s" pkg)) nil :noerror)) -- cgit 1.4.1-21-gabe81 From 612c16f18adff4cfdddd0128e50691061cbd3fab Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jan 2022 22:32:10 -0600 Subject: Remove spurious auth-info files --- init.el | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/init.el b/init.el index bf80b5b..1c769c2 100644 --- a/init.el +++ b/init.el @@ -56,10 +56,7 @@ (+ensure-after-init #'+key-global-mode)) (setup (:require auth-source) - (:option auth-sources (list (private/ "authinfo") - (private/ "authinfo.gpg") - "~/.authinfo" - "~/.authinfo.gpg"))) + (:option auth-sources (list (private/ "authinfo")))) (setup (:require goto-addr) (if (fboundp #'global-goto-address-mode) -- cgit 1.4.1-21-gabe81 From ae6ac318265181a05fe977274d5b0c5d94f5c46b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jan 2022 22:32:20 -0600 Subject: Correct typo --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index 1c769c2..b35367c 100644 --- a/init.el +++ b/init.el @@ -136,7 +136,7 @@ (cons (+browse-url-secondary-browser-regexps-combine) ; non-text websites browse-url-secondary-browser-function) (cons "." ; everything else - browse-url-browser-function))) + +browse-url-browser-function))) ;; Transform URLs before passing to `browse-url' (:option +browse-url-transformations `((,(rx "//" (or "youtube.com" "youtu.be")) -- cgit 1.4.1-21-gabe81 From 6939d3cffcd44df91065c89699153983b17f317c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jan 2022 22:32:31 -0600 Subject: Configure dired --- init.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index b35367c..2651d14 100644 --- a/init.el +++ b/init.el @@ -190,11 +190,16 @@ dired+) (:option dired-recursive-copies 'always dired-recursive-deletes 'always - dired-create-destination-dirs 'ask + dired-create-destination-dirs 'always + dired-do-revert-buffer t + dired-hide-details-hide-symlink-targets nil + dired-isearch-filenames 'dwim delete-by-moving-to-trash t + dired-auto-revert-buffer t dired-listing-switches "-Al" ls-lisp-dirs-first t dired-ls-F-marks-symlinks t + dired-clean-confirm-killing-deleted-buffers nil dired-no-confirm '(byte-compile load chgrp chmod chown copy move hardlink symlink -- cgit 1.4.1-21-gabe81 From 0ef125fb4de7f624edc9e66e7491deb329cbafd4 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jan 2022 22:32:41 -0600 Subject: Add imenu-generic-expression to eshell --- init.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 2651d14..e7d9d9e 100644 --- a/init.el +++ b/init.el @@ -258,8 +258,14 @@ (add-hook 'eshell-mode-hook (defun +eshell@setup () "Eshell improperly does loading. Gah." + (interactive) (dolist (setting `((outline-regexp . ,eshell-prompt-regexp) - (page-delimiter . ,eshell-prompt-regexp))) + (page-delimiter . ,eshell-prompt-regexp) + (imenu-generic-expression + . ,`(("Prompt" + ,(concat eshell-prompt-regexp + "\\(.*\\)") + 1))))) (set (make-local-variable (car setting)) (cdr setting))) (dolist (binding `(("C-d" . +eshell-quit-or-delete-char))) (define-key eshell-mode-map -- cgit 1.4.1-21-gabe81 From 0f437d1346856cf15300f767ef80ff749048461c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jan 2022 22:36:52 -0600 Subject: Break out forge config into its own thing --- init.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/init.el b/init.el index e7d9d9e..36bfff0 100644 --- a/init.el +++ b/init.el @@ -336,14 +336,7 @@ ;; This setup is weird because of dependency issues (:straight (transient :host github :repo "magit/transient" :branch "master") (magit :host github :repo "magit/magit") - (git-modes :host github :repo "magit/git-modes")) - (when (eq system-type 'gnu/linux) - (:straight (forge :host github :repo "magit/forge")) - (with-eval-after-load 'magit - (require 'forge) - (add-to-list 'forge-alist - '("tildegit.org" "tildegit.org/api/v1" "tildegit.org" - forge-gitea-repository))))) + (git-modes :host github :repo "magit/git-modes"))) (setup minibuffer (:require +minibuffer) @@ -897,6 +890,14 @@ See also `crux-reopen-as-root-mode'." :repo "duckwork/filldent.el")) (:+key "M-q" #'filldent-dwim)) +(setup (:straight-when (forge + :host github :repo "magit/forge") + (eq system-type 'gnu/linux)) + (require 'forge) + (add-to-list 'forge-alist + '("tildegit.org" "tildegit.org/api/v1" "tildegit.org" + forge-gitea-repository))) + (setup (:straight (frowny :host github :repo "duckwork/frowny.el")) -- cgit 1.4.1-21-gabe81 From e0318de85888e316d723da8e7baf642c7961caa2 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jan 2022 22:37:34 -0600 Subject: Better-configure elfeed --- init.el | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/init.el b/init.el index 36bfff0..d2997fb 100644 --- a/init.el +++ b/init.el @@ -826,19 +826,32 @@ See also `crux-reopen-as-root-mode'." (setup (:straight elfeed) (:also-load +elfeed) - (:option elfeed-use-curl t - elfeed-curl-extra-arguments '("--insecure") - elfeed-show-unique-buffers t - elfeed-db-directory (sync/ "elfeed/db/" t)) + (+define-dir elfeed/ (sync/ "emacs/elfeed/" t)) + (:option + elfeed-curl-program-name (executable-find "curl") + elfeed-use-curl elfeed-curl-program-name + elfeed-curl-extra-arguments '("--insecure") + elfeed-enclosure-default-dir (cl-loop for dir in '("~/var/download/" + "~/Downloads/") + if (file-exists-p dir) + return dir) + elfeed-search-filter "@1-month-ago +unread" + elfeed-search-trailing-width 24 + elfeed-search-title-min-width 24 + elfeed-search-title-max-width 78 + elfeed-show-unique-buffers t + elfeed-db-directory (elfeed/ "db/" t)) ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/ (advice-add #'elfeed-search-update--force :after #'elfeed-db-save) (:with-mode elfeed-show-mode (:bind "SPC" #'+elfeed-scroll-up-command "S-SPC" #'+elfeed-scroll-down-command) - (:hook #'reading-mode))) + (:hook #'reading-mode) + (define-advice elfeed-show-entry (:after (&rest _)) + (run-at-time 0 nil #'elfeed-show-refresh)))) (setup (:straight elfeed-org) - (:option rmh-elfeed-org-files (list (sync/ "elfeed/elfeed.org" t))) + (:option rmh-elfeed-org-files (list (elfeed/ "/elfeed.org" t))) (elfeed-org)) (setup (:straight embark) -- cgit 1.4.1-21-gabe81 From 010a6ce839edbb254baccecad5d7293c66fc02c2 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jan 2022 22:37:46 -0600 Subject: Add elpher --- init.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.el b/init.el index d2997fb..475ba7e 100644 --- a/init.el +++ b/init.el @@ -854,6 +854,8 @@ See also `crux-reopen-as-root-mode'." (:option rmh-elfeed-org-files (list (elfeed/ "/elfeed.org" t))) (elfeed-org)) +(setup (:straight elpher)) + (setup (:straight embark) (:option prefix-help-command 'embark-prefix-help-command) (:+key "C-." #'embark-act -- cgit 1.4.1-21-gabe81 From a808b5bf015b581f087992c60224c5231de19195 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jan 2022 22:37:58 -0600 Subject: Add eshell-bookmark --- init.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.el b/init.el index 475ba7e..cf5281c 100644 --- a/init.el +++ b/init.el @@ -879,6 +879,9 @@ See also `crux-reopen-as-root-mode'." (:hook-into emacs-lisp-mode lisp-interaction-mode)) +(setup (:straight eshell-bookmark) + (add-hook 'eshell-mode-hook #'eshell-bookmark-setup)) + (setup (:straight eshell-syntax-highlighting) (:hook-into eshell-mode)) -- cgit 1.4.1-21-gabe81 From a67110aefa1d16f7ccb65682b750e4403255c71f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jan 2022 22:38:07 -0600 Subject: Don't confirm anything with pdf-tools-install --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index cf5281c..5707ab6 100644 --- a/init.el +++ b/init.el @@ -1104,7 +1104,7 @@ See also `crux-reopen-as-root-mode'." (setup (:straight-when pdf-tools (eq system-type 'gnu/linux)) - (pdf-tools-install)) + (pdf-tools-install t)) (setup (:straight (shell-command+ :host nil -- cgit 1.4.1-21-gabe81 From 43f693d750e0b5d8b1f3ba2a5c37469b004c2027 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 Jan 2022 00:39:03 -0600 Subject: Remove el-patch on setup Setup 1.2 (I'm pretty sure) removed the `ensure-function' and `ensure-kbd' functions, instead using an `:ensure' keyword in `setup-define'. This makes it way harder to /not/ ensure things when I don't want them, so I just have to use regular elisp when I want to do something funky. Oh well. --- early-init.el | 8 ++++---- lisp/+setup.el | 25 ------------------------- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/early-init.el b/early-init.el index da5d73c..02f92c2 100644 --- a/early-init.el +++ b/early-init.el @@ -123,11 +123,11 @@ See `no-littering' for examples.") (require pkg) (require (intern (format "+%s" pkg)) nil :noerror)) -;;; Appendix +;; Setup `setup' + +(add-to-list 'setup-modifier-list 'setup-wrap-to-demote-errors) -;; I've patched setup to look at `setup-ensure-function-inhibit' to decide -;; whether to ensure functions or not with local macros. -(setq setup-ensure-function-inhibit t) +;;; Appendix ;; Get rid of a dumb alias. straight-ಠ_ಠ-mode really slows down all ;; minibuffer completion functions. Since it's a (rarely-used, even) diff --git a/lisp/+setup.el b/lisp/+setup.el index ac99c1f..c6bcb9e 100644 --- a/lisp/+setup.el +++ b/lisp/+setup.el @@ -24,31 +24,6 @@ (require 'setup) (require 'straight) -;; I don't like the "magic" `setup' performs to ensure a symbol is a -;; function in `:global', `:bind', `:hook', `:hook-into', and others. -;; So here, I'll just make it return the symbol unmodified. -(el-patch-feature setup) -(with-eval-after-load 'setup - (el-patch-defvar - (el-patch-add setup-ensure-function-inhibit nil - "Whether to inhibit `setup-ensure-function'.")) - (el-patch-defun setup-ensure-function (sexp) - (el-patch-concat - "Attempt to return SEXP as a quoted function name." - (el-patch-add - "\nIf `setup-ensure-function-inhibit' is non-nil, just return SEXP.")) - (el-patch-wrap 3 0 - (if (and setup-ensure-function-inhibit - (not (eq sexp (setup-get 'mode)))) - sexp - (cond ((eq (car-safe sexp) 'function) - sexp) - ((eq (car-safe sexp) 'quote) - `#',(cadr sexp)) - ((symbolp sexp) - `#',sexp) - (sexp)))))) - (setup-define :face (lambda (face spec) `(custom-set-faces '(,face ,spec 'now "Customized by `setup'."))) -- cgit 1.4.1-21-gabe81 From e9a1034f8c942187ecccdf93e5d3be8c073a79b2 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 Jan 2022 00:40:11 -0600 Subject: Move stuff around --- init.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 5707ab6..c9cf3c7 100644 --- a/init.el +++ b/init.el @@ -21,20 +21,19 @@ private)) (require (or (car-safe feature) feature) (cdr-safe feature) :noerror)) -(setq debug-on-error t) +(setq debug-on-error (memq system-type '(msdos windows-nt))) (setup (:require +emacs) - (:also-load +lisp) ;; +emacs.el contains super-basic defaults that are basically necessary for ;; good functioning. In this block, I add extra things or more "experimental" ;; ones that might not belong in a separate file. + (:also-load +lisp) (:option truncate-string-ellipsis "…") ;; Bindings (:global "C-x C-k" #'kill-current-buffer "C-x 4 n" #'clone-buffer "C-c v" #'visible-mode - "C-M-;" #'+lisp-comment-or-uncomment-sexp - "" #'consult-buffer) + "C-M-;" #'+lisp-comment-or-uncomment-sexp) ;; Unbind stuff, too. (dolist (key '("C-M-j" "M-j")) -- cgit 1.4.1-21-gabe81 From 800aff834253b7aba899a0202ed36e5f5f161476 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 Jan 2022 00:40:26 -0600 Subject: Add more crux stuff --- init.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index c9cf3c7..7a98669 100644 --- a/init.el +++ b/init.el @@ -774,8 +774,15 @@ (:option consult--regexp-compiler 'consult--orderless-regexp-compiler)))) (setup (:straight crux) - (:+key "C-o" #'crux-smart-open-line - "C-x 4 t" #'crux-transpose-windows) + ;; yes it's silly I have an addon to this addon. + (:also-load +crux) + (:option crux-shell-func #'crux-eshell) + (:global "C-o" #'crux-smart-open-line + "C-x 4 t" #'crux-transpose-windows + "M-w" #'+crux-kill-ring-save + "C-k" #'crux-kill-and-join-forward + "C-c d" #'+crux-insert-date-or-time) + (:+leader "s" #'crux-visit-shell-buffer) (el-patch-feature crux) (with-eval-after-load 'crux -- cgit 1.4.1-21-gabe81 From 20e6b48dfb5e15f061b5e79c448b2ed9ea2ab087 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 Jan 2022 00:40:34 -0600 Subject: Bind transpose-frame commands --- init.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 7a98669..9a61502 100644 --- a/init.el +++ b/init.el @@ -1193,7 +1193,18 @@ See also `crux-reopen-as-root-mode'." 0)))) (funcall topsy-fn)))))) -(setup (:straight transpose-frame)) +(setup (:straight transpose-frame) + (defvar +transpose-frame-map + (let ((map (make-sparse-keymap))) + (dolist (bind '(("t" . transpose-frame) + ("v" . flip-frame) + ("h" . flop-frame) + ("r" . rotate-frame-clockwise) + ("R" . rotate-frame-anticlockwise))) + (define-key map (car bind) (cdr bind))) + map) + "Map for transposing frames.") + (define-key +key-mode-map (kbd "C-x 5 t") +transpose-frame-map)) (setup (:straight trashed) (:option trashed-action-confirmer #'y-or-n-p)) -- cgit 1.4.1-21-gabe81 From 58976a25718a91bec85769d8dddefc25530b130b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 Jan 2022 00:40:50 -0600 Subject: Clean up whitespace regardless --- init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 9a61502..1376ecb 100644 --- a/init.el +++ b/init.el @@ -1252,7 +1252,8 @@ See also `crux-reopen-as-root-mode'." (:require vlf-setup)) (setup (:straight whitespace-cleanup-mode) - (:option whitespace-cleanup-mode-preserve-point t) + (:option whitespace-cleanup-mode-preserve-point t + whitespace-cleanup-mode-only-if-initially-clean nil) (global-whitespace-cleanup-mode +1)) (setup (:straight zoom-frm)) -- cgit 1.4.1-21-gabe81 From 9a48d3bd8b7b03b27a40416ca506fbcc5570b180 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 Jan 2022 00:41:00 -0600 Subject: Add +remember-prefix-arg function --- lisp/acdw.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/acdw.el b/lisp/acdw.el index 43cb5c7..a4e12f1 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -83,5 +83,11 @@ If Emacs is already started, run FUNCTION. Otherwise, add it to (funcall function) (add-hook 'after-init-hook function))) +(defun +remember-prefix-arg (p-arg P-arg) + "Display prefix ARG, in \"p\" and \"P\" `interactive' types. +I keep forgetting how they differ." + (interactive "p\nP") + (message "p: %S P: %S" p-arg P-arg)) + (provide 'acdw) ;;; acdw.el ends here -- cgit 1.4.1-21-gabe81 From 817c0ae001a1ea6cc2775e1e2898931b3ff12d8a Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 Jan 2022 00:41:12 -0600 Subject: Add +crux.el Oops, missed this with a previous commit --- lisp/+crux.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 lisp/+crux.el diff --git a/lisp/+crux.el b/lisp/+crux.el new file mode 100644 index 0000000..b87ec7e --- /dev/null +++ b/lisp/+crux.el @@ -0,0 +1,46 @@ +;;; +crux.el -*- lexical-binding: t; -*- + +;;; Code: + +(require 'crux) + +(defgroup +crux nil + "Extra crux customizations." + :group 'crux + :prefix "+crux-") + +(defun +crux-kill-ring-save (begin end arg) + "Copy region to the kill-ring, possibly indenting it first. +Copy from BEGIN to END using `kill-ring-save' if no argument was +passed, or with `crux-indent-rigidly-and-copy-to-clipboard' if +one was." + (interactive "r\nP") + (call-interactively (if arg #'kill-ring-save + #'crux-indent-rigidly-and-copy-to-clipboard))) + +(defcustom +crux-default-date-format "%c" + "Default date format to use for `+crux-insert-date-or-time'. +Should be a format parsable by `format-time-string'." + :type 'string) + +(defcustom +crux-alternate-date-format "%FT%T%z" + "Alternate date format to use for `+crux-insert-date-or-time'. +Should be a format parsable by `format-time-string'." + :type 'string) + +(defun +crux-insert-date-or-time (arg) + "Insert current date or time. +Called without a prefix ARG, insert the time formatted by +`+crux-default-date-format'. When called with \\[universal-argument], +format the time with `+crux-alternate-date-format'. Otherwise, +prompt for the time format." + (interactive "*P") + (let ((time (current-time))) + (insert (cond + ((null arg) (format-time-string +crux-default-date-format time)) + ((eq (car-safe arg) 4) + (format-time-string +crux-alternate-date-format time)) + (t (format-time-string (read-string "Time Format: ") time)))))) + +(provide '+crux) +;;; +crux.el ends here -- cgit 1.4.1-21-gabe81