]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/gnus/mm-encode.el (mm-default-buffer-type): Check `major-mode'.
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 25 Mar 2025 14:13:16 +0000 (15:13 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 25 Mar 2025 18:26:48 +0000 (19:26 +0100)
(cherry picked from commit a15534f32e1a978dee6ec96d6b60b5e755666e70)

lisp/gnus/mm-encode.el

index 262b1c4d21c62fae3cc381111281cad5edee2fa4..021c56e26ef86cb56bdabe935e8ba8f240e878d4 100644 (file)
@@ -109,10 +109,8 @@ This variable should never be set directly, but bound before a call to
 
 (defun mm-default-buffer-type (buffer)
   "Return a default content type for BUFFER, a buffer name."
-  (if (and (stringp buffer)
-           (string-match-p
-            (rx (| "*Diff*" "*vc-diff*" "*ediff-diff*" "*ediff-custom-diff*"))
-            buffer))
+  (if-let* ((buf (get-buffer buffer))
+            ((eq (buffer-local-value 'major-mode buf) 'diff-mode)))
       "text/x-patch" "text/plain"))
 
 (defun mm-safer-encoding (encoding &optional type)