]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/outline.el (outline--fix-buttons-after-change): Add save-match-data.
authorJuri Linkov <juri@linkov.net>
Wed, 22 Mar 2023 07:44:02 +0000 (09:44 +0200)
committerJuri Linkov <juri@linkov.net>
Wed, 22 Mar 2023 07:44:02 +0000 (09:44 +0200)
It's important for a hook in after-change-functions not to change match-data.
Otherwise it breaks functions that make changes in the buffer, such as
for example, successive calls to delete-region in smerge-keep-n, etc.

lisp/outline.el

index a89985d1990c874642af207333e8fbae2275d1e9..0e90c59c2852c09f9a94d5be6a4f4987f2edaf63 100644 (file)
@@ -1877,7 +1877,7 @@ With a prefix argument, show headings up to that LEVEL."
   (save-excursion (goto-char beg) (setq beg (pos-bol)))
   (save-excursion (goto-char end) (setq end (pos-eol)))
   (remove-overlays beg end 'outline-button t)
-  (outline--fix-up-all-buttons beg end))
+  (save-match-data (outline--fix-up-all-buttons beg end)))
 
 \f
 (defvar-keymap outline-navigation-repeat-map