From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akib Azmain Turja Newsgroups: gmane.emacs.devel Subject: Re: When was the function 'get-scratch-buffer-create' introduced? Date: Mon, 12 Dec 2022 16:34:03 +0600 Message-ID: <87zgbs7vxg.fsf@disroot.org> References: <87zgbtb3ad.fsf@disroot.org> <87h6y1t4r4.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27204"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 12 20:40:56 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p4ofY-0006s3-5Z for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Dec 2022 20:40:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4of1-00046T-2h; Mon, 12 Dec 2022 14:40:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4oez-00046I-2z for emacs-devel@gnu.org; Mon, 12 Dec 2022 14:40:21 -0500 Original-Received: from knopi.disroot.org ([178.21.23.139]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4oer-0000o1-CR for emacs-devel@gnu.org; Mon, 12 Dec 2022 14:40:16 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 8554D40A23; Mon, 12 Dec 2022 20:40:09 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z6TPo20Do-v0; Mon, 12 Dec 2022 20:40:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1670874007; bh=cP8eE0/Sr7GG2mbIdGcmp62pI4XHTJI2KhjK8PHv3cw=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=WkJmnNFnsbtMH/66X3aC7wF2EmSC38Mu5l++fl0Rl5+aV1zr74yqIPsHT64Xrd3hh 6PqQuj4jegy6QeGEouCR7E4ptrkG67tWQBjgwhC3Tg5+1B5QxyXU/SHnrFwkD5CqVo r8YyDsOOimG6/hnFRKZKbmdq6M6lKL16QOdSSfMcxCR8/Wxd+V/XrVIwGPz9mHfkgM zGEND4KbBUJTLqMm9hgFdiDQNETl80JxRfqu+euUYzCBBhDt01B5NC4Msl4ePqSoU8 c1WjwiqoYHls6B/flOdBduoBKWhb9Eq841L7efry7Bn76DruPiO8IHVV3K9Ro57s35 inOYiTApBDYhg== In-Reply-To: <87h6y1t4r4.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 12 Dec 2022 08:17:51 +0000") Received-SPF: pass client-ip=178.21.23.139; envelope-from=akib@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_06_12=1.543, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:301275 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Philip Kaludercic writes: > Akib Azmain Turja 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 > Date: Thu May 5 13:03:06 2022 -0700 > > Factor out *scratch* initialization >=20=20=20=20=20 > * 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! =2D-=20 Akib Azmain Turja, GPG key: 70018CE5819F17A3BBA666AFE74F0EFA922AE7F5 Fediverse: akib@hostux.social Codeberg: akib emailselfdefense.fsf.org | "Nothing can be secure without encryption." --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmOXA5wACgkQVTX89U2I YWvq+w/8DXR0zKEYKJOhqIEwXVkNOOXB3CENXZcRxCAWigZTI31ZDKrq88+oUK25 NkxHmlTzcM/tHFVDha5KMQifWnwOQWOpyhSMg+oNVdefZfpSu+kq/mCK4CEam8+H B41iBqUwqxJ5RgK1ePgvvzUe2kL1IjeqsJcgYbD7Y+gVDYB6Aof4bLHKplkgoWUs sB7kd/BLmcqMPVI/vrqr9LiTD01v1omqegTvmy+L2TD8OQeaJG8Xxqv1m85ZBrxL iQJ+9qUXJf1DTDVZAoX1GyNHLBmpdHawcRNHAG/fCrPupVnOadMVPVouAQPKSp4n 3Mxv+BAXEGLz+gUAMun4XXsUbPKDwBoLPKMkKU7qlgIWd1/Qh5bm8ZhAU1Etke/f S4g12/5h+nkNxaMX9pjlzbv5J+VyruXb0+aYDfMdu4Pl7nkK5qbIzv6V7+YAgY9T Oo5T7x3EnA86zAYp5gStOHaQt819EejNbOOitHCwbfFYAoVWtvQm0tFOI0SFV/M+ c3vlUUQcjDv2R9Rey8K4N0Rk0NJjKN6TvQa2+edxyFR/eqKS0t6U6V2wMrPKo6CK YzP+8WsGufzp1GIE5PvOICwceawyL0x7R0rb/z+9xA8zFK5vEs1KmWHD0nXWacae SRE6Ps6EhZSd6uq1oaZuBlDxmyKD/dyK9Uihlbw7TXOFqjrQ21U= =30cw -----END PGP SIGNATURE----- --=-=-=--