emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 a4d97811ed4 3/3: Bail early from eglot--apply-text-edits if not


From: João Távora
Subject: emacs-29 a4d97811ed4 3/3: Bail early from eglot--apply-text-edits if nothing to do
Date: Sun, 19 Mar 2023 15:57:55 -0400 (EDT)

branch: emacs-29
commit a4d97811ed4a6557ccac4b6a79a52993d8aa0fa3
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Bail early from eglot--apply-text-edits if nothing to do
    
    * lisp/progmodes/eglot.el (eglot--apply-text-edits): Early return.
---
 lisp/progmodes/eglot.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index dbd3eff67d1..7a076c134fc 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3219,8 +3219,9 @@ Returns a list as described in docstring of 
`imenu--index-alist'."
                                  ,(eglot--TextDocumentIdentifier))
                                :cancel-on-input non-essential))))))
 
-(defun eglot--apply-text-edits (edits &optional version)
+(cl-defun eglot--apply-text-edits (edits &optional version)
   "Apply EDITS for current buffer if at VERSION, or if it's nil."
+  (unless edits (cl-return-from eglot--apply-text-edits))
   (unless (or (not version) (equal version eglot--versioned-identifier))
     (jsonrpc-error "Edits on `%s' require version %d, you have %d"
                    (current-buffer) version eglot--versioned-identifier))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]