From: Philipp Stephani <p.stephani2@gmail.com>
To: 25355@debbugs.gnu.org
Subject: bug#25355: 26.0.50; Provide function to non-destructively replace buffer contents
Date: Sun, 07 May 2017 17:44:27 +0000 [thread overview]
Message-ID: <CAArVCkT__6RXLEp6R_L2TS-Z_W_eG=B5MyPn_qmBwQ9mG2=tKw@mail.gmail.com> (raw)
In-Reply-To: <wvr41swj6ljn.fsf@a.muc.corp.google.com>
[-- Attachment #1: Type: text/plain, Size: 876 bytes --]
Philipp <p.stephani2@gmail.com> schrieb am Mi., 4. Jan. 2017 um 13:46 Uhr:
>
> 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').
>
>
FYI, I've now implemented this based on libmba (
http://www.ioplex.com/~miallen/libmba/). Unless there are concerns
importing part of that library into the Emacs source tree, I'll send a
patch.
[-- Attachment #2: Type: text/html, Size: 1260 bytes --]
next prev parent reply other threads:[~2017-05-07 17:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-04 12:45 bug#25355: 26.0.50; Provide function to non-destructively replace buffer contents Philipp
2017-01-04 13:38 ` npostavs
2017-05-07 17:44 ` Philipp Stephani [this message]
2017-05-07 18:05 ` Eli Zaretskii
2017-05-07 18:21 ` Philipp Stephani
2017-05-07 18:37 ` Eli Zaretskii
2017-05-07 18:45 ` Philipp Stephani
2017-05-07 19:19 ` Eli Zaretskii
2017-05-14 19:30 ` Philipp Stephani
2017-05-15 1:47 ` Richard Stallman
2017-05-15 2:49 ` Eli Zaretskii
2017-05-16 1:08 ` Richard Stallman
2017-05-15 22:09 ` Glenn Morris
2017-06-12 21:17 ` Philipp Stephani
2017-06-17 13:47 ` Philipp Stephani
2017-06-17 16:06 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAArVCkT__6RXLEp6R_L2TS-Z_W_eG=B5MyPn_qmBwQ9mG2=tKw@mail.gmail.com' \
--to=p.stephani2@gmail.com \
--cc=25355@debbugs.gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.