From: Eshel Yaron Date: Mon, 20 Jan 2025 18:51:48 +0000 (+0100) Subject: Fix ```elisp code``` handling in mails X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4e66ff0a6dc95989b103412bd4422f15353b168e;p=emacs.git Fix ```elisp code``` handling in mails --- 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))))