]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve `eglot--current-process'
authorJoão Távora <joaotavora@gmail.com>
Wed, 16 Aug 2017 11:50:20 +0000 (12:50 +0100)
committerJoão Távora <joaotavora@gmail.com>
Wed, 16 Aug 2017 12:52:00 +0000 (13:52 +0100)
lisp/progmodes/eglot.el

index 6e3a1365962a28f4333347e90829e3aabc84ab05..c7f8774d8387b64f70fbf1cc134937509a776556 100644 (file)
 (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))