unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#69605: [PATCH] Query Eglot version via package.el
@ 2024-03-07  9:23 Philip Kaludercic
  2024-05-03  7:38 ` Philip Kaludercic
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Kaludercic @ 2024-03-07  9:23 UTC (permalink / raw)
  To: 69605

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

It seems to me that 'package-get-version' should already implement the
logic which is currently being reproduced when defining the constant
'eglot--version', so I suggest the following simplification:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] Query Eglot version via package.el --]
[-- Type: text/x-patch, Size: 1725 bytes --]

From 7566857ae869eb4cf01bde527eaedb8a3353f035 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Thu, 7 Mar 2024 10:21:45 +0100
Subject: [PATCH] Query Eglot version via package.el

* lisp/progmodes/eglot.el (eglot--version): Remove constant.
(eglot--connect): Use 'package-get-version'.
---
 lisp/progmodes/eglot.el | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index f341428cac3..1ec186e75f8 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -545,13 +545,6 @@ 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")
@@ -1585,8 +1578,10 @@ eglot--connect
                                             'network))
                               (emacs-pid))
                             :clientInfo
-                            `(:name "Eglot" ,@(when eglot--version
-                                                `(:version ,eglot--version)))
+                            (append
+                             '(:name "Eglot")
+                             (let ((v (package-get-version)))
+                               (and v (list :version v))))
                             ;; Maybe turn trampy `/ssh:foo@bar:/path/to/baz.py'
                             ;; into `/path/to/baz.py', so LSP groks it.
                             :rootPath (file-local-name
-- 
2.44.0


[-- Attachment #3: Type: text/plain, Size: 37 bytes --]


-- 
	Philip Kaludercic on peregrine

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

end of thread, other threads:[~2024-05-18 22:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-07  9:23 bug#69605: [PATCH] Query Eglot version via package.el Philip Kaludercic
2024-05-03  7:38 ` Philip Kaludercic
2024-05-03 11:54   ` João Távora
2024-05-03 18:13     ` Philip Kaludercic
2024-05-18 22:27       ` Stefan Kangas
2024-05-18 22:30         ` Philip Kaludercic

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).