all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: phillip.lord@russet.org.uk (Phillip Lord)
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Calling Lisp from undo.c's record_* functions
Date: Tue, 17 Nov 2015 18:35:56 +0200	[thread overview]
Message-ID: <83a8qcbn2r.fsf@gnu.org> (raw)
In-Reply-To: <87d1v8bsbf.fsf@russet.org.uk>

> From: phillip.lord@russet.org.uk (Phillip Lord)
> Cc: Eli Zaretskii <eliz@gnu.org>,  <emacs-devel@gnu.org>
> Date: Tue, 17 Nov 2015 14:42:44 +0000
> 
> > The "critical section" is the span of code during which the buffer is
> > "being worked on" by the insertion function, so during this time, the
> > buffer shouldn't be modified by anyone else in any way: no Elisp code
> > should be run, no GC should take place.
> 
> Assuming the documentation of undo.c is rigourously followed, then this
> should only be a problem for insert. All the others say "at the
> beginning of the command" or "about to happen". Only insertion says
> "before or after". Although, record_insert calls record_point which
> rather confuses me -- surely in record_insert can be after, so can
> record_point.

I don't recommend relying on such promises too much.  You can never
know if someone, some day violates it, whether consciously or
inadvertently.  In fact, it looks like replace_range already does just
that.

> There are only 7 calls to record_insert so changing the so record_insert
> is *always* before would be possible.

Did you look at insert_from_gap?  AFAIU, it assumes that the gap
position stays put during the call to record_insert.  If that can call
Lisp or GC, that assumption is false.

> Big change to make at this point in the release cycle.

No, I don't think so.  We still have several months to go.

Btw, could you perhaps write a short description of this change and
its effects in the Lisp level for etc/NEWS?  I see there's not a word
about this there.  Bonus points if you also update the ELisp manual.

Thanks.



  parent reply	other threads:[~2015-11-17 16:35 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 16:46 Calling Lisp from undo.c's record_* functions Eli Zaretskii
2015-11-16 21:51 ` Phillip Lord
2015-11-16 22:51 ` Stefan Monnier
2015-11-17 12:14   ` Phillip Lord
2015-11-17 13:46     ` Stefan Monnier
2015-11-17 14:42       ` Phillip Lord
2015-11-17 15:40         ` Stefan Monnier
2015-11-17 16:24           ` Eli Zaretskii
2015-11-17 16:49             ` Stefan Monnier
2015-11-17 17:05               ` Eli Zaretskii
2015-11-17 17:34                 ` Stefan Monnier
2015-11-17 18:00                   ` Eli Zaretskii
2015-11-17 19:09                     ` Stefan Monnier
2015-11-17 19:22                       ` Eli Zaretskii
2015-11-17 21:05                     ` Phillip Lord
2015-11-17 21:02               ` Phillip Lord
2015-11-18  2:55                 ` Stefan Monnier
2015-11-18 12:26                   ` Phillip Lord
2015-11-17 16:35         ` Eli Zaretskii [this message]
2015-11-17 20:52           ` Phillip Lord
2015-11-18  3:38             ` Eli Zaretskii
2015-11-18  9:56               ` Phillip Lord
2015-11-18 10:49                 ` David Kastrup
2015-11-18 17:30                 ` Eli Zaretskii
2015-11-17 16:40     ` Eli Zaretskii
2015-11-17 16:51       ` Stefan Monnier
2015-11-17 19:44         ` Eli Zaretskii
2015-11-17 21:35           ` Phillip Lord
2015-11-18  2:52           ` Stefan Monnier
2015-11-18  3:49             ` Eli Zaretskii
2015-11-18 12:31               ` Phillip Lord
2015-11-18 17:49                 ` Eli Zaretskii
2015-11-19  1:49                   ` Stefan Monnier
2015-11-19 10:16                   ` Phillip Lord
2015-11-19 15:53                     ` Eli Zaretskii
2015-11-19 17:49                       ` Stefan Monnier
2015-11-19 17:58                         ` Eli Zaretskii
2015-11-19 18:17                           ` Stefan Monnier
2015-11-22 21:44                       ` Phillip Lord
2015-11-22 22:41                         ` John Wiegley
2015-11-23 17:29                           ` Phillip Lord
2015-11-23  3:37                         ` Eli Zaretskii
2015-11-23 17:28                           ` Phillip Lord
2015-11-25 17:43                             ` Eli Zaretskii
2015-11-25 22:51                               ` Richard Stallman
2015-11-26 10:27                               ` Phillip Lord
2015-11-17 21:13       ` Phillip Lord

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=83a8qcbn2r.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=phillip.lord@russet.org.uk \
    /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.