unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Felician Nemeth <felician.nemeth@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: 62198@debbugs.gnu.org, Alan Donovan <adonovan@google.com>
Subject: bug#62198: eglot feature request: set Initialize.ClientInfo.{Name, Version}
Date: Sat, 15 Jul 2023 12:18:11 +0200	[thread overview]
Message-ID: <87351psckc.fsf@betli.tmit.bme.hu> (raw)
In-Reply-To: <CALDnm51po1gVjuHxdKYs7P97QDrj3G7x0xaKuVqOsi3=XtGoqQ@mail.gmail.com> ("João Távora"'s message of "Thu, 29 Jun 2023 17:02:44 +0100")

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

>> If Eglot is installed, then it is byte-compiled as well.  The earlier
>> patch in this bug report made sure that the helper library ('lisp-mnt)
>> was required only at compile time.  However, the patch worked even if
>> Eglot was not installed with package.el (but Eglot still needed to be
>> byte-compiled).

> I thinkt the lisp-mnt-at-compile-time solution is preferable, as I'm
> not sure 'eglot always lives in package-alist (sometimes it is a
> built-in and that is a royal pain).  Can you show an
> updated patch for it, when you have time, Felicián?

I've attached the updated patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Eglot-send-version-in-clientInfo-bug-62198.patch --]
[-- Type: text/x-diff, Size: 1719 bytes --]

From df775108a9d0c5171ca6eeb19af752bec15c626a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felici=C3=A1n=20N=C3=A9meth?= <felician.nemeth@gmail.com>
Date: Sat, 15 Jul 2023 12:02:49 +0200
Subject: [PATCH] Eglot: send version in clientInfo (bug#62198)

* lisp/progmodes/eglot.el (eglot--version): New defconst.
(eglot--connect): Use it.
---
 lisp/progmodes/eglot.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 8ac21638a5..0da4641fba 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -421,6 +421,14 @@ eglot-withhold-process-id
 \f
 ;;; Constants
 ;;;
+(defconst eglot--version
+  (eval-when-compile
+    (when byte-compile-current-file
+      (require 'lisp-mnt)
+      (lm-version byte-compile-current-file)))
+  "The version as a string of this version of Eglot.
+It is nil if Eglot is not byte-complied.")
+
 (defconst eglot--symbol-kind-names
   `((1 . "File") (2 . "Module")
     (3 . "Namespace") (4 . "Package") (5 . "Class")
@@ -1352,7 +1360,9 @@ eglot--connect
                                         (eq (jsonrpc-process-type server)
                                             'network))
                               (emacs-pid))
-                            :clientInfo '(:name "Eglot")
+                            :clientInfo
+                            `(:name "Eglot" ,@(when eglot--version
+                                                `(:version ,eglot--version)))
                             ;; Maybe turn trampy `/ssh:foo@bar:/path/to/baz.py'
                             ;; into `/path/to/baz.py', so LSP groks it.
                             :rootPath (file-local-name
-- 
2.39.2


  reply	other threads:[~2023-07-15 10:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAPVWWDWmV3A1GhzvHFQhu2dz171ghgdwBRrtZbzWJP1ojiiO4w@mail.gmail.com>
     [not found] ` <CALDnm52Jo8kQJtmLgDXHHdZWJ=OES4a2GGGU-U1VaObdN+fEBg@mail.gmail.com>
     [not found]   ` <CAPVWWDWCTvjzG3CLffnaf_xgn4R-Y8=j9y3to0yCEhoAt0gPMA@mail.gmail.com>
2023-06-28 21:02     ` bug#62198: eglot feature request: set Initialize.ClientInfo.{Name, Version} João Távora
2023-06-29 15:46       ` Felician Nemeth
2023-06-29 16:02         ` João Távora
2023-07-15 10:18           ` Felician Nemeth [this message]
2023-08-03  7:39             ` Eli Zaretskii
2023-08-03 10:15               ` João Távora
2023-08-03 10:20                 ` Eli Zaretskii

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=87351psckc.fsf@betli.tmit.bme.hu \
    --to=felician.nemeth@gmail.com \
    --cc=62198@debbugs.gnu.org \
    --cc=adonovan@google.com \
    --cc=joaotavora@gmail.com \
    /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).