From 26e443d9656841841a16cc37e2580e01accc6eb8 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 25 Sep 2021 12:24:34 -0500 Subject: Remove or comment out dumbness --- init.el | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index d8e9bf0..10d42b1 100644 --- a/init.el +++ b/init.el @@ -1143,12 +1143,7 @@ specific to most general, they are these: (indent-region (point-min) (point-max)))))) (setup (:straight async) - (dired-async-mode +1) - - (:with-feature dired - (:hook (defun dired@disable-dired-async-mode-line () - (autoload 'dired-async--modeline-mode "dired-async" nil t) - (dired-async--modeline-mode -1))))) + (dired-async-mode +1)) (setup (:straight avy) (:global "C-'" #'avy-goto-char-timer @@ -1541,7 +1536,8 @@ specific to most general, they are these: " k" #'helpful-key " o" #'helpful-symbol) - (:bind "q" #'quit-window)) + ;; (:bind "q" #'quit-window) + ) (setup (:straight hungry-delete) (:option hungry-delete-chars-to-skip " \t" @@ -2170,15 +2166,6 @@ If used with a numeric prefix argument N, N backticks will be inserted." (:option resize-mini-windows 'grow-only vertico-count-format nil vertico-cycle t) - - ;; (:with-map vertico-map - ;; (:bind "" - ;; (defun up-directory (arg) - ;; "Move up a directory (delete backwards to /)." - ;; (interactive "p") - ;; (if (string-match-p "/." (minibuffer-contents)) - ;; (zap-up-to-char (- arg) ?/) - ;; (backward-kill-word arg))))) (when (boundp 'native-comp-deferred-compilation-deny-list) (add-to-list 'native-comp-deferred-compilation-deny-list "vertico")) @@ -2193,16 +2180,7 @@ If used with a numeric prefix argument N, N backticks will be inserted." (:bind "RET" #'vertico-directory-enter "DEL" #'vertico-directory-delete-char "M-DEL" #'vertico-directory-delete-word)) - (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy) - - ;; Prefix the current candidate with "> ". From Vertico wiki. - (:advise vertico--format-candidate :around - (defun vertico-format@add-arrow (orig cand pref suf index start) - (setq cand (funcall orig cand pref suf index start)) - (concat (if (= vertico--index index) - (propertize "> " 'face 'vertico-current) - " ") - cand)))) + (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy)) (setup (:straight visual-regexp) (:global "M-%" #'vr/query-replace)) -- cgit 1.4.1-21-gabe81 From d20923000ba8420704b0823b2cf7e89a7a96515b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 25 Sep 2021 12:28:21 -0500 Subject: Add wgrep-setup --- init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'init.el') diff --git a/init.el b/init.el index 10d42b1..30bcd97 100644 --- a/init.el +++ b/init.el @@ -2215,7 +2215,8 @@ If used with a numeric prefix argument N, N backticks will be inserted." (rx ".erb" eos) (rx ".mustache" eos))) -(setup (:straight wgrep)) +(setup (:straight wgrep) + (wgrep-setup)) (setup (:straight which-key) (:option which-key-show-early-on-C-h t -- cgit 1.4.1-21-gabe81 From e70d19dc6ea0d42b2d75716146d23870b378a83d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 25 Sep 2021 12:28:57 -0500 Subject: Rot13 my email taken from pkal. Is this a good idea /now/, even though my email's already been on there for ages? myeshhhhhhhh~~~~ --- early-init.el | 2 +- eshell.el | 2 +- gnus.el | 2 +- init.el | 4 ++-- lisp/acdw-compat.el | 2 +- lisp/acdw-erc.el | 2 +- lisp/acdw-eshell.el | 2 +- lisp/acdw-fonts.el | 2 +- lisp/acdw-modeline.el | 2 +- lisp/acdw-re.el | 2 +- lisp/acdw-reading.el | 2 +- lisp/acdw-setup.el | 2 +- lisp/acdw.el | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) (limited to 'init.el') diff --git a/early-init.el b/early-init.el index eeb5e57..9e410b1 100644 --- a/early-init.el +++ b/early-init.el @@ -1,5 +1,5 @@ ;;; early-init.el -*- lexical-binding: t; coding: utf-8-unix -*- -;; Author: Case Duckworth +;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; Created: Sometime during Covid-19, 2020 ;; Keywords: configuration ;; URL: https://tildegit.org/acdw/emacs diff --git a/eshell.el b/eshell.el index dc96b8e..05f90bc 100644 --- a/eshell.el +++ b/eshell.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021 Case Duckworth -;; Author: Case Duckworth +;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; Keywords: ;; This program is free software; you can redistribute it and/or modify diff --git a/gnus.el b/gnus.el index 4a38733..7a2cdc7 100644 --- a/gnus.el +++ b/gnus.el @@ -1,6 +1,6 @@ ;;; gnus.el -*- lexical-binding: t; coding: utf-8-unix -*- -;; Author: Case Duckworth +;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; Created: Sometime during Covid-19, 2020 ;; Keywords: configuration ;; URL: https://tildegit.org/acdw/emacs diff --git a/init.el b/init.el index 30bcd97..5e20566 100644 --- a/init.el +++ b/init.el @@ -1,6 +1,6 @@ ;;; init.el -*- lexical-binding: t; coding: utf-8-unix -*- -;; Author: Case Duckworth +;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; Created: Sometime during Covid-19, 2020 ;; Keywords: configuration ;; URL: https://tildegit.org/acdw/emacs @@ -79,7 +79,7 @@ (acdw/require-private) (:option user-full-name "Case Duckworth" - user-mail-address "acdw@acdw.net") + user-mail-address (rot13-string "npqj@npqj.arg")) (when-let ((default-directory (expand-file-name-exists-p "pkg/" user-emacs-directory))) diff --git a/lisp/acdw-compat.el b/lisp/acdw-compat.el index 353a1f1..3221191 100644 --- a/lisp/acdw-compat.el +++ b/lisp/acdw-compat.el @@ -1,6 +1,6 @@ ;;; acdw-compat.el -*- lexical-binding: t; coding: utf-8-unix -*- -;; Author: Case Duckworth +;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; Created: 2021-08-11 ;; Keywords: configuration ;; URL: https://tildegit.org/acdw/emacs diff --git a/lisp/acdw-erc.el b/lisp/acdw-erc.el index dd8525d..beea24b 100644 --- a/lisp/acdw-erc.el +++ b/lisp/acdw-erc.el @@ -1,6 +1,6 @@ ;;; acdw-erc.el -*- lexical-binding: t; coding: utf-8-unix -*- -;; Author: Case Duckworth +;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; Created: 24 May 2021 ;; Keywords: configuration ;; URL: https://tildegit.org/acdw/emacs diff --git a/lisp/acdw-eshell.el b/lisp/acdw-eshell.el index fa27299..eedcc8b 100644 --- a/lisp/acdw-eshell.el +++ b/lisp/acdw-eshell.el @@ -1,6 +1,6 @@ ;;; acdw-eshell.el -*- lexical-binding: t; coding: utf-8-unix -*- -;; Author: Case Duckworth +;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; Keywords: configuration ;; URL: https://tildegit.org/acdw/emacs diff --git a/lisp/acdw-fonts.el b/lisp/acdw-fonts.el index 1b73af7..0fce172 100644 --- a/lisp/acdw-fonts.el +++ b/lisp/acdw-fonts.el @@ -1,6 +1,6 @@ ;;; acdw-fonts.el -- font setup -*- lexical-binding: t; coding: utf-8-unix -*- -;; Author: Case Duckworth +;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; Created: Sometime during Covid-19, 2020 ;; Keywords: configuration ;; URL: https://tildegit.org/acdw/emacs diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index 6e5afb8..3836c81 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el @@ -1,5 +1,5 @@ ;;; acdw-modeline.el -*- lexical-binding: t; coding: utf-8-unix -*- -;; Author: Case Duckworth +;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; Created: Sometime during Covid-19, 2020 ;; Keywords: configuration ;; URL: https://tildegit.org/acdw/emacs diff --git a/lisp/acdw-re.el b/lisp/acdw-re.el index f7df241..db46af1 100644 --- a/lisp/acdw-re.el +++ b/lisp/acdw-re.el @@ -1,5 +1,5 @@ ;;; acdw-re.el -*- lexical-binding: t; coding: utf-8-unix -*- -;; Author: Case Duckworth +;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; Created: 2021-04-29 ;; Keywords: configuration ;; URL: https://tildegit.org/acdw/emacs diff --git a/lisp/acdw-reading.el b/lisp/acdw-reading.el index e21cff9..26ee5e8 100644 --- a/lisp/acdw-reading.el +++ b/lisp/acdw-reading.el @@ -1,6 +1,6 @@ ;;; acdw-reading.el --- minor mode for reading -*- lexical-binding: t -*- -;; Copyright 2021 Case Duckworth +;; Copyright 2021 Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; This file is NOT part of GNU Emacs. ;;; License: diff --git a/lisp/acdw-setup.el b/lisp/acdw-setup.el index 10a2b52..cd3807d 100644 --- a/lisp/acdw-setup.el +++ b/lisp/acdw-setup.el @@ -1,6 +1,6 @@ ;;; acdw-setup.el -- my `setup' commands -*- lexical-binding: t -*- -;; Author: Case Duckworth +;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; This file is NOT part of GNU Emacs. diff --git a/lisp/acdw.el b/lisp/acdw.el index b146f58..4043134 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -1,6 +1,6 @@ ;;; acdw.el --- miscellaneous -*- lexical-binding: t; coding: utf-8-unix -*- -;; Author: Case Duckworth +;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> ;; Created: Sometime during Covid-19, 2020 ;; Keywords: configuration ;; URL: https://tildegit.org/acdw/emacs -- cgit 1.4.1-21-gabe81 From 0858e45bacb602f3a8632dbd025911ec9e80ef98 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 25 Sep 2021 13:14:55 -0500 Subject: Set default major mode when visiting a non-file buffer --- init.el | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 5e20566..1d1ca39 100644 --- a/init.el +++ b/init.el @@ -185,24 +185,12 @@ In short, DO NOT USE THIS FUNCTION!!!" (setup buffers (:global "C-x k" #'acdw/kill-a-buffer) - (defun buffer-list-update@set-major-mode () - "Set `major-mode' from buffer name, even when not visiting a file." - (let ((name (buffer-name))) - (unless (or (active-minibuffer-window) - (string-prefix-p "*" name) - (not (eq major-mode 'fundamental-mode))) - (catch 'done - (dolist (cell auto-mode-alist) - (let ((regexp (car cell)) - (mode (cdr cell))) - (when (string-match regexp name) - (let ((major-mode mode)) - (funcall mode)) - (throw 'done mode)))))))) - - ;; TODO: more testing, just in case. - ;;(add-hook 'buffer-list-update-hook #'buffer-list-update@set-major-mode) - ) + ;; Set the right major mode based on buffer name, if not visiting a file. + ;; http://ruzkuku.com/emacs.d.html#orgeab93c3 + (setq-default major-mode (lambda () + (unless buffer-file-name + (let ((buffer-file-name (buffer-name))) + (set-auto-mode)))))) (setup calendar (:option calendar-week-start-day 1)) -- cgit 1.4.1-21-gabe81 From bf1f5d1adff8b6b7da34ad7b33aa66fbe66434a5 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 25 Sep 2021 13:15:14 -0500 Subject: Advise cycle-spacing --- init.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'init.el') diff --git a/init.el b/init.el index 1d1ca39..3c0d2e7 100644 --- a/init.el +++ b/init.el @@ -1006,7 +1006,11 @@ specific to most general, they are these: tab-width 4 backward-delete-char-untabify-method 'hungry) - (:global "M-SPC" #'cycle-spacing)) + (:global "M-SPC" #'cycle-spacing) + ;; http://ruzkuku.com/emacs.d.html#orgc62eb58 + (:advise cycle-spacing :around + (defun cycle-spacing@newlines-by-default (old arg &rest _) + (funcall old (if (numberp arg) (- arg) arg))))) (setup windmove (:option windmove-wrap-around t) -- cgit 1.4.1-21-gabe81 From 450599d91469a0fa97848aa1a80c2c7d610daa25 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 25 Sep 2021 13:15:42 -0500 Subject: Do away with lispy-modes and overcomplex configuration --- init.el | 31 ++++++++++++++++--------------- lisp/acdw-lisp.el | 11 +---------- 2 files changed, 17 insertions(+), 25 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 3c0d2e7..d19d715 100644 --- a/init.el +++ b/init.el @@ -1914,26 +1914,27 @@ the default is \"/\"." (setup (:straight paredit) ;; I don't use paredit-splice-sexp much, and it stomps on isearch. (:unbind "M-s") - - (defun paredit@setup () - "Correct weirdnesses and set up paredit mode." - (:with-map lisp-mode-shared-map - (:bind "DEL" #'paredit-backward-delete - "C-M-;" #'comment-or-uncomment-sexp - "C-" #'paredit-backward-kill-word - "M-w" #'paredit-copy-as-kill)) - (paredit-mode +1)) - - (dolist (mode lispy-modes) - (add-hook (intern (format "%s-hook" mode)) - #'paredit@setup)) + + (:bind "DEL" #'paredit-backward-delete + "C-M-;" #'comment-or-uncomment-sexp + "C-" #'paredit-backward-kill-word + "M-w" #'paredit-copy-as-kill) + + (:hook-into emacs-lisp-mode + ielm-mode sly-repl-mode + lisp-mode + lisp-interaction-mode + scheme-mode) (:also-load eldoc) (eldoc-add-command 'paredit-backward-delete 'paredit-close-round)) (setup (:straight paren-face) - (dolist (mode lispy-modes) - (add-hook (intern (format "%s-hook" mode)) #'paren-face-mode))) + (:hook-into emacs-lisp-mode + ielm-mode sly-repl-mode + lisp-mode + lisp-interaction-mode + scheme-mode)) (setup (:straight-if (pdf-tools :host github diff --git a/lisp/acdw-lisp.el b/lisp/acdw-lisp.el index 8f551c9..92fe62e 100644 --- a/lisp/acdw-lisp.el +++ b/lisp/acdw-lisp.el @@ -2,16 +2,6 @@ ;; ;; Extras for Lisp modes. -(defvar lispy-modes '(emacs-lisp-mode - eval-expression-minibuffer - ielm-mode - lisp-mode - lisp-interaction-mode - scheme-mode - slime-repl-mode - sly-mrepl-mode) - "List of modes that are lisp-like enough to hook packages into.") - (defun acdw/eval-region-or-buffer () (interactive) (if (region-active-p) @@ -23,3 +13,4 @@ (eval-buffer)))) (provide 'acdw-lisp) +;;; acdw-lisp.el ends here -- cgit 1.4.1-21-gabe81 From d9063ef9d606c0adca90c9c568fa67b5355dcdf4 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 25 Sep 2021 13:16:09 -0500 Subject: Clean up early-init.el and whitespace --- early-init.el | 76 +++++++++++++++++++++++------------------------------------ init.el | 8 +++---- 2 files changed, 33 insertions(+), 51 deletions(-) (limited to 'init.el') diff --git a/early-init.el b/early-init.el index 9e410b1..bb6454e 100644 --- a/early-init.el +++ b/early-init.el @@ -26,24 +26,22 @@ (require 'acdw-frame) ;;; Frame settings -(setq default-frame-alist ; Remove most UI - `((tool-bar-lines . 0) ; No tool bar - (menu-bar-lines . 0) ; No menu bar - (vertical-scroll-bars) ; No scroll bars - (horizontal-scroll-bars) ; ... at all - (width . 84) ; A /little/ wider than - ; `fill-column' (set later) +(setq default-frame-alist + `((tool-bar-lines . 0) + (menu-bar-lines . 0) + (vertical-scroll-bars . nil) + (horizontal-scroll-bars . nil) + (width . 84) (height . 30) - (left-fringe . 8) ; Width of fringes - (right-fringe . 8) ; (8 is default) + (left-fringe . 8) + (right-fringe . 8) (font . ,(acdw/system (:home "DejaVu Sans Mono 10") (:work "Consolas 12") (:other "monospace 10")))) - frame-inhibit-implied-resize t ; Don't resize randomly - frame-resize-pixelwise t ; Resize by pixels, not chars - inhibit-x-resources t ; Don't load ~/.Xresources - ) + frame-inhibit-implied-resize t + frame-resize-pixelwise t + inhibit-x-resources t) (add-hook 'after-init-hook (defun after-init@disable-ui-modes () @@ -64,26 +62,23 @@ say, `tool-bar-mode' once to toggle the tool bar back on." (add-hook 'after-make-frame-functions (defun after-make-frame@setup (&rest args) (ignore args) - (let ((monospace-faces - ;; (acdw/system - ;; (:work '((:font "Consolas" :height 110) - ;; (:font "DejaVu Sans Mono" :height 110) - ;; (:font "monospace" :height 110))) - ;; (_ '((:font "DejaVu Sans Mono" :height 100) - ;; (:font "Consolas" :height 100) - ;; (:font "monospace" :height 100)))) + (let ((fixed-pitch-faces '((:font "Fantasque Sans Mono" :height 110) (:font "Go Mono" :height 100) (:font "DejaVu Sans Mono" :height 110) - (:font "monospace" :height 100)))) - (acdw/set-first-face-attribute 'default monospace-faces) - (acdw/set-first-face-attribute 'fixed-pitch monospace-faces) + (:font "monospace" :height 100))) + (variable-pitch-faces + '((:font "Comic Neue" :height 125) + (:font "Inter" :height 120) + (:font "Go" :height 120) + (:font "sans-serif" + :height 100)))) + (acdw/set-first-face-attribute 'default + fixed-pitch-faces) + (acdw/set-first-face-attribute 'fixed-pitch + fixed-pitch-faces) (acdw/set-first-face-attribute 'variable-pitch - '((:font "Comic Neue" :height 125) - (:font "Inter" :height 120) - (:font "Go" :height 120) - (:font "sans-serif" - :height 100)))) + variable-pitch-faces)) (acdw/set-emoji-fonts "Noto Color Emoji" "Noto Emoji" "Segoe UI Emoji" @@ -125,22 +120,7 @@ say, `tool-bar-mode' once to toggle the tool bar back on." ;;; Bootstrap package manager (`straight.el') -;; 1. Update `exec-path'. -(dolist (path (list (expand-file-name "bin" user-emacs-directory) - (expand-file-name "~/bin") - (expand-file-name "~/.local/bin") - (expand-file-name "~/usr/bin") - (expand-file-name "~/cmd") - (expand-file-name "~/mingw64/bin") - (expand-file-name "~/clisp-2.49")) - exec-path) - (when (file-exists-p path) - (add-to-list 'exec-path path :append))) - -;; 1.5. Update $PATH to reflect changes. -(setenv "PATH" (mapconcat #'identity exec-path path-separator)) - -;; 2. Set `package' and `straight' variables. +;; Set `package' and `straight' variables. (setq package-enable-at-startup nil package-quickstart nil straight-host-usernames '((github . "duckwork") @@ -148,7 +128,7 @@ say, `tool-bar-mode' once to toggle the tool bar back on." straight-base-dir (acdw/dir) straight-check-for-modifications '(check-on-save find-when-checking)) -;; 3. Bootstrap `straight'. +;; Bootstrap `straight'. (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name @@ -189,7 +169,9 @@ say, `tool-bar-mode' once to toggle the tool bar back on." ;; These packages are here because they need to be loaded /before/ ;; everything else in init.el. -(straight-use-package '(setup :host nil :repo "https://git.sr.ht/~pkal/setup")) +(straight-use-package '(setup + :host nil + :repo "https://git.sr.ht/~pkal/setup")) (require 'setup) (require 'acdw-setup) diff --git a/init.el b/init.el index d19d715..6d1eb92 100644 --- a/init.el +++ b/init.el @@ -1243,8 +1243,8 @@ specific to most general, they are these: (crux-reopen-as-root-mode +1)) (setup (:straight-if (define-repeat-map - :host nil - :repo "https://tildegit.org/acdw/define-repeat-map.el") + :host nil + :repo "https://tildegit.org/acdw/define-repeat-map.el") (acdw/system :home)) (defun acdw/other-window-or-switch-buffer-backward () @@ -1883,8 +1883,8 @@ the default is \"/\"." for n from 0 collect (el-patch-swap (org-add-props - head nil '`face - (nth (% n org-n-level-faces) org-level-faces)) + head nil '`face + (nth (% n org-n-level-faces) org-level-faces)) head)) separator)))) (when (> (length fpath) width) -- cgit 1.4.1-21-gabe81 From 810ab527266da4a7396cf2dda3320ea87cc36ecc Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 25 Sep 2021 13:16:51 -0500 Subject: Tweak async-shell-command --- init.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'init.el') diff --git a/init.el b/init.el index 6d1eb92..8e82408 100644 --- a/init.el +++ b/init.el @@ -508,6 +508,8 @@ In short, DO NOT USE THIS FUNCTION!!!" ;; This should stay as /minimal/ as possible. Anything that can go somewhere ;; else /should/ go there. (:option + async-shell-command-display-buffer nil + async-shell-command-buffer #'new-buffer attempt-orderly-shutdown-on-fatal-signal nil auto-hscroll-mode 'current-line attempt-stack-overflow-recovery nil -- cgit 1.4.1-21-gabe81 From 5348b735a21e9c62a700b86e06eb5f2c1c950c30 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 25 Sep 2021 14:03:00 -0500 Subject: Resort --- init.el | 448 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 225 insertions(+), 223 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 8e82408..9ed10a6 100644 --- a/init.el +++ b/init.el @@ -13,12 +13,14 @@ ;; Everyone is permitted to do whatever with this software, without ;; limitation. This software comes without any warranty whatsoever, ;; but with two pieces of advice: -;; - Don't hurt yourself. +;; - Be kind to yourself. ;; - Make good choices. -;;; Code: +;;; Commentary: + +;; Some of the names in these `setup' forms are arbitrary. -;; NOTE that some of the names in `setup' forms are arbitrary. +;;; Code: (setup (:require auth-source) (:option auth-sources (list (acdw/sync-dir "authinfo") @@ -92,26 +94,25 @@ In short, DO NOT USE THIS FUNCTION!!!" (save-excursion (sort-sexps (point-min) (point-max) - (lambda (sexp) - (format "%S" (cadr sexp))) + ;; Key function + nil + ;; Sort function (lambda (s1 s2) ; oh god, this is worse. (let* ((s1 (cdr s1)) (s2 (cdr s2)) ; for the strings themselves - (s1-require (string-match ":require" s1)) - (s2-require (string-match ":require" s2)) - (s1-straight (string-match ":straight" s1)) - (s2-straight (string-match ":straight" s2)) + (require-regexp (rx bos (* nonl) ":require")) + (straight-regexp (rx bos (* nonl) ":straight")) + (s1-require (string-match require-regexp s1)) + (s2-require (string-match require-regexp s2)) + (s1-straight (string-match straight-regexp s1)) + (s2-straight (string-match straight-regexp s2)) (s1-bare (not (or s1-require s1-straight))) (s2-bare (not (or s2-require s2-straight)))) (cond - ;; if both are the same, sort regular style - ((or (and s1-require s2-require) - (and s1-bare s2-bare)) - (string< s1 s2)) + ;; Straight forms require some weirdness ((and s1-straight s2-straight) (let* ((r (rx ":straight" (? "-if") (* space) (? "("))) (s1 (replace-regexp-in-string r "" s1)) (s2 (replace-regexp-in-string r "" s2))) - (message "'%S' '%S'" s1 s2) (string< s1 s2))) ;; requires should go first ((and s1-require (not s2-require)) t) @@ -195,142 +196,6 @@ In short, DO NOT USE THIS FUNCTION!!!" (setup calendar (:option calendar-week-start-day 1)) -(setup (:straight circe) - (require 'circe) - (require 'acdw-irc) - - (:option acdw-irc/left-margin 20 - acdw-irc/post-my-nick "-> " - circe-channel-killed-confirmation nil - circe-color-nicks-everywhere t - circe-default-nick "acdw" - circe-default-part-message "See You, Space Cowpokes . . ." - circe-default-user "acdw" - circe-format-action (format - (format "%%%ds* {nick} {body}" - (- acdw-irc/left-margin 2)) " ") - circe-format-say (format - "{nick:%1$d.%1$ds} | {body}" - (- acdw-irc/left-margin 3)) - circe-format-self-action circe-format-action - circe-format-self-say (format - "{nick:%1$d.%1$ds} > {body}" - (- acdw-irc/left-margin 3)) - circe-network-options - `(("Libera Chat" - :channels ("#emacs" "#systemcrafters" "##webpals") - :sasl-username ,circe-default-nick - :sasl-password ,(acdw/make-password-fetcher - :host "libera.chat")) - ("Tilde Chat" :host "irc.tilde.chat" :port 6697 :use-tls t - :channels ("#meta" "#bread" "#dadjokes" "#team" - "#emacs" "#nsfw") - :sasl-username ,circe-default-nick - :sasl-password ,(acdw/make-password-fetcher - :host "tilde.chat")) - ("Casa" :host "m455.casa" :port 6697 :use-tls t - :channels ("#basement") - :sasl-username ,circe-default-nick - :sasl-password ,(acdw/make-password-fetcher - :host "m455.casa")) - ("Pissnet" :host "piss.hmm.st" :port 6697 :use-tls t - :channels ("#i-just-peed") - :sasl-username ,circe-default-nick - :sasl-password ,(acdw/make-password-fetcher - :host "piss.hmm.st")) - ;; TODO: irc.chat.twitch.tv - ) - circe-reduce-lurker-spam t - circe-server-auto-join-default-type :after-auth - circe-server-buffer-action (lambda (buf) - (message "Connected to %s" buf))) - - (with-eval-after-load 'circe - (:face circe-nick-highlight-face - ((t (:inherit (modus-themes-hl-line modus-themes-bold)))) - circe-my-message-face - ((t (:inherit (modus-themes-slant)))))) - - (:bind "C-c C-p" #'circe-command-PART - "C-l" #'lui-track-jump-to-indicator) - - (:advise circe-command-PART :after - (defun circe-part@kill-buffer (&rest _) - (let ((circe-channel-killed-confirmation nil)) - (kill-buffer))) - - circe-command-QUIT :after - (defun circe-quit@kill-buffer (&rest _) - ;; `circe-server-killed-confirmation' set to nil, and manually - ;; deleting all chat buffers, pending Github issue #402 - ;; (https://github.com/emacs-circe/circe/issues/402) - (let ((circe-server-killed-confirmation nil)) - (with-circe-server-buffer - (dolist (buf (circe-server-chat-buffers)) - (let ((circe-channel-killed-confirmation nil)) - (kill-buffer buf))) - (kill-buffer)))) - - circe-command-GQUIT :after - (defun circe-gquit@kill-buffer (&rest _) - ;; `circe-server-killed-confirmation' set to nil, and manually - ;; deleting all chat buffers, pending Github issue #402 - ;; (https://github.com/emacs-circe/circe/issues/402) - (let ((circe-server-killed-confirmation nil)) - (dolist (buf (circe-server-buffers)) - (with-current-buffer buf - (dolist (buf (circe-server-chat-buffers)) - (let ((circe-channel-killed-confirmation nil)) - (kill-buffer buf)) - (cancel-timer 'irc-send--queue)) - (message "%s: %s" buf circe-server-killed-confirmation) - (kill-buffer)))))) - - (defun circe-command-SHORTEN (url) - "Shorten URL using `0x0-shorten-uri'." - (interactive "sURL to shorten: ") - ;; TODO: enable /shorten URL comment syntax - (let ((short-url (0x0-shorten-uri (0x0--choose-server) url))) - (circe-command-SAY short-url))) - - (:with-mode circe-chat-mode - (:hook #'acdw/stop-paren-annoyances - #'enable-circe-color-nicks - #'enable-circe-display-images - #'enable-circe-new-day-notifier - (defun circe-chat@set-prompt () - (lui-set-prompt - (concat - (propertize - (acdw-irc/margin-format (buffer-name) "" ">") - 'face 'circe-prompt-face - 'read-only t - 'intangible t - 'cursor-intangible t) - " "))))) - - (autoload 'circe-nick-color-reset "circe-color-nicks") - (add-hook 'modus-themes-after-load-theme-hook - #'circe-nick-color-reset) - - (:with-mode lui-mode - (:option lui-fill-column (+ fill-column acdw-irc/left-margin) - lui-fill-type (repeat-string acdw-irc/left-margin " ") - lui-time-stamp-position 'right-margin - lui-time-stamp-format "%H:%M" - lui-track-behavior 'before-switch-to-buffer - lui-track-indicator 'fringe - lui-fill-remove-face-from-newline nil) - - (:local-set fringes-outside-margins t - right-margin-width 5 - scroll-margin 0 - word-wrap t - wrap-prefix (repeat-string acdw-irc/left-margin " ") - line-number-mode nil) - - (:hook #'enable-lui-track))) - (setup completion (:option completion-ignore-case t read-buffer-completion-ignore-case t @@ -341,6 +206,9 @@ In short, DO NOT USE THIS FUNCTION!!!" (:global "M-/" #'hippie-expand)) +(setup css-mode + (:bind "C-c C-h" #'css-lookup-symbol)) + (setup cursor (:option cursor-type 'bar cursor-in-non-selected-windows 'hollow @@ -446,24 +314,6 @@ In short, DO NOT USE THIS FUNCTION!!!" ;; https://oremacs.com/2015/01/17/setting-up-ediff/ (add-hook 'ediff-after-quit-hook-internal #'winner-undo)) -;; requires extension: -;; https://addons.mozilla.org/en-US/firefox/addon/edit-with-emacs1/ -(setup (:straight edit-server) - (:require edit-server) - (edit-server-start) - - (:option edit-server-default-major-mode 'text-mode - edit-server-url-major-mode-alist - (list (cons (rx (| "reddit.com" - "tildes.net")) - 'markdown-mode) - (cons (rx "github.com") - 'gfm-mode))) - - (:advise edit-server-make-frame :before - (defun edit-server@set-a-variable (&rest _) - (setq-local edit-server-frame-p t)))) - (setup eldoc (:option eldoc-idle-delay 0.1 eldoc-echo-area-use-multiline-p nil)) @@ -881,6 +731,24 @@ specific to most general, they are these: ;; (put 'backward-page 'repeat-map 'page-navigation-repeat-map) ) +(setup prog + (:option show-paren-delay 0 + show-paren-style 'mixed + show-paren-when-point-inside-paren t + show-paren-when-point-in-periphery t + smie-indent-basic tab-width) + + (:hook show-paren-mode + electric-pair-local-mode + acdw/setup-fringes + + (defun prog-mode@auto-fill () + (setq-local comment-auto-fill-only-comments t) + (turn-on-auto-fill))) + + (add-hook 'after-save-hook + #'executable-make-buffer-file-executable-if-script-p)) + (setup repeat ;; new for Emacs 28! (:only-if (fboundp #'repeat-mode)) @@ -1146,6 +1014,142 @@ specific to most general, they are these: (:with-feature isearch (:bind "C-'" #'avy-isearch))) +(setup (:straight circe) + (require 'circe) + (require 'acdw-irc) + + (:option acdw-irc/left-margin 20 + acdw-irc/post-my-nick "-> " + circe-channel-killed-confirmation nil + circe-color-nicks-everywhere t + circe-default-nick "acdw" + circe-default-part-message "See You, Space Cowpokes . . ." + circe-default-user "acdw" + circe-format-action (format + (format "%%%ds* {nick} {body}" + (- acdw-irc/left-margin 2)) " ") + circe-format-say (format + "{nick:%1$d.%1$ds} | {body}" + (- acdw-irc/left-margin 3)) + circe-format-self-action circe-format-action + circe-format-self-say (format + "{nick:%1$d.%1$ds} > {body}" + (- acdw-irc/left-margin 3)) + circe-network-options + `(("Libera Chat" + :channels ("#emacs" "#systemcrafters" "##webpals") + :sasl-username ,circe-default-nick + :sasl-password ,(acdw/make-password-fetcher + :host "libera.chat")) + ("Tilde Chat" :host "irc.tilde.chat" :port 6697 :use-tls t + :channels ("#meta" "#bread" "#dadjokes" "#team" + "#emacs" "#nsfw") + :sasl-username ,circe-default-nick + :sasl-password ,(acdw/make-password-fetcher + :host "tilde.chat")) + ("Casa" :host "m455.casa" :port 6697 :use-tls t + :channels ("#basement") + :sasl-username ,circe-default-nick + :sasl-password ,(acdw/make-password-fetcher + :host "m455.casa")) + ("Pissnet" :host "piss.hmm.st" :port 6697 :use-tls t + :channels ("#i-just-peed") + :sasl-username ,circe-default-nick + :sasl-password ,(acdw/make-password-fetcher + :host "piss.hmm.st")) + ;; TODO: irc.chat.twitch.tv + ) + circe-reduce-lurker-spam t + circe-server-auto-join-default-type :after-auth + circe-server-buffer-action (lambda (buf) + (message "Connected to %s" buf))) + + (with-eval-after-load 'circe + (:face circe-nick-highlight-face + ((t (:inherit (modus-themes-hl-line modus-themes-bold)))) + circe-my-message-face + ((t (:inherit (modus-themes-slant)))))) + + (:bind "C-c C-p" #'circe-command-PART + "C-l" #'lui-track-jump-to-indicator) + + (:advise circe-command-PART :after + (defun circe-part@kill-buffer (&rest _) + (let ((circe-channel-killed-confirmation nil)) + (kill-buffer))) + + circe-command-QUIT :after + (defun circe-quit@kill-buffer (&rest _) + ;; `circe-server-killed-confirmation' set to nil, and manually + ;; deleting all chat buffers, pending Github issue #402 + ;; (https://github.com/emacs-circe/circe/issues/402) + (let ((circe-server-killed-confirmation nil)) + (with-circe-server-buffer + (dolist (buf (circe-server-chat-buffers)) + (let ((circe-channel-killed-confirmation nil)) + (kill-buffer buf))) + (kill-buffer)))) + + circe-command-GQUIT :after + (defun circe-gquit@kill-buffer (&rest _) + ;; `circe-server-killed-confirmation' set to nil, and manually + ;; deleting all chat buffers, pending Github issue #402 + ;; (https://github.com/emacs-circe/circe/issues/402) + (let ((circe-server-killed-confirmation nil)) + (dolist (buf (circe-server-buffers)) + (with-current-buffer buf + (dolist (buf (circe-server-chat-buffers)) + (let ((circe-channel-killed-confirmation nil)) + (kill-buffer buf)) + (cancel-timer 'irc-send--queue)) + (message "%s: %s" buf circe-server-killed-confirmation) + (kill-buffer)))))) + + (defun circe-command-SHORTEN (url) + "Shorten URL using `0x0-shorten-uri'." + (interactive "sURL to shorten: ") + ;; TODO: enable /shorten URL comment syntax + (let ((short-url (0x0-shorten-uri (0x0--choose-server) url))) + (circe-command-SAY short-url))) + + (:with-mode circe-chat-mode + (:hook #'acdw/stop-paren-annoyances + #'enable-circe-color-nicks + #'enable-circe-display-images + #'enable-circe-new-day-notifier + (defun circe-chat@set-prompt () + (lui-set-prompt + (concat + (propertize + (acdw-irc/margin-format (buffer-name) "" ">") + 'face 'circe-prompt-face + 'read-only t + 'intangible t + 'cursor-intangible t) + " "))))) + + (autoload 'circe-nick-color-reset "circe-color-nicks") + (add-hook 'modus-themes-after-load-theme-hook + #'circe-nick-color-reset) + + (:with-mode lui-mode + (:option lui-fill-column (+ fill-column acdw-irc/left-margin) + lui-fill-type (repeat-string acdw-irc/left-margin " ") + lui-time-stamp-position 'right-margin + lui-time-stamp-format "%H:%M" + lui-track-behavior 'before-switch-to-buffer + lui-track-indicator 'fringe + lui-fill-remove-face-from-newline nil) + + (:local-set fringes-outside-margins t + right-margin-width 5 + scroll-margin 0 + word-wrap t + wrap-prefix (repeat-string acdw-irc/left-margin " ") + line-number-mode nil) + + (:hook #'enable-lui-track))) + (setup (:straight (consult :host github :repo "minad/consult")) @@ -1288,8 +1292,49 @@ specific to most general, they are these: ("/" winner-undo "?" winner-redo))) +(setup (:straight dictionary) + (:option dictionary-use-single-buffer t) + + (autoload 'dictionary-search "dictionary" + "Ask for a word and search it in all dictionaries" t) + (autoload 'dictionary-match-words "dictionary" + "Ask for a word and search all matching words in the dictionaries" t) + (autoload 'dictionary-lookup-definition "dictionary" + "Unconditionally lookup the word at point." t) + (autoload 'dictionary "dictionary" + "Create a new dictionary buffer" t) + (autoload 'dictionary-mouse-popup-matching-words "dictionary" + "Display entries matching the word at the cursor" t) + (autoload 'dictionary-popup-matching-words "dictionary" + "Display entries matching the word at the point" t) + (autoload 'dictionary-tooltip-mode "dictionary" + "Display tooltips for the current word" t) + (autoload 'global-dictionary-tooltip-mode "dictionary" + "Enable/disable dictionary-tooltip-mode for all buffers" t) + + (:with-map lookup-map + (:bind "d" #'dictionary-search))) + (setup (:straight edit-indirect)) +;; requires extension: +;; https://addons.mozilla.org/en-US/firefox/addon/edit-with-emacs1/ +(setup (:straight edit-server) + (:require edit-server) + (edit-server-start) + + (:option edit-server-default-major-mode 'text-mode + edit-server-url-major-mode-alist + (list (cons (rx (| "reddit.com" + "tildes.net")) + 'markdown-mode) + (cons (rx "github.com") + 'gfm-mode))) + + (:advise edit-server-make-frame :before + (defun edit-server@set-a-variable (&rest _) + (setq-local edit-server-frame-p t)))) + (setup (:straight (electric-cursor :host github :repo "duckwork/electric-cursor")) @@ -1640,7 +1685,7 @@ browser defined in `browse-url-secondary-browser-function'." (define-key lisp-interaction-mode-map (kbd "C-c e") #'macrostep-expand)) (setup (:straight magit) - (:global "C-c g" #'magit-status) + (:global "C-x g" #'magit-status) (:option magit-display-buffer-function (defun magit-display-buffer-same-window (buffer) @@ -1957,24 +2002,6 @@ the default is \"/\"." (persistent-scratch-mode +1)))) (buffer-list))) -(setup prog - (:option show-paren-delay 0 - show-paren-style 'mixed - show-paren-when-point-inside-paren t - show-paren-when-point-in-periphery t - smie-indent-basic tab-width) - - (:hook show-paren-mode - electric-pair-local-mode - acdw/setup-fringes - - (defun prog-mode@auto-fill () - (setq-local comment-auto-fill-only-comments t) - (turn-on-auto-fill))) - - (add-hook 'after-save-hook - #'executable-make-buffer-file-executable-if-script-p)) - (setup (:straight-if pkgbuild-mode (executable-find "makepkg")) (:file-match "PKGBUILD")) @@ -1982,19 +2009,17 @@ the default is \"/\"." (setup (:straight powerthesaurus) (:global "C-c l t" #'powerthesaurus-lookup-word-dwim)) -1(setup (:straight restart-emacs) - (defun emacs-upgrade (&optional update-packages) - "Pull config, upgrade packages, restart Emacs." - (interactive "P") - (emacs-git-pull-config) - (when update-packages - (require 'straight-x) - (straight-x-pull-all)) - (restart-emacs))) - -(setup (:straight (shell-command+ - :host nil - :repo "https://git.sr.ht/~pkal/shell-command-plus")) +(setup (:straight restart-emacs) + (defun emacs-upgrade (&optional update-packages) + "Pull config, upgrade packages, restart Emacs." + (interactive "P") + (emacs-git-pull-config) + (when update-packages + (require 'straight-x) + (straight-x-pull-all)) + (restart-emacs)))(setup (:straight (shell-command+ + :host nil + :repo "https://git.sr.ht/~pkal/shell-command-plus")) (:option shell-command-prompt "$ ") (:with-feature dired (:bind "M-!" shell-command+)) @@ -2265,27 +2290,4 @@ If used with a numeric prefix argument N, N backticks will be inserted." (call-interactively #'zzz-to-char) (call-interactively #'zzz-up-to-char))))) -(setup (:straight dictionary) - (:option dictionary-use-single-buffer t) - - (autoload 'dictionary-search "dictionary" - "Ask for a word and search it in all dictionaries" t) - (autoload 'dictionary-match-words "dictionary" - "Ask for a word and search all matching words in the dictionaries" t) - (autoload 'dictionary-lookup-definition "dictionary" - "Unconditionally lookup the word at point." t) - (autoload 'dictionary "dictionary" - "Create a new dictionary buffer" t) - (autoload 'dictionary-mouse-popup-matching-words "dictionary" - "Display entries matching the word at the cursor" t) - (autoload 'dictionary-popup-matching-words "dictionary" - "Display entries matching the word at the point" t) - (autoload 'dictionary-tooltip-mode "dictionary" - "Display tooltips for the current word" t) - (autoload 'global-dictionary-tooltip-mode "dictionary" - "Enable/disable dictionary-tooltip-mode for all buffers" t) - - (:with-map lookup-map - (:bind "d" #'dictionary-search))) - ;;; init.el ends here -- cgit 1.4.1-21-gabe81