From: phillip.lord@russet.org.uk (Phillip Lord)
To: Eli Zaretskii <eliz@gnu.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: Calling Lisp from undo.c's record_* functions
Date: Mon, 16 Nov 2015 21:51:49 +0000 [thread overview]
Message-ID: <87fv053956.fsf@russet.org.uk> (raw)
In-Reply-To: <83r3jpc2of.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Nov 2015 18:46:40 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
> Question #1: do we really need to call Lisp from so deep inside the
> bowels of buffer manipulation routines? Is that safe? Perhaps we
> should reimplement undo-auto--undoable-change inC?
>
> Question #2: one solution is inhibit GC in run_undoable_change. But
> since that could run arbitrary Lisp, is that a good idea? what if we
> run out of memory?
>
> Question #3: another possible solution is to set the current buffer's
> inhibit_shrinking flag around the call to Lisp in run_undoable_change
> -- is this better? Note that this won't prevent GC in general, so the
> follow-up question is can insdel.c functions afford a GC while they
> run?
>
> Comments? Suggestions?
Bah. I spent ages getting that working, and then you go and break it!
My immediate response would be a variation on #1. All
undo-auto--undoable-change really does is a "add-to-list" call. Easy to
reimplement this into C, I think.
The second thing it does is ensure that a timer is being run, which
seems a bit harder. Using an idle timer (the timer only does anything
when there are no commands happening) would solve the problem, although
(obviously) the timer would run when Emacs is entirely idle.
I'd be happy for Stefan to comment, as well.
Phil
next prev parent reply other threads:[~2015-11-16 21:51 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 [this message]
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
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
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=87fv053956.fsf@russet.org.uk \
--to=phillip.lord@russet.org.uk \
--cc=eliz@gnu.org \
--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 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).