summaryrefslogtreecommitdiffstats
path: root/lisp/bandali-message.el
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2020-04-12 15:28:29 -0400
committerAmin Bandali <bandali@gnu.org>2020-04-12 15:28:29 -0400
commit2087ae39f646980175a44183370a72e036edbbc0 (patch)
treed03515d2c2cc896038fffa48e7103b425bad0629 /lisp/bandali-message.el
parent12ff40a388a019a4ecf268896202aec986e8fd88 (diff)
downloadconfigs-2087ae39f646980175a44183370a72e036edbbc0.tar.gz
configs-2087ae39f646980175a44183370a72e036edbbc0.tar.xz
configs-2087ae39f646980175a44183370a72e036edbbc0.zip
Move gnus and message settings to lisp/, fix byte-compiler warnings
Diffstat (limited to '')
-rw-r--r--lisp/bandali-message.el69
1 files changed, 69 insertions, 0 deletions
diff --git a/lisp/bandali-message.el b/lisp/bandali-message.el
new file mode 100644
index 0000000..491b6e2
--- /dev/null
+++ b/lisp/bandali-message.el
@@ -0,0 +1,69 @@
+(use-package message
+ :bind (:map message-mode-map ("<C-return>" . b/insert-asterism))
+ :config
+ ;; redefine for a simplified In-Reply-To header
+ ;; (see 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))))
+
+ (defconst b/message-cite-style-format "On %Y-%m-%d %l:%M %p, %N wrote:")
+ (defconst message-cite-style-bandali
+ '((message-cite-function 'message-cite-original)
+ (message-citation-line-function 'message-insert-formatted-citation-line)
+ (message-cite-reply-position 'traditional)
+ (message-yank-prefix "> ")
+ (message-yank-cited-prefix ">")
+ (message-yank-empty-prefix ">")
+ (message-citation-line-format
+ (if b/message-cite-say-hi
+ (concat "Hi %F,\n\n" b/message-cite-style-format)
+ b/message-cite-style-format)))
+ "Citation style based on Mozilla Thunderbird's. Use with message-cite-style.")
+ (setq ;; message-cite-style 'message-cite-style-bandali
+ message-kill-buffer-on-exit t
+ message-send-mail-function 'message-send-mail-with-sendmail
+ message-sendmail-envelope-from 'header
+ message-subscribed-address-functions
+ '(gnus-find-subscribed-addresses)
+ message-dont-reply-to-names
+ "\\(\\(amin@shemshak\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(bandali\\|mab\\|aminb?\\)@gnu\\.org\\)\\|\\(a?bandali@\\(csclub\\.\\)?uwaterloo\\.ca\\)\\)")
+ ;; (require 'company-ebdb)
+ :hook (;; (message-setup . mml-secure-message-sign-pgpmime)
+ (message-mode . flyspell-mode)
+ (message-mode . (lambda ()
+ ;; (setq-local fill-column b/fill-column
+ ;; message-fill-column b/fill-column)
+ (eval-when-compile (defvar company-idle-delay))
+ (make-local-variable 'company-idle-delay)
+ (setq company-idle-delay 0.2))))
+ ;; :custom-face
+ ;; (message-header-subject ((t (:foreground "#111" :weight semi-bold))))
+ ;; (message-header-to ((t (:foreground "#111" :weight normal))))
+ ;; (message-header-cc ((t (:foreground "#333" :weight normal))))
+ :custom
+ (message-elide-ellipsis "[...]\n"))
+
+(use-package footnote
+ :after message
+ ;; :config
+ ;; (setq footnote-start-tag ""
+ ;; footnote-end-tag ""
+ ;; footnote-style 'unicode)
+ :bind
+ (:map message-mode-map
+ :prefix-map b/footnote-prefix-map
+ :prefix "C-c f n"
+ ("a" . footnote-add-footnote)
+ ("b" . footnote-back-to-message)
+ ("c" . footnote-cycle-style)
+ ("d" . footnote-delete-footnote)
+ ("g" . footnote-goto-footnote)
+ ("r" . footnote-renumber-footnotes)
+ ("s" . footnote-set-style)))
+
+(provide 'bandali-message)