bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#25355: 26.0.50; Provide function to non-destructively replace buffer


From: npostavs
Subject: bug#25355: 26.0.50; Provide function to non-destructively replace buffer contents
Date: Wed, 04 Jan 2017 08:38:15 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

severity 25355 wishlist
quit

Philipp <address@hidden> writes:

> There are many tools (e.g. auto-formatters) that take buffer contents,
> reformat them, and write the reformatted output somewhere.  However,
> there is no good way how to apply the modified output to the source
> buffer.  The naive way (erasing and re-inserting the buffer contents)
> loses point and markers.  Therefore there should be a function
> (e.g. `replace-buffer-contents') that calculates a minimal diff between
> the old and the new contents and uses editing operations (insert,
> delete, etc.) to apply the diff.  Ideally this would be done without any
> external tools (e.g. 'diff').

This is pretty similar (though not identical) to
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=18.





reply via email to

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