checking if (buffer-file-name) returns non-nil just in case.

This commit is contained in:
Kazu Yamamoto 2015-08-14 16:38:49 +09:00
parent 1c19d91813
commit 90061facb9
1 changed files with 2 additions and 1 deletions

View File

@ -65,7 +65,8 @@ nil does not display errors/warnings.
(defun ghc-check-syntax ()
(interactive)
;; Only check syntax of visible buffers
(when (and (file-exists-p (buffer-file-name))
(when (and (buffer-file-name)
(file-exists-p (buffer-file-name))
(get-buffer-window (current-buffer) t))
(with-timeout
(10 (error "ghc process may have hung or exited with an error"))