emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master f2d2fe6fc8: server-execute: Initialize the *scratch* buffer


From: Stefan Monnier
Subject: Re: master f2d2fe6fc8: server-execute: Initialize the *scratch* buffer
Date: Fri, 06 May 2022 07:34:40 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> +  (if-let ((scratch (get-buffer "*scratch*")))
> +      scratch

A.k.a

     (or (get-buffer "*scratch*")

>  (defun scratch-buffer ()
>    "Switch to the \*scratch\* buffer.
>  If the buffer doesn't exist, create it first."
>    (interactive)
> -  (if (get-buffer "*scratch*")
> -      (pop-to-buffer-same-window "*scratch*")
> -    (pop-to-buffer-same-window (get-buffer-create "*scratch*"))
> -    (when initial-scratch-message
> -      (insert initial-scratch-message))
> -    (funcall initial-major-mode)))
> +  (pop-to-buffer-same-window (get-initial-buffer-create)))

I think the new function can be considered "internal", and I think it
would be better for its name to use "scratch-buffer" as a prefix, so
maybe `scratch-buffer--create`?

Other than that, it looks good to me, thank you very much.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]