From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master f2d2fe6fc8: server-execute: Initialize the *scratch* buffer Date: Fri, 06 May 2022 07:34:40 -0400 Message-ID: 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="23790"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Robert Pluim , emacs-devel@gnu.org, 55257-submitter@debbugs.gnu.org To: Sean Whitton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 06 13:38:45 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 1nmwIG-0005xS-8y for ged-emacs-devel@m.gmane-mx.org; Fri, 06 May 2022 13:38:44 +0200 Original-Received: from localhost ([::1]:35356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmwIF-00031j-1L for ged-emacs-devel@m.gmane-mx.org; Fri, 06 May 2022 07:38:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmwER-0001KW-Nt for emacs-devel@gnu.org; Fri, 06 May 2022 07:34:47 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmwEO-0005zJ-TF for emacs-devel@gnu.org; Fri, 06 May 2022 07:34:46 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3D9A9440F2E; Fri, 6 May 2022 07:34:43 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EA7574407CA; Fri, 6 May 2022 07:34:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1651836881; bh=mKNt7dnHw9iiil19W1B8pIw4ZLjBCX8zJ1WfBd6raTo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Fy2+F2/vXVWdzfU7p5FFg+7LxHREerkKRgTw3pkYrkKiJn8+GRit7wsyDFeF+NX7Q q0Xc231RtSksWRoqjBUKGW/yTCgLMJjg2JLSgI/OcSgP4oTo/oYQvCz74BClAB2T/P Lmatp3xcUB6vsPxhwznEpBh1wW79DdngHKVrgtqxi1T+adx/SZofeVUDHOhSPwpeYn RXVfOsKCIJMY1xgt6riKlmNrZK8IklYlveT4gT84D86bTZ6qw1hCqsDYrowFKFva5g PMO1IPyZbFXdTNH51/HeiPDzlG02GQPV7SrwSW6105grxG45nMI4oAX2FEx9+xiJJL 6ROLuzU2A3ZUg== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6A68012023B; Fri, 6 May 2022 07:34:41 -0400 (EDT) In-Reply-To: <87y1zf39x7.fsf@melete.silentflame.com> (Sean Whitton's message of "Thu, 05 May 2022 15:13:24 -0700") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=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:289310 Archived-At: > + (if-let ((scratch (get-buffer "*scratch*"))) > + scratch A.k.a (or (get-buffer "*scratch*") > (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`? Other than that, it looks good to me, thank you very much. Stefan