From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.devel Subject: Re: master f2d2fe6fc8: server-execute: Initialize the *scratch* buffer Date: Fri, 06 May 2022 12:20:11 -0700 Message-ID: <874k22eadw.fsf@athena.silentflame.com> References: <165162665935.26821.8964921720746152690@vcs2.savannah.gnu.org> <20220504011059.9F667C009A8@vcs2.savannah.gnu.org> <87levhdfeh.fsf@athena.silentflame.com> <87y1zhe5qz.fsf@athena.silentflame.com> <87levhe24h.fsf@athena.silentflame.com> <871qx74or6.fsf@melete.silentflame.com> <87y1zf39x7.fsf@melete.silentflame.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11072"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.36 Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Robert Pluim , emacs-devel@gnu.org, 55257-submitter@debbugs.gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 06 21:20:59 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 1nn3VZ-0002fZ-Ot for ged-emacs-devel@m.gmane-mx.org; Fri, 06 May 2022 21:20:59 +0200 Original-Received: from localhost ([::1]:56812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nn3VY-0000El-DB for ged-emacs-devel@m.gmane-mx.org; Fri, 06 May 2022 15:20:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nn3Uu-0007zE-Lq for emacs-devel@gnu.org; Fri, 06 May 2022 15:20:16 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:35041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nn3Us-0008TJ-So for emacs-devel@gnu.org; Fri, 06 May 2022 15:20:16 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 1D1525C0075; Fri, 6 May 2022 15:20:14 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 06 May 2022 15:20:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1651864814; x=1651951214; bh=m6 qq2HypqBmtVSxFHKZ+ujG3owY991/l+wKaXg+ttvw=; b=hA76BwdFOaERNlgZ06 CB6Qb8kilvLw8nSOPhyPvEiGyIeRzsnLEjZ6AqIQ2YqTeURN+1PA1exyMliUWceT nS+VgbUaxgouzsmla0wVVwGOcbusJVybHEjY2R1ejPnzX6yslxRatV6y7mOnwDbj rsTP5sBZcnW6tJ50BfNqpY3iwtiuDjXFREVpc+O6NZB0aSSVm96srsTf12aSCeH5 zHHRDj2DumFJMhhqVlj2ZlW5VjnE85Y54IZSOKkQDK+UsOee7bQq5J+rnetatywX 3V5HlIF+dPObB7ubXX8Wv6bcaGJHkwkfkHoAgLVWy0wwlOfdz8+KDczuNPRpSznT SUkA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1651864814; x= 1651951214; bh=m6qq2HypqBmtVSxFHKZ+ujG3owY991/l+wKaXg+ttvw=; b=p xcYI1wAMK8ucUlIDD71ceMBKr+h6iAZRAjkkR9kmaYWDRGRfVxVxcwX9cP2lN+gi OwFOqG0JBS17UnIV/J1TkaAEBkEmeeKdq6Iovf53pWrB5sdnJS5rlaJxt+FP7Yy/ y8VUeJ2ZvM476KgkpnYh09P90lCA7o49tTX+JynrJyH770UDCmiYo59kaVdB36l+ xZNpYcIjgAS0aW/Mr/AP0btDRUNc+uSmF7Gsr2uYjCElJu2Y8oosR0n9hTpyy1gd iFP2WYo+QVGIinKeyey0ipBAvV+G9gope5i5baOfbF832VgAfW48/+0UNkgZCyk0 AurzrIpTKsEEqE5M1rl9g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeefgddufeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffgffkfggtgesthdttddttdertdenucfhrhhomhepufgvrghn ucghhhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpedvjeettdeiteejgeejkefggfehtdekledtfedtteekgfeu keeftdduhfetleejkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 6 May 2022 15:20:13 -0400 (EDT) Original-Received: by athena.silentflame.com (Postfix, from userid 1000) id B6BFC1C0503; Fri, 6 May 2022 19:20:11 +0000 (UTC) In-Reply-To: Received-SPF: pass client-ip=66.111.4.28; envelope-from=spwhitton@spwhitton.name; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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" Xref: news.gmane.io gmane.emacs.devel:289336 Archived-At: Hello Stefan, On Fri 06 May 2022 at 07:34am -04, Stefan Monnier wrote: >> + (if-let ((scratch (get-buffer "*scratch*"))) >> + scratch > > A.k.a > > (or (get-buffer "*scratch*") Ah yes. >> (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`? It gets called in places like server.el, though. And I can imagine wanting to use it in third party code as a better version of (get-buffer-create "*scratch"*). So it seems to me not to be internal. -- Sean Whitton