unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* eglot.el; delete emacs 26.2 workaround?
@ 2022-11-08 17:58 Stephen Leake
  2022-11-08 22:49 ` João Távora
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Leake @ 2022-11-08 17:58 UTC (permalink / raw)
  To: emacs-devel; +Cc: João Távora

[-- Attachment #1: Type: text/plain, Size: 337 bytes --]

One of my ada-mode tests for eglot ran into a problem with
flymake-after-change-function, called from eglot--apply-text-edits. The
code there says it's a workaround for emacs < 26.2, but eglot.el
currently requires emacs 26.3. So I deleted the workaround (patch
attached), and that fixed the ada-mode test.

Ok to commit?

-- 
-- Stephe

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: eglot.diff --]
[-- Type: text/x-patch, Size: 1830 bytes --]

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index ce989b5611..4cd067983f 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3095,25 +3095,8 @@ eglot--apply-text-edits
                       (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)))

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: eglot.el; delete emacs 26.2 workaround?
  2022-11-08 17:58 eglot.el; delete emacs 26.2 workaround? Stephen Leake
@ 2022-11-08 22:49 ` João Távora
  0 siblings, 0 replies; 2+ messages in thread
From: João Távora @ 2022-11-08 22:49 UTC (permalink / raw)
  To: Stephen Leake; +Cc: emacs-devel

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> The code there says it's a workaround for emacs < 26.2, but eglot.el
> currently requires emacs 26.3. So I deleted the workaround (patch
> attached), and that fixed the ada-mode test.
>
> Ok to commit?

I think so.  It sure seems nice to get rid of that ugliness.  Though I
really hope the problem _is_ indeed fixed in emacs 26.3.  I can't
remember the details anymore, and the code isn't version-guarded, so
there's a (small) risk.

Anyway, please remove this newline whitespace before commiting.

+                          (replace-buffer-contents temp)
+                          ))

And thanks!
João



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-08 22:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 17:58 eglot.el; delete emacs 26.2 workaround? Stephen Leake
2022-11-08 22:49 ` João Távora

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).