unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Vyacheslav Akhmechet <coffeemug@gmail.com>
To: 68145@debbugs.gnu.org
Subject: bug#68145: [PATCH] * doc/misc/eglot.texi: Fix broken function calls
Date: Sat, 30 Dec 2023 01:05:13 -0800	[thread overview]
Message-ID: <m2cyuoukl2.fsf@Vyacheslavs-MacBook-Pro.local.mail-host-address-is-not-set> (raw)

[-- 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


             reply	other threads:[~2023-12-30  9:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-30  9:05 Vyacheslav Akhmechet [this message]
2023-12-30 13:45 ` bug#68145: [PATCH] * doc/misc/eglot.texi: Fix broken function calls 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2cyuoukl2.fsf@Vyacheslavs-MacBook-Pro.local.mail-host-address-is-not-set \
    --to=coffeemug@gmail.com \
    --cc=68145@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).