From: no-spam@cua.dk (Kim F. Storm)
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: New undo element (fun . args)
Date: Wed, 02 Feb 2005 16:41:05 +0100 [thread overview]
Message-ID: <m3brb3nf5a.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <87mzunvyki.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 02 Feb 2005 09:35:23 -0500")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> One of the undoable operations in SES is setting a variable.
>> This doesn't relate directly to buffer text, but it might
>> be associated with some region somehow. I don't know
>> how this is used, and I think it is important to check.
>
> Most of the vars that are thus set/unset are vars of the form "B6" or "C20",
> i.e. vars that hold the content of a cell. So they do have some relation
> with one specific region of the buffer: the corresponding cell. So we could
> just replace (apply ses-set-with-undo ,sym ,(symbol-value sym)) with (apply
> START END 0 ses-set-with-undo ,sym ,(symbol-value sym)) where START and END
Should be 0 START END.
> are the boundaries of the cell. But since the same code is used for other
> vars as well, such as vars that relate to a particular column of
> the spreadsheet, it'll take a bit more effort.
I've tried to make cua use the new undo machinery, but it is more
complicated than I had imagined.
One obstacle is this piece of code in primitive-undo (undo.c):
It is slightly modified to add (apply cdr . nil) rather than (cdr .
nil) to the undo list in this case:
/* Make sure this produces at least one undo entry,
so the test in `undo' for continuing an undo series
will work right. */
if (EQ (oldlist, current_buffer->undo_list))
current_buffer->undo_list
= Fcons (list3 (Qapply, Qcdr, nil), current_buffer->undo_list);
I don't understand why this is necessary. The primitive-undo
continues to the next undo boundary, so why is it important what is
recorded "between undo boundaries" ?
The problem I have with cua is that I don't record buffer changes as
such, but rather a change in where the active rectangle is. It works
to some extent, but as soon as undo hits one of the entries I added to
the undo list, it gets stuck -- and the pending undo list seems to
be stuck at that specific (apply cdr ...) entry.
So somehow what I do breaks the test mentioned above. But what
exactly is that test trying to differentiate. I've looked at the
code in simple.el, and I simply don't get it.
Any ideas...?
next prev parent reply other threads:[~2005-02-02 15:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-30 0:47 New undo element (fun . args) Kim F. Storm
2005-01-30 1:24 ` Miles Bader
2005-01-30 15:07 ` Stefan Monnier
2005-01-30 17:22 ` Kim F. Storm
2005-01-30 18:11 ` Kim F. Storm
2005-01-31 12:01 ` Richard Stallman
2005-01-31 13:02 ` Kim F. Storm
2005-01-31 22:53 ` Kim F. Storm
2005-02-02 7:28 ` Richard Stallman
2005-02-02 7:28 ` Richard Stallman
2005-02-02 14:35 ` Stefan Monnier
2005-02-02 15:41 ` Kim F. Storm [this message]
2005-02-03 19:13 ` Richard Stallman
2005-02-04 15:40 ` Kim F. Storm
2005-02-05 17:39 ` Richard Stallman
2005-02-07 8:23 ` Kim F. Storm
2005-02-07 20:51 ` Richard Stallman
2005-02-09 21:50 ` Kim F. Storm
2005-02-07 11:51 ` Kim F. Storm
2005-02-07 12:25 ` David Kastrup
2005-02-07 14:14 ` Stefan Monnier
2005-02-08 11:47 ` Richard Stallman
2005-02-08 11:46 ` Richard Stallman
2005-02-08 12:53 ` Kim F. Storm
2005-02-03 19:13 ` Richard Stallman
2005-01-31 0:19 ` Richard Stallman
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=m3brb3nf5a.fsf@kfs-l.imdomain.dk \
--to=no-spam@cua.dk \
--cc=emacs-devel@gnu.org \
--cc=rms@gnu.org \
/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).