From a0003aa19a96b350e0468a2f9c43a83d935727db Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Wed, 16 Aug 2017 12:50:20 +0100 Subject: [PATCH] Improve `eglot--current-process' --- lisp/progmodes/eglot.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 6e3a1365962..c7f8774d838 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/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)) -- 2.39.2