From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vyacheslav Akhmechet Newsgroups: gmane.emacs.bugs Subject: bug#68145: [PATCH] * doc/misc/eglot.texi: Fix broken function calls Date: Sat, 30 Dec 2023 01:05:13 -0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39663"; mail-complaints-to="usenet@ciao.gmane.io" To: 68145@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 30 12:56:30 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rJXx8-000A8E-IN for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Dec 2023 12:56:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJXwi-000348-6m; Sat, 30 Dec 2023 06:56:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rJXwg-00033q-Kx for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 06:56:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rJXwg-000890-Bj for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 06:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rJXwf-0003xY-Pv for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 06:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Vyacheslav Akhmechet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Dec 2023 11:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68145 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.170393731015149 (code B ref -1); Sat, 30 Dec 2023 11:56:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Dec 2023 11:55:10 +0000 Original-Received: from localhost ([127.0.0.1]:43233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJXvp-0003wF-Ic for submit@debbugs.gnu.org; Sat, 30 Dec 2023 06:55:09 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:46796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJVHf-0004ML-4e for submit@debbugs.gnu.org; Sat, 30 Dec 2023 04:05:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rJVHV-0004lv-99 for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 04:05:21 -0500 Original-Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rJVHT-0003GG-Gr for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 04:05:21 -0500 Original-Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-28c7c422ad9so2762758a91.3 for ; Sat, 30 Dec 2023 01:05:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703927116; x=1704531916; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=9owaxLF0pOL90yGMRx4IZ/IgoR27Uy/odimcCzJ2Tqs=; b=ePvztU4hkk5kqSgqwXDQI0LJczgzMjFDMNQjlj5CsCrkkN3s3ssyZNlkVApfodmhCQ lct9Gqf2ohvZVumYz1O/BlE4de2Xm4jCgzWQkISkwKEsdJQarE0FbMmeUJadk32PiuiC HiPEeyk+2cwtSKFxHZ+l7+IVKntskBK0pON7kRrhJdlco6UpaatViXzNZCRawYcdsMxY pTmd8e8SYi0+ZcKtkipaeJvqsi0wujUHiDvxz8J1BP/3hJ6+lzmxskRMnkOxEcGdPMSi IqNZSHz2k70t0PlK9YM0r51YcPecHwUx52N1MD3yIM/LP8rLKJ1wsYGN88Dclb8+7WEP zkwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703927116; x=1704531916; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=9owaxLF0pOL90yGMRx4IZ/IgoR27Uy/odimcCzJ2Tqs=; b=LyAS2Dr/9IvczmeGwmwOb9Fe8KTtFgj6aKhYAAI91UwiYxhVvZLbaS7E/ARy39PCsk NUhe90zMjgulnULb+AGVvo9cwQKxO56QfE2ldj9l+XdeAwCxvH0GZly5a88OBhGA+lF2 ar8gmkcb4H7ekeHJSrm/nx1JcqwzzDmSs5dHBAGGQJ+v174NpcEAaURFaPlxXh45fh3t uIj4gZVfZDEYG9clqHbVa1l41zLLgvrebV5Gr3IAc3uXRTgRXK2In0I3SMZZDvEo5J7H oYCCkAGn6gbWWfMSdWGYzd2vZFnfIy8UKPhggqb7sme7Cmt7bpZdLNKdoo6CnAOY9bwL Vzzw== X-Gm-Message-State: AOJu0YzdFJ90zZhIerm/tr6vobOHt7iT6ORNreJakKnrtFPeYXpCjsSo +w8t4o6RxExoagQ0FeoQxtQBo7fUIek= X-Google-Smtp-Source: AGHT+IECtjoGxTjGvP51G1SpPu8fWUF0MwZhdpQaYr2Qc3/8YB6LTNqoyxvvFMuajDoRE+EFXzwJbQ== X-Received: by 2002:a17:90a:8c05:b0:28b:16e3:fe71 with SMTP id a5-20020a17090a8c0500b0028b16e3fe71mr6624404pjo.30.1703927115900; Sat, 30 Dec 2023 01:05:15 -0800 (PST) Original-Received: from Vyacheslavs-MacBook-Pro.local (c-98-234-220-86.hsd1.ca.comcast.net. [98.234.220.86]) by smtp.gmail.com with ESMTPSA id n13-20020a17090a928d00b0028cbf64972dsm681268pjo.35.2023.12.30.01.05.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 01:05:14 -0800 (PST) X-Google-Original-From: Vyacheslav Akhmechet Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=coffeemug@gmail.com; helo=mail-pj1-x102c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 30 Dec 2023 06:55:08 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277080 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=C3=A3o T=C3=A1vora'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=3D/opt/homebrew/share/emacs/site-lisp --infodir=3D/opt/homebrew/Cellar/emacs-plus@29/29.1/share/info/emacs --prefix=3D/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=3D-Os -w -pipe -mmacosx-version-min=3D14 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -DFD_SETSIZE=3D10000 -DDARWIN_UNLIMITED_SELECT' 'CPPFLAGS=3D-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=3D-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'' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-doc-misc-eglot.texi-Fix-broken-function-calls.patch >From a2734a0c643e89afae5bc1b1e88776ff61cddb8e Mon Sep 17 00:00:00 2001 From: Slava Akhmechet 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 --=-=-=--