]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix ```elisp code``` handling in mails
authorEshel Yaron <me@eshelyaron.com>
Mon, 20 Jan 2025 18:51:48 +0000 (19:51 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 20 Jan 2025 18:51:48 +0000 (19:51 +0100)
lisp/gnus/mm-uu.el

index 3805384021490b06e65f2998b697a584195e7d04..991f1efa631beff898ec21147635becb956695ac 100644 (file)
@@ -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))))