summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2021-12-24 22:57:15 +0800
committerJSDurand <mmemmew@gmail.com>2021-12-24 22:57:15 +0800
commit57a0cf597c458c20cb98a2e671ac624b16559223 (patch)
tree74ba5a00b377e590d735d048d0ed35fa6c80201a
parentacada2ee8417f5c179955e2034334a12a40fa182 (diff)
gnus-conf: view HTML mails in an external browser
-rw-r--r--gnus-conf.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/gnus-conf.el b/gnus-conf.el
index e9d6d9a..0005e8d 100644
--- a/gnus-conf.el
+++ b/gnus-conf.el
@@ -139,6 +139,9 @@
;;;; Set the correct server on sending mails
+;; This is adapted from the following URL:
+;; https://www.emacswiki.org/emacs/MultipleSMTPAccounts.
+
(defvar durand-smtp-servers nil
"The list of SMTP servers that I use.
Each server is a list of the form:
@@ -267,6 +270,17 @@ identity named durand."
(define-key message-mode-map (vector 3 ?i) #'durand-choose-identity)
+;;; Always view HTML emails in an external browser
+
+(defun durand-browse-html-mail-advice (fn &rest args)
+ "Browse HTML mails in an external browser."
+ (let ((browse-url-browser-function
+ browse-url-secondary-browser-function))
+ (funcall fn (car args))))
+
+(advice-add #'gnus-article-browse-html-article
+ :around #'durand-browse-html-mail-advice)
+
;;; Call me an expert.
(setq gnus-expert-user t)