]> git.eshelyaron.com Git - emacs.git/commit
Add command to replace buffer contents
authorPhilipp Stephani <phst@google.com>
Sun, 7 May 2017 19:01:53 +0000 (21:01 +0200)
committerPhilipp Stephani <phst@google.com>
Sat, 17 Jun 2017 13:40:58 +0000 (15:40 +0200)
commitd682f0daa3c0bfdd5ee8ce0e9226353d505e85a9
treeef0a6de2163d2f3c3c9bcb5012875e0018ef496f
parent46279c1ea117bab75bdeccfd04703033c9e7d26d
Add command to replace buffer contents

Add a new command 'replace-buffer-contents' that uses the Myers diff
algorithm to non-destructively replace the accessible portion of the
current buffer.  The Myers algorithm is implemented in Gnulib.

* src/editfns.c (Freplace_buffer_contents): New command.
(set_bit, bit_is_set, buffer_chars_equal): New helper functions.
(syms_of_editfns): Define new command.

* test/src/editfns-tests.el (replace-buffer-contents-1)
(replace-buffer-contents-2): New unit tests.

* src/buffer.h (BUF_FETCH_CHAR_AS_MULTIBYTE): New helper macro.

* admin/merge-gnulib (GNULIB_MODULES): Add diffseq.h and minmax.h.
admin/merge-gnulib
etc/NEWS
lib/diffseq.h [new file with mode: 0644]
lib/gnulib.mk.in
lib/minmax.h [new file with mode: 0644]
m4/gnulib-comp.m4
m4/minmax.m4 [new file with mode: 0644]
src/buffer.h
src/editfns.c
test/src/editfns-tests.el