From: Felicián Németh Date: Fri, 22 Nov 2019 17:35:01 +0000 (+0100) Subject: Make a public reader for project-nickname X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~250 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e81e6a24adf9eaaab0e31c4056ae7bef7a94db72;p=emacs.git Make a public reader for project-nickname Close https://github.com/joaotavora/eglot/issues/399. * eglot.el (eglot-lsp-server): Add a public reader for project-nickname as eglot-project-nickname. (eglot--connect, eglot--read-server, eglot--mode-line-format): Use the public variant. GitHub-reference: per https://github.com/joaotavora/eglot/issues/354 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 4c65af0a24c..8d1d2d71574 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -536,7 +536,8 @@ treated as in `eglot-dbind'." (defclass eglot-lsp-server (jsonrpc-process-connection) ((project-nickname :documentation "Short nickname for the associated project." - :accessor eglot--project-nickname) + :accessor eglot--project-nickname + :reader eglot-project-nickname) (major-mode :documentation "Major mode symbol." :accessor eglot--major-mode) @@ -906,7 +907,7 @@ in project `%s'." (or (plist-get serverInfo :name) (jsonrpc-name server)) managed-major-mode - (eglot--project-nickname server)) + (eglot-project-nickname server)) (when tag (throw tag t)))) :timeout eglot-connect-timeout :error-fn (eglot--lambda ((ResponseError) code message) @@ -1172,7 +1173,7 @@ and just return it. PROMPT shouldn't end with a question mark." being hash-values of eglot--servers-by-project append servers)) (name (lambda (srv) - (format "%s/%s" (eglot--project-nickname srv) + (format "%s/%s" (eglot-project-nickname srv) (eglot--major-mode srv))))) (cond ((null servers) (eglot--error "No servers!")) @@ -1388,7 +1389,7 @@ Uses THING, FACE, DEFS and PREPEND." (defun eglot--mode-line-format () "Compose the EGLOT's mode-line." (pcase-let* ((server (eglot-current-server)) - (nick (and server (eglot--project-nickname server))) + (nick (and server (eglot-project-nickname server))) (pending (and server (hash-table-count (jsonrpc--request-continuations server)))) (`(,_id ,doing ,done-p ,_detail) (and server (eglot--spinner server)))