I want to use the scratch buffer to display some status informations after starting emacs. I read I can use initial-scratch-message
variable for this.
But I do not know how to set it up.
Here you see a function(?) that gives back the start-up-time as a string. And with emacs-startup-hook
it is well displayed in the statusbar. But the same with initial-scratch-message
it does not work. I tried `display-graphic-p' too.
And how would I append informations/values to that variable instead of just overwriting it?
;; === Print start-time after start
; from https://github.com/daviwil/emacs-from-scratch/blob/master/show-notes/Emacs-Scratch-12.org
(defun efs/display-startup-time ()
(message "Emacs loaded in %s with %d garbage collections."
(format "%.2f seconds"
(float-time
(time-subtract after-init-time before-init-time)))
gcs-done))
(add-hook 'emacs-startup-hook #'efs/display-startup-time)
(initial-scratch-message #'efs/display-startup-time)
; this does not work also (wront type argument stringp)
; (setq initial-scratch-message #'efs/display-startup-time)
(initial-scratch-message display-graphic-p)
; Would prefere this (Python-Lisp-Pseudo-Code)
;(initial-scratch-message 'display-graphic-p is "{}".format(display-graphic-p))
initial-scratch-message
is a variable, not a function. So you should usesetq
or similar.