diff options
| author | Lars Ingebrigtsen | 2020-09-15 18:11:28 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-09-15 18:13:14 +0200 |
| commit | eeae97282e245c82c470557d76a252a833aed5d5 (patch) | |
| tree | 6624f377e1a6eac1fdac563054b2c41503c86bcd | |
| parent | c07ec3f43ef3a43af24a48ab337341fc59f40971 (diff) | |
| download | emacs-eeae97282e245c82c470557d76a252a833aed5d5.tar.gz emacs-eeae97282e245c82c470557d76a252a833aed5d5.zip | |
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).
| -rw-r--r-- | lisp/textmodes/sgml-mode.el | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index e0ef786953e..f3d8695e248 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el | |||
| @@ -1188,10 +1188,9 @@ and move to the line in the SGML document that caused it." | |||
| 1188 | (or sgml-saved-validate-command | 1188 | (or sgml-saved-validate-command |
| 1189 | (concat sgml-validate-command | 1189 | (concat sgml-validate-command |
| 1190 | " " | 1190 | " " |
| 1191 | (shell-quote-argument | 1191 | (when-let ((name (buffer-file-name))) |
| 1192 | (let ((name (buffer-file-name))) | 1192 | (shell-quote-argument |
| 1193 | (and name | 1193 | (file-name-nondirectory name)))))))) |
| 1194 | (file-name-nondirectory name))))))))) | ||
| 1195 | (setq sgml-saved-validate-command command) | 1194 | (setq sgml-saved-validate-command command) |
| 1196 | (save-some-buffers (not compilation-ask-about-save) nil) | 1195 | (save-some-buffers (not compilation-ask-about-save) nil) |
| 1197 | (compilation-start command)) | 1196 | (compilation-start command)) |