all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: "Basil L. Contovounesios" <contovob@tcd.ie>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: Re: master f51f963: Fix some side-effecting uses of make-text-button
Date: Sun, 07 Jun 2020 09:21:17 +0000	[thread overview]
Message-ID: <87d06bxmcy.fsf@gmail.com> (raw)
In-Reply-To: <785d730e-23b2-dcad-105c-80ac5074b5dc@cs.ucla.edu> (Paul Eggert's message of "Sat, 6 Jun 2020 13:15:35 -0700")

Paul Eggert <eggert@cs.ucla.edu> writes:

> On 6/6/20 12:41 PM, Pip Cet wrote:
>
>> What I'm fighting against is a certain model of
>> immutability being installed into the Emacs source tree and effectively
>> preventing better ones from ever having a chance, as well as turning out
>> to be, as the vast majority of such models have, a problem rather than a
>> useful feature.
>
> I'm quite conscious of those dangers. What I had in mind was something
> far more
> limited: just supporting runtime checking of attempts to modify strings that
> either have undefined behavior if you mutate them now, or are close enough to
> that category so that nobody will care about the difference (except to
> be happy
> when Emacs catches unlikely glitches in their programs).

Okay, I'm looking forward to that proposal, and sorry for criticizing it
before I'd understood it clearly.

>> if we want that C API to be flexible enough to allow unusual
>> applications (and isn't that what Emacs is all about?), it needs
>> something more than just the obvious CHECK_MUTABLE (obj) macro.
>
> It sounds like you're thinking ahead to the non-string case.

I am.

> I'm
> limiting myself
> just to strings for now, as they're the most salient part of the problem (core
> dumps and all).

The core dumps definitely need to be fixed.

I still don't understand precisely how far you're planning to go in
protecting an immutable string's text properties, but you've convinced
me that it's a win in practice even if we just protect the characters.

> It should be OK to do that, and put off the
> more-general issues
> until later (if we ever do that at all).

So this would be only strings, not cons cells? That makes sense to me.

> The obvious check_string_mutable function doesn't need to be used very often:
> only in the places where CHECK_IMPURE is used on strings now. The only other
> primitive I've found the need for at the C level is freeze_string (to mark an
> already-constructed string as being a constant).

Just to be clear: there's no way to unfreeze a string, right? Because
that would add considerable complexity and not be worth it, IMHO.



  reply	other threads:[~2020-06-07  9:21 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200604223056.17078.81265@vcs0.savannah.gnu.org>
     [not found] ` <20200604223058.1850020A26@vcs0.savannah.gnu.org>
2020-06-04 22:44   ` master f51f963: Fix some side-effecting uses of make-text-button Stefan Monnier
2020-06-05  0:58     ` Paul Eggert
2020-06-05  9:27       ` Pip Cet
2020-06-05 10:51     ` Basil L. Contovounesios
2020-06-05 12:46       ` Pip Cet
2020-06-05 13:51         ` Basil L. Contovounesios
2020-06-05 14:31           ` Pip Cet
2020-06-05 15:48             ` Basil L. Contovounesios
2020-06-05 18:17         ` Paul Eggert
2020-06-06  8:18           ` Pip Cet
2020-06-06 16:57             ` Drew Adams
2020-06-06 17:57               ` Stefan Monnier
2020-06-06 19:00                 ` Pip Cet
2020-06-06 19:49                   ` Paul Eggert
2020-06-06 20:23                     ` Drew Adams
2020-06-07  9:14                     ` Pip Cet
2020-06-06 22:14                   ` Stefan Monnier
2020-06-07  1:40                     ` Paul Eggert
2020-06-07 15:24                       ` Stefan Monnier
2020-06-07 23:42                         ` Paul Eggert
2020-06-07  9:31                     ` Pip Cet
2020-06-06 20:19                 ` Drew Adams
2020-06-06 17:54             ` Paul Eggert
2020-06-06 19:41               ` Pip Cet
2020-06-06 20:15                 ` Paul Eggert
2020-06-07  9:21                   ` Pip Cet [this message]
2020-06-07 23:37                     ` Paul Eggert
2020-06-06 20:11               ` Drew Adams
2020-06-06 22:16                 ` Stefan Monnier
2020-06-06 23:27                   ` Drew Adams
2020-06-05 13:02       ` Stefan Monnier
2020-06-05 13:50         ` Basil L. Contovounesios
2020-06-06 19:09         ` Paul Eggert
2020-06-06 20:19           ` Drew Adams

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

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

  git send-email \
    --in-reply-to=87d06bxmcy.fsf@gmail.com \
    --to=pipcet@gmail.com \
    --cc=contovob@tcd.ie \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.