From: Lars Ingebrigtsen Date: Mon, 8 Nov 2021 05:04:11 +0000 (+0100) Subject: Make html-mode--html-yank-handler more resilient X-Git-Tag: emacs-29.0.90~3671^2~80 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a460f3d378f52e8a09441455be764eec595a3314;p=emacs.git Make html-mode--html-yank-handler more resilient * lisp/textmodes/sgml-mode.el (html-mode--html-yank-handler): The HTML may not be valid, so suppress errors. --- diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 3b0c5d8b65c..dedc3882199 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -2435,7 +2435,8 @@ To work around that, do: (defun html-mode--html-yank-handler (_type html) (save-restriction (insert html) - (sgml-pretty-print (point-min) (point-max)))) + (ignore-errors + (sgml-pretty-print (point-min) (point-max))))) (defun html-mode--image-yank-handler (type image) (let ((file (read-file-name (format "Save %s image to: " type))))