[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 1.2 d1cfc9e 008/101: Work around Emacs bugs 32237, 32278 (#53)
From: |
Christian Johansson |
Subject: |
[elpa] 1.2 d1cfc9e 008/101: Work around Emacs bugs 32237, 32278 (#53) |
Date: |
Thu, 29 Apr 2021 15:08:50 -0400 (EDT) |
tag: 1.2
commit d1cfc9e63c5f5cf4f4ef017be13cfbe01b451f4c
Author: mkcms <k.michal@zoho.com>
Commit: João Távora <joaotavora@gmail.com>
Work around Emacs bugs 32237, 32278 (#53)
See:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32237
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32278
* eglot.el (eglot--apply-text-edits): Inhibit modification hooks and
call them manually for the changed region.
---
eglot.el | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/eglot.el b/eglot.el
index 695db49..1ca7b6d 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1438,7 +1438,23 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
(save-excursion
(save-restriction
(narrow-to-region beg end)
- (replace-buffer-contents temp)))
+
+ ;; 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)))
+ (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))))
(progress-reporter-update reporter (cl-incf done)))))))
(mapcar (jsonrpc-lambda (&key range newText)
(cons newText (eglot--range-region range 'markers)))
- [elpa] 1.2 05e5a9f 063/101: Per #63: Allow function contacts to be interactive, (continued)
- [elpa] 1.2 05e5a9f 063/101: Per #63: Allow function contacts to be interactive, Christian Johansson, 2021/04/29
- [elpa] 1.2 922f4e5 060/101: Merge pull request #104 from mkcms/fix-diagnostics-wrong-type-argument, Christian Johansson, 2021/04/29
- [elpa] 1.2 7b78b15 055/101: Autoload eglot-ensure (#120), Christian Johansson, 2021/04/29
- [elpa] 1.2 bfadd9a 053/101: Close #100: Don't send other notifications before initialized, Christian Johansson, 2021/04/29
- [elpa] 1.2 737f08d 056/101: Correctly map DocumentSymbol's :kind to its name (#121), Christian Johansson, 2021/04/29
- [elpa] 1.2 3c9e00e 068/101: * .travis.yml (install): Download eclipse.jdt.ls server., Christian Johansson, 2021/04/29
- [elpa] 1.2 be464f2 005/101: Add entry for haskell-ide-engine in eglot-server-programs (#49), Christian Johansson, 2021/04/29
- [elpa] 1.2 0694579 009/101: Fix typo in willSaveWaitUntil RPC request (#51), Christian Johansson, 2021/04/29
- [elpa] 1.2 f4f93d3 014/101: Fix placement of diagnostics with same start and end positions, Christian Johansson, 2021/04/29
- [elpa] 1.2 01ec85f 011/101: Implement TextDocument/rangeFormatting, Christian Johansson, 2021/04/29
- [elpa] 1.2 d1cfc9e 008/101: Work around Emacs bugs 32237, 32278 (#53),
Christian Johansson <=
- [elpa] 1.2 e33fadb 012/101: * eglot.el (eglot-client-capabilities): Fix a typo., Christian Johansson, 2021/04/29
- [elpa] 1.2 ee372b4 022/101: * eglot.el (advice-add jsonrpc-request): Add &allow-other-keys, Christian Johansson, 2021/04/29
- [elpa] 1.2 9bf88ee 031/101: Allow tests to be run with custom jsonrpc.el, Christian Johansson, 2021/04/29
- [elpa] 1.2 cf3376a 034/101: Close #64: handle edits to same position in the correct order, Christian Johansson, 2021/04/29
- [elpa] 1.2 5e30066 032/101: Update README.md, Christian Johansson, 2021/04/29
- [elpa] 1.2 afa5439 027/101: Kill server's output and events buffers from eglot-shutdown (#66), Christian Johansson, 2021/04/29
- [elpa] 1.2 d6b49d8 028/101: * README.md (Build Status): Show status for master, Christian Johansson, 2021/04/29
- [elpa] 1.2 c2e05a3 030/101: Close #68: Implement asynchronous server connection, Christian Johansson, 2021/04/29
- [elpa] 1.2 3432d21 037/101: Per #74: Fix eglot-capabilities when querying for multiple features, Christian Johansson, 2021/04/29
- [elpa] 1.2 6eac51f 061/101: Sort references and definitions by line number, Christian Johansson, 2021/04/29