Mention newcomers theme on 'normal-mouse-startup-screen'

* lisp/startup.el (startup-insert-newcomers-theme): Factor out
new function from 'normal-no-mouse-startup-screen'.
(normal-mouse-startup-screen, normal-no-mouse-startup-screen):
Call new function.
This commit is contained in:
Philip Kaludercic
2026-03-08 13:19:34 +01:00
parent d6fa21c1f5
commit a3dda7e525

View File

@@ -2438,6 +2438,30 @@ splash screen in another window."
(display-buffer splash-buffer)
(switch-to-buffer splash-buffer))))
(defun startup-insert-newcomers-theme ()
"Insert information about `newcomers-presets' theme at point."
(insert "New to Emacs? Consider enabling ")
(insert-button "newcomer presets"
'action (lambda (_button)
(info "(emacs) Newcomers Theme"))
'follow-link t)
(insert ": ")
(insert-button (if (custom-theme-enabled-p 'newcomers-presets)
"Disable"
"Enable")
'action (lambda (button)
(let ((inhibit-read-only t))
(replace-region-contents
(button-start button)
(button-end button)
(pcase (button-label button)
("Enable"
(load-theme 'newcomers-presets)
"Disable")
("Disable"
(disable-theme 'newcomers-presets)
"Enable")))))))
(defun normal-mouse-startup-screen ()
;; The user can use the mouse to activate menus
;; so give help in terms of menu items.
@@ -2482,6 +2506,8 @@ To quit a partially entered command, type Control-g.\n")
'follow-link t)
(insert "\tChange initialization settings including this screen\n")
(startup-insert-newcomers-theme)
(save-restriction
(narrow-to-region (point) (point))
(insert "\n" (emacs-version) "\n")
@@ -2567,27 +2593,7 @@ If you have no Meta key, you may instead type ESC followed by the character.)"))
'follow-link t)
(insert "\n")
(insert "New to Emacs? Consider enabling ")
(insert-button "newcomer presets"
'action (lambda (_button)
(info "(emacs) Newcomers Theme"))
'follow-link t)
(insert ": ")
(insert-button (if (custom-theme-enabled-p 'newcomers-presets)
"Disable"
"Enable")
'action (lambda (button)
(let ((inhibit-read-only t))
(replace-region-contents
(button-start button)
(button-end button)
(pcase (button-label button)
("Enable"
(load-theme 'newcomers-presets)
"Disable")
("Disable"
(disable-theme 'newcomers-presets)
"Enable"))))))
(startup-insert-newcomers-theme)
(insert "\n")