From: phillip.lord@russet.org.uk (Phillip Lord)
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] fix/no-undo-boundary-on-secondary-buffer-change f59d1be: Move undo amalgamation to lisp.
Date: Fri, 09 Oct 2015 09:31:18 +0100 [thread overview]
Message-ID: <874mi0zbmx.fsf@russet.org.uk> (raw)
In-Reply-To: <jwv612hqean.fsf-monnier+emacsdiffs@gnu.org> (Stefan Monnier's message of "Thu, 8 Oct 2015 16:53:59 -0400")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> Set against this, of course, is that it also becomes harder to change
>> from lisp. Does the
>
>> call2 (Qmy_function,arg1,arg2)
>
>> work like a normal lisp call? I mean, can I redefine my-function, and
>> will it run the new definition? Is it still open to advice?
>
> Yes. Qmy_function is just the symbol, so the C code will call whichever
> function is bound to this symbol, like a call from Lisp would do.
Okay, no worries.
>>> The current logic in remove_excessive_undo_boundaries is far from
>>> perfect, but unless you have a really good idea how to do it
>>> differently, I recommend you just try to reproduce it in Elisp.
>> As I said, the difficulty comes about from trying to work out whether
>> the last undo-boundary is an "automatic" one (i.e. added by the C layer
>> and the command loop) or a "manual" one (i.e. added by a call to
>> undo-boundary).
>
> You can solve it in the same way we do it no: save the auto-added boundary
> in a variable (last_undo_boundary) when you add it, so you can
> afterwards use an `eq' test to figure out if this boundary was
> added automatically.
>
> Since you're moving the "auto-adding" to Lisp, last_undo_boundary will
> naturally move to Lisp as well.
>
>> What I didn't like about this logic is that it only works for a single
>> buffer; it assumes that there is only one last_undo_boundary.
>
> No: last_undo_boundary can be buffer-local. You can also make it
> contain more info (e.g. add for example which was the command that
> created the corresponding change, or which other buffers received
> a boundary at the same, ...).
Yes, that's true, once it's in lisp.
Phil
next prev parent reply other threads:[~2015-10-09 8:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20151005134118.10933.50859@vcs.savannah.gnu.org>
[not found] ` <E1Zj610-0002qx-SM@vcs.savannah.gnu.org>
2015-10-05 15:15 ` [Emacs-diffs] fix/no-undo-boundary-on-secondary-buffer-change f59d1be: Move undo amalgamation to lisp Stefan Monnier
2015-10-05 16:24 ` Phillip Lord
2015-10-07 19:28 ` Stefan Monnier
2015-10-08 19:56 ` Phillip Lord
2015-10-08 20:53 ` Stefan Monnier
2015-10-09 8:31 ` Phillip Lord [this message]
2015-10-16 21:02 ` Phillip Lord
2015-10-18 16:51 ` Stefan Monnier
2015-10-21 19:27 ` Phillip Lord
2015-10-26 17:56 ` Stefan Monnier
2015-10-27 12:45 ` Phillip Lord
2015-10-27 14:50 ` Stefan Monnier
2015-10-28 10:01 ` Phillip Lord
2015-10-28 13:05 ` Stefan Monnier
2015-10-29 14:44 ` Phillip Lord
2015-10-29 15:47 ` Stefan Monnier
2015-10-30 8:44 ` Phillip Lord
2015-10-30 13:28 ` Stefan Monnier
2015-10-30 14:21 ` David Kastrup
2015-11-02 16:56 ` Phillip Lord
2015-11-02 19:37 ` David Kastrup
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=874mi0zbmx.fsf@russet.org.uk \
--to=phillip.lord@russet.org.uk \
--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.