From 43db0e2784bfafdb8b08a2f5f075e2d432df132f Mon Sep 17 00:00:00 2001 From: Stephen Leake Date: Wed, 9 Nov 2022 06:00:40 -0800 Subject: [PATCH] Delete emacs < 26.2 workaround in eglot--apply-text-edits * lisp/progmodes/eglot.el (eglot--apply-text-edits): Delete emacs < 26.2 workaround; fixes bug in ada-mode test. --- lisp/progmodes/eglot.el | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index ce989b56117..2eaa396386a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3095,25 +3095,7 @@ Returns a list as described in docstring of `imenu--index-alist'." (save-excursion (save-restriction (narrow-to-region beg end) - - ;; On emacs versions < 26.2, - ;; `replace-buffer-contents' is buggy - it calls - ;; change functions with invalid arguments - so we - ;; manually call the change functions here. - ;; - ;; See emacs bugs #32237, #32278: - ;; 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)) - (beg (marker-position beg)) - (end (marker-position end))) - (run-hook-with-args 'before-change-functions - beg end) - (replace-buffer-contents temp) - (run-hook-with-args 'after-change-functions - beg (+ beg (length newText)) - length)))) + (replace-buffer-contents temp))) (progress-reporter-update reporter (cl-incf done))))))) (mapcar (eglot--lambda ((TextEdit) range newText) (cons newText (eglot--range-region range 'markers))) -- 2.39.5