Lars Ingebrigtsen writes: > miha@kamnitnik.top writes: > >> My idea to solve this is to record process mark and related marker >> positions as `apply' entries in the undo list. Attached patch implements >> this for comint and eshell. > > Hm, interesting... The patch looks good to me, but I'm not really that > familiar with undo internals myself, so it'd be good to get more > opinions on this first. So I've added Stefan to the CCs. So after thinking about this some more, I arrived at a simpler solution: deleting and reinserting text to generate suitable undo list entries instead of adding them explicitly. As opposed to the first patch, this one should also handle undo-in-region reasonably well.