From 6a546a248696ff82152fbafb46b7cc3586abbb1d Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 7 Nov 2021 02:34:54 +0100 Subject: [PATCH] Fix html-mode--image-yank-handler prompting * lisp/textmodes/sgml-mode.el (html-mode--image-yank-handler): Fix two format statements and rearrange images. --- lisp/textmodes/sgml-mode.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 2b3db0bfeb2..8985fe5cdf9 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -2438,22 +2438,22 @@ To work around that, do: (sgml-pretty-print (point-min) (point-max)))) (defun html-mode--image-yank-handler (type image) - (let ((file (read-file-name "Save %s image to: "))) + (let ((file (read-file-name (format "Save %s image to: " type)))) (when (file-directory-p file) (user-error "%s is a directory")) (when (and (file-exists-p file) - (not (yes-or-no-p "%s exists; overwrite?"))) + (not (yes-or-no-p (format "%s exists; overwrite?" file)))) (user-error "%s exists")) (with-temp-buffer (set-buffer-multibyte nil) (insert image) (write-region (point-min) (point-max) file)) + (insert (format "\n" (file-relative-name file))) (insert-image (create-image file (mailcap-mime-type-to-extension type) nil :max-width 200 :max-height 200) - " ") - (insert (format "\n" (file-relative-name file))))) + " "))) (defvar html-imenu-regexp "\\s-*]*>\\(<[^\n<>]*>\\)*\\s-*\\([^\n<>]*\\)" -- 2.39.5