From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master f2d2fe6fc8: server-execute: Initialize the *scratch* buffer Date: Sat, 07 May 2022 17:12:45 +0300 Message-ID: <83r155xwgy.fsf@gnu.org> 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> <83r1571an1.fsf@gnu.org> <871qx6ea2x.fsf@athena.silentflame.com> <83tua1zz8h.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8227"; mail-complaints-to="usenet@ciao.gmane.io" Cc: spwhitton@spwhitton.name, rpluim@gmail.com, 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 Sat May 07 16:14:04 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 1nnLC7-0001u0-SC for ged-emacs-devel@m.gmane-mx.org; Sat, 07 May 2022 16:14:04 +0200 Original-Received: from localhost ([::1]:35584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnLC6-0005Qj-MH for ged-emacs-devel@m.gmane-mx.org; Sat, 07 May 2022 10:14:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnLB2-0004aQ-4S for emacs-devel@gnu.org; Sat, 07 May 2022 10:12:56 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39662) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnLB1-0003ZW-Fh; Sat, 07 May 2022 10:12:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Ozo/MbugOepo3a2Pr1JgF+339mfVASXatD2syQiP38M=; b=oOhK+zSqYieZ FVkLi33sZM4uEesKpzGY5fDd2mea0e3hWk60565mVblMZWL9RihNbOCcUTgX5Dxz8emA2gES7DU2M S6qqCkus47IsvIyqdOu+2FLT6f/4kKxYBWozp8FIZuKkMMPiEI4yZUoRuVzMJclyjkbCV0Hlb/+nZ 5Shp/5hn1PSt8wduWy8d6Jp6qXTL77SBIHI66Ujuwl0cGvZSPiFCO4quoO0pxarvzSvJquexcJbgb NhrDqbfCH2mYS2DaajwTcVa+S/jDOavbk6rIa8j/jG68qZLUs7gCr/Ok3kVywljwLc2VvcciT+D8C QCbtevltzYiwYB8d5eSBrg==; Original-Received: from [87.69.77.57] (port=2767 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnLB0-00071e-V6; Sat, 07 May 2022 10:12:55 -0400 In-Reply-To: (message from Stefan Monnier on Sat, 07 May 2022 09:51:54 -0400) 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:289393 Archived-At: > From: Stefan Monnier > Cc: Sean Whitton , rpluim@gmail.com, > emacs-devel@gnu.org, 55257-submitter@debbugs.gnu.org > Date: Sat, 07 May 2022 09:51:54 -0400 > > > Doesn't get-buffer already "touch" the buffer if it exists? > > And determining whether the buffer has any stuff in it (if this is the > > concern here) is just one function call away, and is very fast. > > Not sure what it is we'd be gaining. We will gain that I won't raise my brow and won't want to change that code each time my eyes fall on it. > > My bother is that the function you call could signal an error at some > > point, and that could cause trouble to some of the callers, perhaps. > > Calling Lisp from C should always assume this could happen, because > > basically the Lisp function you call is out of your control, and you > > cannot reliably assume anything about what it does or will do at some > > future time. > > I think this is not needed here, or at least we haven't needed it so > far: the old C code called `Fset_buffer_major_mode` which itself > calls `call0 (function);` where `function` is the `initial-major-mode`. We have recently learned that these calls are not safe enough, so I think using safe_call's family here will be more future-proof, as more and more code is moved to Lisp and more and more hooks are bing added. So I'm still unconvinced, and would like this code to be safer.