functions: Fix ambrevar/test-emacs on custom init files
parent
053c5627bd
commit
d350755dc8
|
@ -274,9 +274,13 @@ 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)
|
||||
(let ((output
|
||||
(shell-command-to-string
|
||||
(format "emacs --batch --eval \"
|
||||
(if (not user-init-file)
|
||||
(progn
|
||||
(message "No init file")
|
||||
t)
|
||||
(let ((output
|
||||
(shell-command-to-string
|
||||
(format "emacs --batch --eval \"
|
||||
(condition-case e
|
||||
(progn
|
||||
(load \\\"%s\\\")
|
||||
|
@ -284,17 +288,17 @@ Works on whole buffer if region is unactive."
|
|||
(error
|
||||
(message \\\"ERROR:\\\")
|
||||
(signal (car e) (cdr e))))\""
|
||||
user-init-file))))
|
||||
(if (string-match "-OK-" output)
|
||||
(progn
|
||||
(when (called-interactively-p 'any)
|
||||
(message "All is well"))
|
||||
t)
|
||||
(switch-to-buffer-other-window "*init file error*")
|
||||
(erase-buffer)
|
||||
(insert output)
|
||||
(search-backward "ERROR:")
|
||||
nil)))
|
||||
user-init-file))))
|
||||
(if (string-match "-OK-" output)
|
||||
(progn
|
||||
(when (called-interactively-p 'any)
|
||||
(message "All is well"))
|
||||
t)
|
||||
(switch-to-buffer-other-window "*init file error*")
|
||||
(erase-buffer)
|
||||
(insert output)
|
||||
(search-backward "ERROR:")
|
||||
nil))))
|
||||
(add-hook 'kill-emacs-query-functions 'ambrevar/test-emacs)
|
||||
|
||||
;;; TODO: Store window configurations in a buffer-name-indexed alist? Not
|
||||
|
|
Loading…
Reference in New Issue