[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master c05f102: Tweat how MML specifies the encoding of binary data
From: |
Lars Ingebrigtsen |
Subject: |
master c05f102: Tweat how MML specifies the encoding of binary data |
Date: |
Thu, 6 Aug 2020 10:47:32 -0400 (EDT) |
branch: master
commit c05f1020cecb4ef7d516e6575c86bf009c2e6f00
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Tweat how MML specifies the encoding of binary data
* lisp/gnus/mml.el (mml-parse-1): Use `data-encoding' to be
slightly less confusing than `content-transfer-encoding'.
* doc/misc/emacs-mime.texi (MML Definition): Document it.
* lisp/gnus/message.el (message-insert-screenshot): Adjust usage.
---
doc/misc/emacs-mime.texi | 13 +++++++++++--
lisp/gnus/message.el | 2 +-
lisp/gnus/mml.el | 4 ++--
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi
index 974cc10..9180b4e 100644
--- a/doc/misc/emacs-mime.texi
+++ b/doc/misc/emacs-mime.texi
@@ -693,8 +693,17 @@ Valid values are @samp{inline} and @samp{attachment}
@item encoding
Valid values are @samp{7bit}, @samp{8bit}, @samp{quoted-printable} and
-@samp{base64} (@code{Content-Transfer-Encoding}). @xref{Charset
-Translation}.
+@samp{base64}. @xref{Charset
+Translation}. This parameter says what
+@code{Content-Transfer-Encoding} to use when sending the part, and is
+normally computed automatically.
+
+@item data-encoding
+This parameter says what encoding has been used on the data, and the
+data will be decoded before use. Valid values are
+@samp{quoted-printable} and @samp{base64}. This is useful when you
+have a part with binary data (for instance an image) inserted directly
+into the Message buffer inside the @samp{"<#part>...<#/part>"} tags.
@item description
A description of the part (@code{Content-Description}).
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 6c0f9b5..819f3e4 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -8709,7 +8709,7 @@ used to take the screenshot."
:max-width (truncate (* (frame-pixel-width) 0.8))
:max-height (truncate (* (frame-pixel-height) 0.8))
:scale 1)
- (format "<#part type=\"image/png\" disposition=inline
content-transfer-encoding=base64 raw=t>\n%s\n<#/part>"
+ (format "<#part type=\"image/png\" disposition=inline
data-encoding=base64 raw=t>\n%s\n<#/part>"
;; Get a base64 version of the image -- this avoids later
;; complications if we're auto-saving the buffer and
;; restoring from a file.
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 1d348f3..ef8aa6a 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -298,12 +298,12 @@ part. This is for the internal use, you should never
modify the value.")
;; We have a part that already has a transfer encoding. Undo
;; that so that we don't double-encode later.
(when (and raw
- (cdr (assq 'content-transfer-encoding tag)))
+ (cdr (assq 'data-encoding tag)))
(with-temp-buffer
(set-buffer-multibyte nil)
(insert contents)
(mm-decode-content-transfer-encoding
- (intern (cdr (assq 'content-transfer-encoding tag)))
+ (intern (cdr (assq 'data-encoding tag)))
(cdr (assq 'type tag)))
(setq contents (buffer-string))))
(when (and (not raw) (memq nil charsets))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master c05f102: Tweat how MML specifies the encoding of binary data,
Lars Ingebrigtsen <=