From 0d6d58999899831edb313b0b4988cc7286ffcc8d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 15 Jul 2022 11:26:30 -0500 Subject: meh --- init.el | 43 +++++++++++++++++++++++++++---------------- lisp/+apheleia.el | 14 ++++++++++++++ 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/init.el b/init.el index a234d4e..73571f6 100644 --- a/init.el +++ b/init.el @@ -1046,7 +1046,7 @@ (setup (:straight apheleia) (:require apheleia +apheleia) - (apheleia-global-mode +1)) + (+apheleia/user-save-global-mode +1)) (setup (:straight avy) (:require avy +avy) @@ -1478,6 +1478,9 @@ (setup (:straight csv-mode)) +(setup (:straight denote) + (:option denote-directory (expand-file-name "~/var/notes"))) + (setup (:straight dictionary) (:option dictionary-use-single-buffer t) (autoload 'dictionary-search "dictionary" @@ -1859,8 +1862,9 @@ "jabber-pkg.el") :fork ( :host nil :repo "https://codeberg.org/acdw/emacs-jabber"))) - (:also-load +jabber) - (:option +jabber-pre-prompt "~ ~ ~\n") + (:require jabber +jabber) + ;; (:option +jabber-pre-prompt "~ ~ ~\n") + (add-to-list 'jabber-post-connect-hooks 'jabber-enable-carbons) (:option jabber-account-list '(("acdw@hmm.st")) jabber-groupchat-buffer-format "%n" jabber-chat-buffer-format "%n" @@ -1870,18 +1874,21 @@ '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$") ("." . jabber-muc-presence-dim)) jabber-muc-colorize-foreign nil ; colorizing doesn't match my color theme - jabber-chat-foreign-prompt-format (concat +jabber-pre-prompt - "%n\n" - (make-string +jabber-ws-prefix - ?\ )) - jabber-chat-local-prompt-format (concat +jabber-pre-prompt - "%n\n" - (make-string +jabber-ws-prefix - ?\ )) - jabber-groupchat-prompt-format (concat +jabber-pre-prompt - "%n\n" - (make-string +jabber-ws-prefix - ?\ )) + ;; jabber-chat-foreign-prompt-format + ;; (concat +jabber-pre-prompt + ;; "%n\n" + ;; (make-string +jabber-ws-prefix + ;; ?\ )) + ;; jabber-chat-local-prompt-format + ;; (concat +jabber-pre-prompt + ;; "%n\n" + ;; (make-string +jabber-ws-prefix + ;; ?\ )) + ;; jabber-groupchat-prompt-format + ;; (concat +jabber-pre-prompt + ;; "%n\n" + ;; (make-string +jabber-ws-prefix + ;; ?\ )) jabber-auto-reconnect t) (add-hook 'modus-themes-after-load-theme-hook (defun jabber-chat@after-modus-themes-load () @@ -1911,7 +1918,7 @@ ((string-match-p "hmm@" (buffer-name)) "🤔 "))) file-percentage-mode nil - wrap-prefix (make-string +jabber-ws-prefix ?\ ) + ;; wrap-prefix (make-string +jabber-ws-prefix ?\ ) comment-start nil)) (:+leader "C-j" jabber-global-keymap) (advice-add 'jabber-activity-add :after #'+jabber-tracking-add) @@ -2142,6 +2149,10 @@ :quit "Buggy") (:load-after notmuch)) +(setup (:straight (notmuch-tags + :repo "https://git.madhouse-project.org/algernon/notmuch-tags.el" + :fork (:repo "https://codeberg.org/acdw/notmuch-tags.el")))) + (setup (:straight nov) (:hook #'visual-fill-column-mode) (:file-match (rx ".epub" eos))) diff --git a/lisp/+apheleia.el b/lisp/+apheleia.el index 9ed731c..3428a72 100644 --- a/lisp/+apheleia.el +++ b/lisp/+apheleia.el @@ -3,6 +3,7 @@ ;;; Code: (require 'cl-lib) +(require 'user-save) ;; https://github.com/raxod502/apheleia/pull/63#issue-1077529623 (cl-defun +apheleia-indent-region (&key buffer scratch formatter callback &allow-other-keys) @@ -13,5 +14,18 @@ (point-max)) (funcall callback))) +(define-minor-mode +apheleia/user-save-mode + "Minor mode for reformatting code on `user-save'. +Customize with `apheleia-mode-alist' and `apheleia-formatters'." + :lighter " Apheleia/US" + (if +apheleia/user-save-mode + (add-hook 'user-save-hook #'apheleia--format-after-save nil 'local) + (remove-hook 'user-save-hook #'apheleia--format-after-save 'local))) + +(define-globalized-minor-mode +apheleia/user-save-global-mode + +apheleia/user-save-mode +apheleia/user-save-mode) + +(put '+apheleia/user-save-mode 'safe-local-variable #'booleanp) + (provide '+apheleia) ;;; +apheleia.el ends here -- cgit 1.4.1-21-gabe81