• Philipp Stephani's avatar
    Add command to replace buffer contents · d682f0da
    Philipp Stephani authored
    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.
    d682f0da
diffseq.h 17 KB