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: Mon, 09 May 2022 18:49:02 -0700 Message-ID: <87ilqerwc1.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> <871qx4lvgl.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="36504"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.36 Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org, 55257@debbugs.gnu.org, Robert Pluim , Eli Zaretskii To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 10 03:49:58 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 1noF0f-0009Ft-TA for ged-emacs-devel@m.gmane-mx.org; Tue, 10 May 2022 03:49:58 +0200 Original-Received: from localhost ([::1]:45044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1noF0e-00028w-PL for ged-emacs-devel@m.gmane-mx.org; Mon, 09 May 2022 21:49:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noEzr-0001S6-E0 for emacs-devel@gnu.org; Mon, 09 May 2022 21:49:07 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55465) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noEzp-00025P-Ik; Mon, 09 May 2022 21:49:07 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 970535C0198; Mon, 9 May 2022 21:49:04 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 09 May 2022 21:49:04 -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=1652147344; x=1652233744; bh=CM f1evKqb0Lu72DGHV+HaFR6tfF8LN3Oo31g4fAhxx8=; b=PuCl0t7o05+LuZEuIy QTkWttznj+RIQzuJSW0fkTpMkzroadeJtIdWBYigjvhs+2D0cUL8we6Fpbi77/3a a3A8ZoLfuAeUID5XLmIQN0UyDl1mqbo3ZoqGS8RcHseNV0OfqwBAItZxr2mSaTA3 wXyxvtOishK498XQTQN8F3CIX4hwaqXJC6L6in4XZrS2VHuNClxLLe/sMwefsbk5 U9EvR8U2cVg0mdRaW6u0m3MIYGgT5weRJ8tPlGh8dHI7MNxeb5rjPsnM/ZTDNEuR jABzsPbhsHtD/iqYgRc1l99UVBnbcHpfOnfEBvO6AaqXDXlZtLlNejHLRmy8YkjB VVDQ== 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=1652147344; x= 1652233744; bh=CMf1evKqb0Lu72DGHV+HaFR6tfF8LN3Oo31g4fAhxx8=; b=w 9ZrLifugVPHlMKFd9JlWkNGlHbB4rh+nGuv9IhypUNYJ6GTlfgtpQyRUyN1n6p+j haqUb6D80K8DqVC0Xbt/+XAWLN+NdaFQlrhxC/5mT73EfPfibC1s3SRVHzOXu7WD I1E9jkVAFWpqE9al5HrdHkJUFL9L2d15ZoVRinyYcoGs47cU34xWX8aaGSWTR/Bn qgCBCkPglHfh4EmG2zYoMnip2bYdtdPdTDZBSgJmmItbhhtW2F3fqolYwIFmxvrx nawmq9hYMKfXdYUdateEsm0ED0n14PWTrGXxaQQ9UyuCgVTPTQ4Npyv6cravAJOM HIHB5Ke0UCUoyOyR5JrbQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrgedtgdehtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhepvdejtedtieetjeegjeekgffghedtkeeltdeftdetkefgueek fedtudfhteeljeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 May 2022 21:49:04 -0400 (EDT) Original-Received: by athena.silentflame.com (Postfix, from userid 1000) id CDD451BA78C; Tue, 10 May 2022 01:49:02 +0000 (UTC) In-Reply-To: Received-SPF: pass client-ip=66.111.4.25; envelope-from=spwhitton@spwhitton.name; helo=out1-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:289562 Archived-At: Hello, On Mon 09 May 2022 at 02:11pm -04, Stefan Monnier wrote: > I know you didn't like my `scratch-buffer--create` suggestion because of > the double dash, but I think at least "scratch" would be very welcome in it. I've done s/initial/scratch/ which is better because this function always uses *scratch* rather than, say, looking at initial-buffer-choice. > Now that I look at it again, it occurs to me that maybe we should do > something like: > > (defun scratch-buffer (&optional display) > "Create the \*scratch\* buffer. > If the buffer doesn't exist, create it first. > If DISPLAY (or when used interactively), switch to it." > (interactive (list t)) > (let ((buf (get-buffer "*scratch*"))) > (unless buf > ;; Don't touch the buffer contents or mode unless we know that > ;; we just created it. > (with-current-buffer (setq buf (get-buffer-create "*scratch*")) > (when initial-scratch-message > (insert (substitute-command-keys initial-scratch-message)) > (set-buffer-modified-p nil)) > (funcall initial-major-mode))) > (when display (pop-to-buffer-same-window buf)) > buf)) > > i.e. combine the new function with the existing command, so we don't > need to come up with a new name. Nice idea, but I'd argue for keeping them separate. I find it more natural to distinguish functions called for their return values and commands. -- Sean Whitton