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.bugs Subject: bug#55257: master f2d2fe6fc8: server-execute: Initialize the *scratch* buffer Date: Mon, 09 May 2022 18:49:02 -0700 Message-ID: <87ilqerwc1.fsf__14413.5344585933$1652147422$gmane$org@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="37582"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.36 Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Robert Pluim , 55257@debbugs.gnu.org, Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 10 03:50:14 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1noF0u-0009aX-OQ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 May 2022 03:50:13 +0200 Original-Received: from localhost ([::1]:45522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1noF0t-0002SC-AK for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 May 2022 21:50:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noF0k-0002Py-TO for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 21:50:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37672) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1noF0k-0002AV-JL for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 21:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1noF0k-0007LJ-GT for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 21:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 May 2022 01:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55257 X-GNU-PR-Package: emacs Original-Received: via spool by 55257-submit@debbugs.gnu.org id=B55257.165214736328172 (code B ref 55257); Tue, 10 May 2022 01:50:02 +0000 Original-Received: (at 55257) by debbugs.gnu.org; 10 May 2022 01:49:23 +0000 Original-Received: from localhost ([127.0.0.1]:59802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1noF06-0007KK-RB for submit@debbugs.gnu.org; Mon, 09 May 2022 21:49:23 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:59447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1noEzt-0007Jo-Nk for 55257@debbugs.gnu.org; Mon, 09 May 2022 21:49:22 -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: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:231793 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