branch: externals/elpa
commit 0222e7e88be45a86f0428e9b4a38ea6974c6337f
Author: João Távora <joaotav...@gmail.com>
Commit: João Távora <joaotav...@gmail.com>

    Improve `eglot--current-process'
---
 eglot.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/eglot.el b/eglot.el
index 6e3a136..c7f8774 100644
--- a/eglot.el
+++ b/eglot.el
@@ -41,13 +41,14 @@
 (defun eglot--current-process ()
   "The current logical EGLOT process"
   (let ((cur (project-current)))
-    (unless cur
-      (eglot--error "No current project, so no process"))
-    (gethash cur eglot--processes-by-project)))
+    (and cur
+         (gethash cur eglot--processes-by-project))))
 
 (defun eglot--current-process-or-lose ()
   (or (eglot--current-process)
-      (eglot--error "No current EGLOT process")))
+      (eglot--error "No current EGLOT process%s"
+                    (if (project-current) ""
+                      " (Also no current project)"))))
 
 (defmacro eglot--define-process-var (var-sym initval &optional doc)
   (declare (indent 2))

Reply via email to