all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#68145: [PATCH] * doc/misc/eglot.texi: Fix broken function calls
@ 2023-12-30  9:05 Vyacheslav Akhmechet
  2023-12-30 13:45 ` Felician Nemeth
  0 siblings, 1 reply; 9+ messages in thread
From: Vyacheslav Akhmechet @ 2023-12-30  9:05 UTC (permalink / raw)
  To: 68145

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

Tags: patch

Tags: patch

This patch fixes a broken example in the eglot manual. It makes two
changes:

* Fixes broken function calls
* Slightly simplifies overlay handling

Submitting this upon João Távora's suggestion.

In GNU Emacs 29.1 (build 2, aarch64-apple-darwin23.2.0, NS
 appkit-2487.30 Version 14.2.1 (Build 23C71)) of 2023-12-24 built on
 Vyacheslavs-MacBook-Pro.local
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.2.1

Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp
 --infodir=/opt/homebrew/Cellar/emacs-plus@29/29.1/share/info/emacs
 --prefix=/opt/homebrew/Cellar/emacs-plus@29/29.1 --with-xml2
 --with-gnutls --with-native-compilation --without-compress-install
 --without-dbus --without-imagemagick --with-modules --with-rsvg
 --with-ns --disable-ns-self-contained 'CFLAGS=-Os -w -pipe
 -mmacosx-version-min=14
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk
 -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT'
 'CPPFLAGS=-I/opt/homebrew/opt/zlib/include
 -I/opt/homebrew/opt/jpeg/include -I/opt/homebrew/opt/icu4c/include
 -isystem/opt/homebrew/include -F/opt/homebrew/Frameworks
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk'
 'LDFLAGS=-L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/jpeg/lib
 -L/opt/homebrew/opt/icu4c/lib -L/opt/homebrew/lib
 -F/opt/homebrew/Frameworks -Wl,-headerpad_max_install_names
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk
 -L/opt/homebrew/opt/libgccjit/lib''


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-doc-misc-eglot.texi-Fix-broken-function-calls.patch --]
[-- Type: text/patch, Size: 2218 bytes --]

From a2734a0c643e89afae5bc1b1e88776ff61cddb8e Mon Sep 17 00:00:00 2001
From: Slava Akhmechet <coffeemug@gmail.com>
Date: Sat, 30 Dec 2023 00:31:43 -0800
Subject: [PATCH] * doc/misc/eglot.texi: Fix broken function calls

---
 doc/misc/eglot.texi | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi
index a338677e844..0ff69130eb9 100644
--- a/doc/misc/eglot.texi
+++ b/doc/misc/eglot.texi
@@ -1397,31 +1397,29 @@ Elisp plists (@pxref{JSONRPC objects in Elisp}).
 The Eglot generic function machinery will automatically destructure
 the incoming message, so these two properties can simply be added to
 the new method's lambda list as @code{&key} arguments.  Also, the
-@code{eglot-uri-to-path} and @code{eglot-range-region} may be used to
-easily parse the LSP @code{:uri} and @code{:start ... :end ...}
+@code{eglot--uri-to-path} and @code{eglot--range-region} may be used
+to easily parse the LSP @code{:uri} and @code{:start ... :end ...}
 objects to obtain Emacs objects for file names and positions.
 
 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)
-  (if-let* ((path (expand-file-name (eglot-uri-to-path
+  (if-let* ((path (expand-file-name (eglot--uri-to-path
                                      (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 (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
-- 
2.43.0


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

end of thread, other threads:[~2024-01-13 10:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-30  9:05 bug#68145: [PATCH] * doc/misc/eglot.texi: Fix broken function calls Vyacheslav Akhmechet
2023-12-30 13:45 ` Felician Nemeth
2023-12-30 14:46   ` João Távora
2023-12-30 18:16     ` Stefan Kangas
2024-01-01 18:17       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-30 20:32     ` Slava Akhmechet
2024-01-11 20:58       ` Stefan Kangas
2024-01-11 21:52         ` João Távora
2024-01-13 10:56           ` Stefan Kangas

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.