]> git.eshelyaron.com Git - emacs.git/commitdiff
(again): fix issue with replace-buffer-contents
authorJoão Távora <joaotavora@gmail.com>
Mon, 21 Oct 2019 12:08:45 +0000 (13:08 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 21 Oct 2019 12:08:45 +0000 (13:08 +0100)
Manually calling the before/after change hooks for Emacs 26.1's buggy
replace-buffer-contents must be done with absolute positions, not
markers.

* eglot.el (eglot--apply-text-edits): Call change hooks with
buffer positions, not markers.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/259

lisp/progmodes/eglot.el

index e78d2c45882d7c6bd051cd11dc76dc162a8af9df..e1c7b48c8d69683394f70decc2b0ac4dea73694c 100644 (file)
@@ -2307,7 +2307,9 @@ If SKIP-SIGNATURE, don't try to send textDocument/signatureHelp."
                           ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32237
                           ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32278
                           (let ((inhibit-modification-hooks t)
-                                (length (- end beg)))
+                                (length (- end beg))
+                                (beg (marker-position beg))
+                                (end (marker-position end)))
                             (run-hook-with-args 'before-change-functions
                                                 beg end)
                             (replace-buffer-contents temp)