From: Lars Ingebrigtsen Date: Fri, 13 Apr 2018 22:15:15 +0000 (+0200) Subject: Move utility function to mm-util.el X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~19^2~5621 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3ba07bfc3ec43aa10d8e2d06a8f36f7022287573;p=emacs.git Move utility function to mm-util.el * lisp/gnus/mm-util.el (mm-images-in-region-p): Move from mm-decode.el and renamed, since it is generally useful. --- diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index d8753e5a1d5..69fc770ec72 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1856,7 +1856,7 @@ text/html;\\s-*charset=\\([^\t\n\r \"'>]+\\)[^>]*>" nil t) 'url-link start end :help-echo (get-text-property start 'help-echo) :keymap (setq keymap (copy-keymap - (if (mm--images-in-region-p start end) + (if (mm-images-in-region-p start end) shr-image-map shr-map))) (get-text-property start 'shr-url)) @@ -1874,19 +1874,6 @@ text/html;\\s-*charset=\\([^\t\n\r \"'>]+\\)[^>]*>" nil t) (overlay-put overlay 'face nil)) (setq start end))))) -(defun mm--images-in-region-p (start end) - (let ((found nil)) - (save-excursion - (goto-char start) - (while (and (not found) - (< (point) end)) - (let ((display (get-text-property (point) 'display))) - (when (and (consp display) - (eq (car display) 'image)) - (setq found t))) - (forward-char 1))) - found)) - (defun mm-handle-filename (handle) "Return filename of HANDLE if any." (or (mail-content-type-get (mm-handle-type handle) diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index 98f993367ef..42c2f3ab155 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -882,6 +882,19 @@ gzip, bzip2, etc. are allowed." (when decomp (kill-buffer (current-buffer))))))) +(defun mm-images-in-region-p (start end) + (let ((found nil)) + (save-excursion + (goto-char start) + (while (and (not found) + (< (point) end)) + (let ((display (get-text-property (point) 'display))) + (when (and (consp display) + (eq (car display) 'image)) + (setq found t))) + (forward-char 1))) + found)) + (provide 'mm-util) ;;; mm-util.el ends here