functions: Fix ambrevar/test-emacs on custom init files

master
Pierre Neidhardt 2019-03-05 17:08:19 +01:00
parent 053c5627bd
commit d350755dc8
1 changed files with 18 additions and 14 deletions

View File

@ -274,6 +274,10 @@ Works on whole buffer if region is unactive."
"Return nil on error, t on success so that it can be added to
`kill-emacs-query-functions'."
(interactive)
(if (not user-init-file)
(progn
(message "No init file")
t)
(let ((output
(shell-command-to-string
(format "emacs --batch --eval \"
@ -294,7 +298,7 @@ Works on whole buffer if region is unactive."
(erase-buffer)
(insert output)
(search-backward "ERROR:")
nil)))
nil))))
(add-hook 'kill-emacs-query-functions 'ambrevar/test-emacs)
;;; TODO: Store window configurations in a buffer-name-indexed alist? Not