unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: spwhitton@spwhitton.name, rpluim@gmail.com, emacs-devel@gnu.org,
	55257-submitter@debbugs.gnu.org
Subject: Re: master f2d2fe6fc8: server-execute: Initialize the *scratch* buffer
Date: Sat, 07 May 2022 17:12:45 +0300	[thread overview]
Message-ID: <83r155xwgy.fsf@gnu.org> (raw)
In-Reply-To: <jwvzgjth3ig.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Sat, 07 May 2022 09:51:54 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Sean Whitton <spwhitton@spwhitton.name>,  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.



  reply	other threads:[~2022-05-07 14:12 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <165162665935.26821.8964921720746152690@vcs2.savannah.gnu.org>
     [not found] ` <20220504011059.9F667C009A8@vcs2.savannah.gnu.org>
2022-05-04  2:14   ` master f2d2fe6fc8: server-execute: Initialize the *scratch* buffer Stefan Monnier
2022-05-04  5:40     ` Sean Whitton
2022-05-04 12:47       ` Stefan Monnier
2022-05-04 14:23         ` Sean Whitton
2022-05-04 14:34           ` Robert Pluim
2022-05-04 14:46             ` Sean Whitton
2022-05-04 14:56               ` Robert Pluim
2022-05-04 14:42           ` Stefan Monnier
2022-05-04 15:41             ` Sean Whitton
2022-05-04 16:26               ` Stefan Monnier
2022-05-05 22:07                 ` Sean Whitton
2022-05-05 22:13                   ` Sean Whitton
2022-05-06 11:34                     ` Stefan Monnier
2022-05-06 19:20                       ` Sean Whitton
2022-05-06 19:24                         ` Lars Ingebrigtsen
2022-05-06  5:40                   ` Eli Zaretskii
2022-05-06 19:26                     ` Sean Whitton
2022-05-07  5:30                       ` Eli Zaretskii
2022-05-07 13:51                         ` Stefan Monnier
2022-05-07 14:12                           ` Eli Zaretskii [this message]
2022-05-07 16:29                         ` Sean Whitton
2022-05-07 16:41                           ` Eli Zaretskii
2022-05-07 17:02                             ` Sean Whitton
2022-05-06  7:41                   ` Juri Linkov
2022-05-06 19:28                     ` Sean Whitton
2022-05-08  0:27                   ` bug#55257: " Sean Whitton
2022-05-09 18:11                     ` Stefan Monnier
2022-05-10  1:49                       ` Sean Whitton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83r155xwgy.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=55257-submitter@debbugs.gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rpluim@gmail.com \
    --cc=spwhitton@spwhitton.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).