emacs-diffs
[Top][All Lists]
Advanced

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

master bfb486d8026: Eglot: Simplify overlay handling in manual example


From: João Távora
Subject: master bfb486d8026: Eglot: Simplify overlay handling in manual example
Date: Thu, 11 Jan 2024 16:50:39 -0500 (EST)

branch: master
commit bfb486d8026424ec0859036b3686df9cab1383df
Author: Slava Akhmechet <coffeemug@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Eglot: Simplify overlay handling in manual example
    
    * doc/misc/eglot.texi (Extending Eglot): Simplify.
    
    Copyright-paperwork-exempt: yes
---
 doc/misc/eglot.texi | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi
index a5c3a967af1..85fef6be553 100644
--- a/doc/misc/eglot.texi
+++ b/doc/misc/eglot.texi
@@ -1405,8 +1405,6 @@ The remainder of the implementation consists of standard 
Elisp
 techniques to loop over arrays, manage buffers and overlays.
 
 @lisp
-(defvar-local eglot-clangd-inactive-region-overlays '())
-
 (cl-defmethod eglot-handle-notification
   (_server (_method (eql textDocument/inactiveRegions))
            &key regions textDocument &allow-other-keys)
@@ -1414,14 +1412,14 @@ techniques to loop over arrays, manage buffers and 
overlays.
                                      (cl-getf textDocument :uri))))
             (buffer (find-buffer-visiting path)))
       (with-current-buffer buffer
-        (mapc #'delete-overlay eglot-clangd-inactive-region-overlays)
+        (remove-overlays nil nil 'inactive-code t)
         (cl-loop
          for r across regions
          for (beg . end) = (eglot-range-region r)
          for ov = (make-overlay beg end)
          do
          (overlay-put ov 'face 'shadow)
-         (push ov eglot-clangd-inactive-region-overlays)))))
+         (overlay-put ov 'inactive-code t)))))
 @end lisp
 
 @end itemize



reply via email to

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