[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11774: [O] bug#11774: org-mode causes undo boundaries to be lost

From: Martin Pohlack
Subject: bug#11774: [O] bug#11774: org-mode causes undo boundaries to be lost
Date: Mon, 02 Jul 2012 08:51:48 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Hi Toby,

On 25.06.2012 13:35, Toby Cubitt wrote:
> On Sun, Jun 24, 2012 at 11:52:41PM +0200, Toby Cubitt wrote:
>> On Sun, Jun 24, 2012 at 11:39:08PM +0200, Bastien wrote:
>>> Hi Toby,
>>> Toby Cubitt <address@hidden> writes:
>>>> For some unknown reason, org-mode is causing the undo boundary between
>>>> the (2 . 4) and (1 . 2) entries to be removed from `buffer-undo-list'.
>>> Can you try again with
>>>   (setq org-self-insert-cluster-for-undo nil)
>>> and report?
>> Yup, that fixes the problem.
>> I don't fully understand the purpose of
>> `org-self-insert-cluster-for-undo', given that the Emacs command loop
>> already groups consecutive undo entries together, but presumably it
>> enables a more aggressive form of clustering.
> [snip]
>> I could try to work around this in undo-tree-mode, but it seems to me
>> that org-mode shouldn't be throwing away an undo boundary that comes
>> before an entry which definitely shouldn't be clustered with anything
>> (namely the undo-tree-canary symbol, which is meaningless to org-mode).
> I've now added a work-around for this in undo-tree-mode (currently only
> in git, but I'll push to ELPA once it's sufficiently tested).
> 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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]