GNU bug report logs - #55257
29.0.50; New command `scratch-buffer' inconsistent with startup

Previous Next

Package: emacs;

Reported by: David Ponce <da_vid <at> orange.fr>

Date: Wed, 4 May 2022 08:33:02 UTC

Severity: normal

Found in version 29.0.50

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: Robert Pluim <rpluim <at> gmail.com>, 55257-submitter <at> debbugs.gnu.org, emacs-devel <at> gnu.org
Subject: bug#55257: master f2d2fe6fc8: server-execute: Initialize the *scratch* buffer
Date: Fri, 06 May 2022 07:34:40 -0400
> +  (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





This bug report was last modified 3 years and 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.