emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master eeae972: Make sgml-validate not bug out from buffers not visiting


From: Lars Ingebrigtsen
Subject: master eeae972: Make sgml-validate not bug out from buffers not visiting a file
Date: Tue, 15 Sep 2020 12:13:21 -0400 (EDT)

branch: master
commit eeae97282e245c82c470557d76a252a833aed5d5
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/textmodes/sgml-mode.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index e0ef786..f3d8695 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."
                      (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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]