1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00

Make sgml-validate not bug out from buffers not visiting a file

* lisp/textmodes/sgml-mode.el (sgml-validate): Don't bug out when
running from a buffer that's not visiting a file (bug#22906).
This commit is contained in:
Lars Ingebrigtsen 2020-09-15 18:11:28 +02:00
parent c07ec3f43e
commit eeae97282e

View File

@ -1188,10 +1188,9 @@ and move to the line in the SGML document that caused it."
(or sgml-saved-validate-command
(concat sgml-validate-command
" "
(shell-quote-argument
(let ((name (buffer-file-name)))
(and name
(file-name-nondirectory name)))))))))
(when-let ((name (buffer-file-name)))
(shell-quote-argument
(file-name-nondirectory name))))))))
(setq sgml-saved-validate-command command)
(save-some-buffers (not compilation-ask-about-save) nil)
(compilation-start command))