diff options
| author | Philipp Stephani | 2017-05-07 21:01:53 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2017-06-17 15:40:58 +0200 |
| commit | d682f0daa3c0bfdd5ee8ce0e9226353d505e85a9 (patch) | |
| tree | ef0a6de2163d2f3c3c9bcb5012875e0018ef496f /etc | |
| parent | 46279c1ea117bab75bdeccfd04703033c9e7d26d (diff) | |
| download | emacs-d682f0daa3c0bfdd5ee8ce0e9226353d505e85a9.tar.gz emacs-d682f0daa3c0bfdd5ee8ce0e9226353d505e85a9.zip | |
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.
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/NEWS | 5 |
1 files changed, 5 insertions, 0 deletions
| @@ -462,6 +462,11 @@ Negative prefix arg flips the direction of selection. Also, | |||
| 462 | defun are selected unless they are separated from the defun by a blank | 462 | defun are selected unless they are separated from the defun by a blank |
| 463 | line. | 463 | line. |
| 464 | 464 | ||
| 465 | ** New command 'replace-buffer-contents'. This command replaces the | ||
| 466 | contents of theaccessible portion of the current buffer with the | ||
| 467 | contents of the accessible portion of a different buffer while keeping | ||
| 468 | point, mark, markers, and text properties as intact as possible. | ||
| 469 | |||
| 465 | 470 | ||
| 466 | * Changes in Specialized Modes and Packages in Emacs 26.1 | 471 | * Changes in Specialized Modes and Packages in Emacs 26.1 |
| 467 | 472 | ||