diff options
author | Amin Bandali <bandali@kelar.org> | 2025-02-10 15:05:56 -0500 |
---|---|---|
committer | Amin Bandali <bandali@kelar.org> | 2025-02-10 15:05:56 -0500 |
commit | 70026d07d0bef09468b93caabf9a1f425533a69a (patch) | |
tree | c5379ac39bff3fb3e818eba88844c136c7e1c239 /.emacs.d/lisp/bandali-message.el | |
parent | 99332da43b8324814ca6c1af7f0076f83c8ce233 (diff) | |
download | configs-70026d07d0bef09468b93caabf9a1f425533a69a.tar.gz configs-70026d07d0bef09468b93caabf9a1f425533a69a.tar.xz configs-70026d07d0bef09468b93caabf9a1f425533a69a.zip |
Drop use-package again
I prefer my own manual approach, use-package feels too magical and
at times does too much for me.
Diffstat (limited to '')
-rw-r--r-- | .emacs.d/lisp/bandali-message.el | 82 |
1 files changed, 39 insertions, 43 deletions
diff --git a/.emacs.d/lisp/bandali-message.el b/.emacs.d/lisp/bandali-message.el index da14f82..9bdbec3 100644 --- a/.emacs.d/lisp/bandali-message.el +++ b/.emacs.d/lisp/bandali-message.el @@ -24,9 +24,41 @@ ;;; Code: -(use-package message - :defer t - :init +(with-eval-after-load 'message + ;; Redefine for a simplified In-Reply-To header + ;; (https://todo.sr.ht/~sircmpwn/lists.sr.ht/67) + (defun message-make-in-reply-to () + "Return the In-Reply-To header for this message." + (when message-reply-headers + (let ((from (mail-header-from message-reply-headers)) + (msg-id (mail-header-id message-reply-headers))) + (when from + msg-id)))) + + (setopt + message-elide-ellipsis "[...]\n" + message-citation-line-format "%N wrote:\n" + message-citation-line-function + #'message-insert-formatted-citation-line + message-confirm-send t + message-fill-column 70 + message-forward-as-mime t + ;; message-kill-buffer-on-exit t + message-send-mail-function #'smtpmail-send-it + message-subscribed-address-functions + '(gnus-find-subscribed-addresses) + message-dont-reply-to-names + (mapconcat + #'identity + '("bandali@kelar\\.org" + "amin@shemshak\\.org" + "\\(bandali\\|mab\\|aminb?\\)@gnu\\.org" + "a?bandali@\\(csclub\\.\\)?uwaterloo\\.ca" + "bandali@gnu\\.ca" + "bandali@ubuntu\\.com" + "bandali@debian\\.org") + "\\|")) + (defun b/newlines-or-asterism (arg) "Create newlines per my liking, or insert asterism if ARG is non-nil." @@ -38,46 +70,10 @@ non-nil." (delete-region (point) (line-end-position)) (newline) (open-line 1)))) - :bind - (:map - message-mode-map - ("C-c C-s" . nil) - ("M-RET" . b/newlines-or-asterism)) - :hook - (message-mode . flyspell-mode) - :custom - (message-elide-ellipsis "[...]\n") - (message-citation-line-format "%N wrote:\n") - (message-citation-line-function - #'message-insert-formatted-citation-line) - (message-confirm-send t) - (message-fill-column 70) - (message-forward-as-mime t) - ;; (message-kill-buffer-on-exit t) - (message-send-mail-function #'smtpmail-send-it) - (message-subscribed-address-functions - '(gnus-find-subscribed-addresses)) - (message-dont-reply-to-names - (mapconcat - #'identity - '("bandali@kelar\\.org" - "amin@shemshak\\.org" - "\\(bandali\\|mab\\|aminb?\\)@gnu\\.org" - "a?bandali@\\(csclub\\.\\)?uwaterloo\\.ca" - "bandali@gnu\\.ca" - "bandali@ubuntu\\.com" - "bandali@debian\\.org") - "\\|")) - :config - ;; Redefine for a simplified In-Reply-To header - ;; (https://todo.sr.ht/~sircmpwn/lists.sr.ht/67) - (defun message-make-in-reply-to () - "Return the In-Reply-To header for this message." - (when message-reply-headers - (let ((from (mail-header-from message-reply-headers)) - (msg-id (mail-header-id message-reply-headers))) - (when from - msg-id))))) + (let ((m message-mode-map)) + (b/keymap-set m "M-RET" #'b/newlines-or-asterism) + (b/keymap-set m "C-c C-s" nil))) +(add-hook 'message-mode-hook #'flyspell-mode) (provide 'bandali-message) ;;; bandali-message.el ends here |