1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Implement a screenshot command for Message mode

* doc/misc/message.texi (MIME): Document it.

* lisp/gnus/message.el (message-screenshot-command): New variable.
(message-mode-map): New keystroke and menu item.  Also add
mml-attach-file to the menu.
(message-insert-screenshot): New command.

* lisp/gnus/mml.el (mml-parse-1): Allow having
content-transfer-encoding already in the part, so that we can have
inline base64-encoded binaries in the Message buffers.
This commit is contained in:
Lars Ingebrigtsen 2020-08-05 12:21:35 +02:00
parent c9d550a301
commit a06f41ad2c
4 changed files with 89 additions and 5 deletions

View file

@ -295,6 +295,17 @@ part. This is for the internal use, you should never modify the value.")
(t
(mm-find-mime-charset-region point (point)
mm-hack-charsets))))
;; 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)))
(with-temp-buffer
(set-buffer-multibyte nil)
(insert contents)
(mm-decode-content-transfer-encoding
(intern (cdr (assq 'content-transfer-encoding tag)))
(cdr (assq 'type tag)))
(setq contents (buffer-string))))
(when (and (not raw) (memq nil charsets))
(if (or (memq 'unknown-encoding mml-confirmation-set)
(message-options-get 'unknown-encoding)
@ -313,8 +324,8 @@ Message contains characters with unknown encoding. Really send? ")
(eq 'mml (car tag))
(< (length charsets) 2))
(if (or (not no-markup-p)
;; Don't create blank parts.
(string-match "[^ \t\r\n]" contents))
;; Don't create blank parts.
(push (nconc tag (list (cons 'contents contents)))
struct))
(let ((nstruct (mml-parse-singlepart-with-multiple-charsets