From: Glenn Morris Date: Tue, 3 Jul 2018 02:19:26 +0000 (-0700) Subject: Merge from origin/emacs-26 X-Git-Tag: emacs-27.0.90~4728 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=02f2f336af7c4129ec79ab00881bba3e14ff9820;p=emacs.git Merge from origin/emacs-26 fc5cae7 ; Fix ChangeLog typo. e17a5e5 ; make change-history-commit f205928 * etc/HISTORY: Cite Brinkoff on early history. 4e58ca8 Document internal use of 'above-suspended' z-group frame para... 4bd43b0 Increase max-lisp-eval-depth adjustment while in debugger (bu... ab98352 Improve on last change in replace-buffer-contents 2f149c0 Fix a factual error in Introduction to Emacs Lisp 8ad50a3 ; * lisp/files.el (buffer-offer-save): Doc fix. (Bug#32000) c80f31f Minor improvements in documentation of imenu.el 8ebb683 Avoid errors with recentering in 'skeleton-insert' e980a3c * src/lisp.h: Omit obsolete comment re bytecode stack. eec71eb Speed up replace-buffer-contents 93c41ce Remove extra process call from vc-git-find-file-hook 7ea0873 ; Update some commentary 4a7f423 Speed up vc-git-dir-status-files 9134c84 Avoid compiler warning using coding.h Conflicts: src/editfns.c --- 02f2f336af7c4129ec79ab00881bba3e14ff9820 diff --cc src/editfns.c index efe83e811ba,90022117140..e16a554de20 --- a/src/editfns.c +++ b/src/editfns.c @@@ -3232,9 -3226,37 +3240,36 @@@ differences between the two buffers. * early. */ eassert (! early_abort); + rbc_quitcounter = 0; + Fundo_boundary (); + bool modification_hooks_inhibited = false; - ptrdiff_t count = SPECPDL_INDEX (); - record_unwind_protect (save_excursion_restore, save_excursion_save ()); + record_unwind_protect_excursion (); + /* We are going to make a lot of small modifications, and having the + modification hooks called for each of them will slow us down. + Instead, we announce a single modification for the entire + modified region. But don't do that if the caller inhibited + modification hooks, because then they don't want that. */ + ptrdiff_t from, to; + if (!inhibit_modification_hooks) + { + ptrdiff_t k, l; + + /* Find the first character position to be changed. */ + for (k = 0; k < size_a && !bit_is_set (ctx.deletions, k); k++) + ; + from = BEGV + k; + + /* Find the last character position to be changed. */ + for (l = size_a; l > 0 && !bit_is_set (ctx.deletions, l - 1); l--) + ; + to = BEGV + l; + prepare_to_modify_buffer (from, to, NULL); + specbind (Qinhibit_modification_hooks, Qt); + modification_hooks_inhibited = true; + } + ptrdiff_t i = size_a; ptrdiff_t j = size_b; /* Walk backwards through the lists of changes. This was also @@@ -3280,8 -3299,18 +3312,17 @@@ --i; --j; } - unbind_to (count, Qnil); - SAFE_FREE (); ++ SAFE_FREE_UNBIND_TO (count, Qnil); + rbc_quitcounter = 0; - return SAFE_FREE_UNBIND_TO (count, Qnil); + if (modification_hooks_inhibited) + { + ptrdiff_t updated_to = to + ZV - BEGV - size_a; + signal_after_change (from, to - from, updated_to - from); + update_compositions (from, updated_to, CHECK_INSIDE); + } + + return Qnil; } static void