all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Akib Azmain Turja <akib@disroot.org>
Cc: emacs-devel@gnu.org
Subject: Re: When was the function 'get-scratch-buffer-create' introduced?
Date: Mon, 12 Dec 2022 19:51:31 +0000	[thread overview]
Message-ID: <871qp4tn7g.fsf@posteo.net> (raw)
In-Reply-To: <87zgbs7vxg.fsf@disroot.org> (Akib Azmain Turja's message of "Mon, 12 Dec 2022 16:34:03 +0600")

Akib Azmain Turja <akib@disroot.org> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Akib Azmain Turja <akib@disroot.org> writes:
>>
>>> On Emacs 28, 'get-scratch-buffer-create' seems to be undefined.  But
>>> there is no NEWS entry about introducing 'get-scratch-buffer-create'.
>>>
>>> When was this function introduced?
>>>
>>> [ Originally reported by cgenie at Workroom Codeberg repo.
>>>   https://codeberg.org/akib/emacs-workroom/issues/1 ]
>>
>> This seems to have been the first commit:
>>
>> commit 054062060e9f57fd037578378c23ad9ec294edac
>> Author: Sean Whitton <spwhitton@spwhitton.name>
>> Date:   Thu May 5 13:03:06 2022 -0700
>>
>>     Factor out *scratch* initialization
>>     
>>     * lisp/simple.el (get-scratch-buffer-create): New function,
>> factored
>>     out of scratch-buffer, and additionally clearing the
>> modification flag
>>     and calling substitute-command-keys (bug#55257).
>>     (scratch-buffer):
>>     * lisp/server.el (server-execute):
>>     * lisp/startup.el (normal-no-mouse-startup-screen, command-line-1):
>>     * lisp/window.el (last-buffer,
>> window-normalize-buffer-to-switch-to):
>>     * src/buffer.c (Fother_buffer, other_buffer_safely): Use it.
>>     (syms_of_buffer): Add Qget_scratch_buffer_create.
>>     * lisp/startup.el (startup--get-buffer-create-scratch): Delete
>>     now-unused function.
>>     * doc/lispref/os.texi (Summary: Sequence of Actions at Startup):
>>     * NEWS (Incompatible changes in Emacs 29.1): Document the change.
>>
>> diff --git a/lisp/simple.el b/lisp/simple.el
>> --- a/lisp/simple.el
>> +++ b/lisp/simple.el
>> @@ -10216,0 +10216,12 @@
>> +(defun get-scratch-buffer-create ()
>> +  "Return the \*scratch\* buffer, creating a new one if needed."
>> +  (or (get-buffer "*scratch*")
>> +      (let ((scratch (get-buffer-create "*scratch*")))
>> +        ;; Don't touch the buffer contents or mode unless we know that
>> +        ;; we just created it.
>> +        (with-current-buffer scratch
>> +          (when initial-scratch-message
>> +            (insert (substitute-command-keys initial-scratch-message))
>> +            (set-buffer-modified-p nil))
>> +          (funcall initial-major-mode))
>> +        scratch)))
>>
>> So it is part of Emacs 29.
>>
>
> Thanks!

What are you using the function for?  Would it make sense adding it to
Compat?



  reply	other threads:[~2022-12-12 19:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12  5:26 When was the function 'get-scratch-buffer-create' introduced? Akib Azmain Turja
2022-12-12  8:17 ` Philip Kaludercic
2022-12-12 10:34   ` Akib Azmain Turja
2022-12-12 19:51     ` Philip Kaludercic [this message]
2022-12-12  8:18 ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871qp4tn7g.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=akib@disroot.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.