From 4e66ff0a6dc95989b103412bd4422f15353b168e Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 20 Jan 2025 19:51:48 +0100 Subject: [PATCH] Fix ```elisp code``` handling in mails --- lisp/gnus/mm-uu.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el index 38053840214..991f1efa631 100644 --- a/lisp/gnus/mm-uu.el +++ b/lisp/gnus/mm-uu.el @@ -148,7 +148,7 @@ This can be either \"inline\" or \"attachment\".") (markdown-emacs-sources "^```\\(?:elisp\\|emacs-lisp\\|\n(\\)" "^```$" - ,#'mm-uu-emacs-sources-extract) + ,#'mm-uu-markdown-emacs-sources-extract) (markdown-diff ;; this should be higher than `git-format-patch' "^```\\(?:diff\\|patch\\|\ndiff --git \\)" "^```$" @@ -392,6 +392,13 @@ apply the face `mm-uu-extract'." (list mm-dissect-disposition (cons 'filename file-name)))) +(defun mm-uu-markdown-emacs-sources-extract () + (mm-make-handle (mm-uu-copy-to-buffer (+ start-point 3) (- end-point 4)) + '("application/emacs-lisp" (charset . gnus-decoded)) + nil nil + (list mm-dissect-disposition + (cons 'filename file-name)))) + (defun mm-uu-org-src-code-block-extract () (mm-make-handle (mm-uu-copy-to-buffer start-point end-point) '("text/x-org" (charset . gnus-decoded)))) -- 2.39.5