Improve error messages regarding initial-buffer-choice (Bug#29098)

* lisp/startup.el (command-line-1) <initial-buffer-choice>: Make the
messages conform to Emacs conventions, and show the invalid return
value in the message.
This commit is contained in:
Alexander Gramiak 2017-10-31 21:10:52 -06:00 committed by Noam Postavsky
parent 00fb127031
commit 96be6b6eb9

View file

@ -2515,9 +2515,9 @@ nil default-directory" name)
((eq initial-buffer-choice t)
(get-buffer-create "*scratch*"))
(t
(error "initial-buffer-choice must be a string, a function, or t.")))))
(error "`initial-buffer-choice' must be a string, a function, or t")))))
(unless (buffer-live-p buf)
(error "initial-buffer-choice is not a live buffer."))
(error "Value returned by `initial-buffer-choice' is not a live buffer: %S" buf))
(setq displayable-buffers (cons buf displayable-buffers))))
;; Display the first two buffers in `displayable-buffers'. If