From: João Távora Date: Mon, 21 Oct 2019 12:08:45 +0000 (+0100) Subject: (again): fix issue with replace-buffer-contents X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~292 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f71716e91427d893773ca68d5d3dec417a963571;p=emacs.git (again): fix issue with replace-buffer-contents 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 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index e78d2c45882..e1c7b48c8d6 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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)