emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Martin Pohlack <mp26@os.inf.tu-dresden.de>
To: Toby Cubitt <tsc25@cantab.net>
Cc: Bastien <bzg@gnu.org>, 11774@debbugs.gnu.org
Subject: bug#11774: bug#11774: org-mode causes undo boundaries to be lost
Date: Tue, 03 Jul 2012 17:18:40 +0200	[thread overview]
Message-ID: <4FF30D50.8010009__14038.9202665121$1341328799$gmane$org@os.inf.tu-dresden.de> (raw)
In-Reply-To: <20120703095729.GA6651@c3po>

On 03.07.2012 11:57, Toby Cubitt wrote:
> On Mon, Jul 02, 2012 at 08:51:48AM +0200, Martin Pohlack wrote:
>>> I'm still not entirely convinced that the boundary discarding logic in
>>> org-self-insert-command is correct. For example, if I do the following:
>>>
>>> 1. Type some text at some location in an org-mode buffer
>>> 2. Move to another location very far away
>>>    (without invoking any commands other than point motion)
>>> 3. Type some more text
>>>
>>> then org-self-insert-cluster-for-undo collapses the undo changesets for
>>> these two changes into one. Undoing then reverts both sets of changes at
>>> once, even though those changes might be so far apart that they aren't
>>> both visible at the same time in the buffer.
>>>
>>> That seems very undesirable to me.
>>
>> Having been involved in org-mode's collapsing code I am interested in
>> this, but I cannot reproduce your problem.  I used a very large org-mode
>> file, inserted some text, moved down some pages and inserted some text
>> again (3 chars each).  Undoing was split between both parts, exactly as
>> desired.  Could you provide more details please?
> 
> 
> Sure. The following steps produce the effect I described, at least for
> me. This is on a fairly recent (a couple of weeks old) bzr build of
> Emacs, and a similarly recent git build of org-mode:
> 
> 1. $ emacs -Q
> 2. C-x C-f test.org
> 3. M-x org-mode       [not really necessary since already in org-mode]
> 5. C-u 50 M-x newline
> 6. M-<
> 7. type "a"
> 8. M->
> 9. type "bc"
> 
> buffer-undo-list now contains:
> 
> (nil (52 . 54) (1 . 2) nil (1 . 51) (t . -1))
> 
> Note the lack of undo boundary between (52 . 54) and (1 . 2), which means
> that undoing once (C-/) deletes both "bc" *and* "a" in one step.

Understood.  I tried exactly the same thing with an older emacs (GNU
Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.4) of 2011-04-04 on
crested, modified by Debian) and org-mode (6.33x and 7.6) and have this
result:

(nil (53 . 54) (52 . 53) nil (1 . 2) nil (1 . 51) (t 65535 . 65535))

Which is what one wants.  Someone seems to be merging the self-insert
commands in your situation.  Probably the native merging code has
changed in recent emacs itself.

If this is confirmed, we could modify org-mode's merging code to only
merge undo entries that span one character.

Martin

       reply	other threads:[~2012-07-03 15:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120703095729.GA6651@c3po>
2012-07-03 15:18 ` Martin Pohlack [this message]
     [not found] ` <4FF30D50.8010009@os.inf.tu-dresden.de>
2012-07-03 17:29   ` bug#11774: bug#11774: org-mode causes undo boundaries to be lost Stefan Monnier
2012-07-03 18:13     ` bug#11774: " Samuel Wales
     [not found]     ` <CAJcAo8t4wj-8mje2=QEKY275QXyxwkotBCftZmOVQZAsMAt7Hg@mail.gmail.com>
2012-07-03 22:57       ` Stefan Monnier
     [not found]       ` <jwvfw984ftk.fsf-monnier+emacs@gnu.org>
2012-07-04  0:18         ` Samuel Wales
     [not found]         ` <CAJcAo8ujDHZU2xiPh8hnaXgO1m_-cf2tcA6B_LWj-3YczJRzAA@mail.gmail.com>
2012-07-04  0:24           ` bug#11774: " Samuel Wales
2012-07-04  9:40           ` Toby Cubitt
2012-07-18 13:21           ` Stefan Monnier
2012-08-01 14:26             ` Bastien
     [not found]             ` <CAJcAo8ux9Dw5Nu6x0jm59mWFaLWFG6SSeMs9dju-Jgy5nWkUcA@mail.gmail.com>
2014-11-03 14:35               ` Stefan Monnier
     [not found] <20120624212755.GA14501@c3po.home>
     [not found] ` <20120624215241.GA6205@c3po.home>
2012-06-25 11:35   ` Toby Cubitt
     [not found] ` <4FF14504.10609@os.inf.tu-dresden.de>
2012-07-03  9:57   ` bug#11774: " Toby Cubitt
     [not found] ` <20120625113529.GA15913@c3po.home>
2012-07-02  6:51   ` Martin Pohlack
2012-07-03 18:33   ` Martin Pohlack
2014-11-03 19:25 ` bug#11774: Emacs 24.3: newline-and-indent has two undo boundaries Samuel Wales

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.orgmode.org/

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

  git send-email \
    --in-reply-to='4FF30D50.8010009__14038.9202665121$1341328799$gmane$org@os.inf.tu-dresden.de' \
    --to=mp26@os.inf.tu-dresden.de \
    --cc=11774@debbugs.gnu.org \
    --cc=bzg@gnu.org \
    --cc=tsc25@cantab.net \
    /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/org-mode.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).