[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [bug] [babel] babel corrupts undo history
From: |
Eric Schulte |
Subject: |
Re: [O] [bug] [babel] babel corrupts undo history |
Date: |
Wed, 28 Aug 2013 12:52:51 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Aaron Ecay <address@hidden> writes:
> Hi Eric and Samuel,
>
> As I understand it, the problem is that the undo history gets scrambled
> by the interleaving of user edits (in the indirect source-editing
> buffer) and automatic changes introduced by org (un- and re-indenting
> the source code).
>
> I have the following patch, which seems to prevent the misbehavior
> Samuel noticed. It has the drawback of not keeping the fine-grained
> undo information: after org-src-edit-exit, all changes made during the
> edit are seen as only one change, and undone as a unit.
>
> I think the problem of interleaving the automatic and user-driven
> changes in a sensible way is tricky. We don’t want the first invocation
> of undo after org-src-edit-exit to remove the contents of the code
> block, which is what a naive approach gives (since org-src-edit-exit
> deletes then reinserts the code block contents).
>
> I’ve been running with this patch for a while and not noticed any ill
> effects. But I haven’t made a concerted attempt to test undo around
> code blocks, which is why I’ve held off on pushing it. If it fixes
> Samuel’s problem and looks good, perhaps it is ready to go.
>
Aaron, thanks for this fix.
Sam, does this patch fix your problem?
If so then I think it should be applied. I didn't write and am not
familiar with this code, so I'll leave application to someone more
competent than myself.
--
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D
Re: [O] [bug] [babel] babel corrupts undo history, Samuel Wales, 2013/08/28