From: Lars Magne Ingebrigtsen Date: Mon, 17 Aug 2015 22:18:21 +0000 (+0000) Subject: * message.el (message-toggle-image-thumbnails): New command. X-Git-Tag: emacs-25.0.90~1372 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bb86261cbcc9d0f25730e0044042e43748b84134;p=emacs.git * message.el (message-toggle-image-thumbnails): New command. --- diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 447a8d79e39..bc6185fd517 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -8546,14 +8546,44 @@ Used in `message-simplify-recipients'." ;;; multipart/related and HTML support. (defun message-make-html-message-with-image-files (files) + "Make a message containing the current dired-marked image files." (interactive (list (dired-get-marked-files nil current-prefix-arg))) (message-mail) (message-goto-body) (insert "<#part type=text/html>\n\n") (dolist (file files) (insert (format "\n\n" file))) + (message-toggle-image-thumbnails) (message-goto-to)) +(defun message-toggle-image-thumbnails () + "For any included image files, insert a thumbnail of that image." + (interactive) + (let ((overlays (overlays-in (point-min) (point-max))) + (displayed nil)) + (while overlays + (let ((overlay (car overlays))) + (when (overlay-get overlay 'put-image) + (delete-overlay overlay) + (setq displayed t))) + (setq overlays (cdr overlays))) + (unless displayed + (save-excursion + (goto-char (point-min)) + (while (re-search-forward "