From: João Távora Date: Wed, 16 Aug 2017 11:50:20 +0000 (+0100) Subject: Improve `eglot--current-process' X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~700 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a0003aa19a96b350e0468a2f9c43a83d935727db;p=emacs.git Improve `eglot--current-process' --- 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))