* lisp/textmodes/sgml-mode.el (sgml-validate): Don't bug out when
running from a buffer that's not visiting a file (bug#22906).
(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))