unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: 69605@debbugs.gnu.org
Subject: bug#69605: [PATCH] Query Eglot version via package.el
Date: Thu, 07 Mar 2024 09:23:47 +0000	[thread overview]
Message-ID: <87y1auo0nw.fsf@posteo.net> (raw)

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

             reply	other threads:[~2024-03-07  9:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07  9:23 Philip Kaludercic [this message]
2024-05-03  7:38 ` bug#69605: [PATCH] Query Eglot version via package.el 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

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=87y1auo0nw.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=69605@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).