Function: fancy-splash-head

fancy-splash-head is a byte-compiled function defined in startup.el.gz.

Signature

(fancy-splash-head)

Documentation

Insert the head part of the splash screen into the current buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/startup.el.gz
(defun fancy-splash-head ()
  "Insert the head part of the splash screen into the current buffer."
  (let* ((image-file (fancy-splash-image-file))
	 (img (create-image image-file))
	 (image-width (and img (car (image-size img))))
	 (window-width (window-width)))
    (when img
      (when (> window-width image-width)
        ;; Center the image above text.
        ;;  NB. The logo used to be centered in the window, which made
        ;;      it align poorly with the non-centered text on large
        ;;      displays.  Arguably it would be better to center both
        ;;      text and image, but this will do for now.  -- SK
        (let ((text-width 80)
              ;; The below value chosen to avoid splash screen being
              ;; visually unbalanced.  This needs to be eye-balled.
              (adjust-left 3))
          (insert (propertize " " 'display
                              `(space :align-to (+ ,(- (/ text-width 2)
                                                       adjust-left)
                                                   (-0.5 . ,img))))))

	;; Change the color of the XPM version of the splash image
	;; so that it is visible with a dark frame background.
	(when (and (memq 'xpm img)
		   (eq (frame-parameter nil 'background-mode) 'dark))
	  (setq img (append img '(:color-symbols (("#000000" . "gray30"))))))

	;; Insert the image with a help-echo and a link.
	(make-button (prog1 (point) (insert-image img)) (point)
		     'face 'default
		     'help-echo "mouse-2, RET: Browse https://www.gnu.org/"
		     'action (lambda (_button)
                               (let ((browse-url-browser-function 'eww-browse-url))
                                 (browse-url "https://www.gnu.org/")))
		     'follow-link t)
	(insert "\n\n")))))