From: João Távora Date: Sun, 13 May 2018 22:22:31 +0000 (+0100) Subject: Fix automatic project creation X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~577 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9d0984c0cde87e71cea4729f6e6ca63bfbfa5814;p=emacs.git Fix automatic project creation * eglot.el (eglot): Take PROJECT arg. Return process. (eglot--interactive): Returns a project. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index c1b63ea6e3d..3d5d4927ece 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -292,6 +292,7 @@ INTERACTIVE is t if inside interactive call." "\n" base-prompt))))) (list managed-mode + (or (project-current) `(transient . default-directory)) (if prompt (split-string-and-unquote (read-shell-command prompt @@ -302,11 +303,13 @@ INTERACTIVE is t if inside interactive call." t))) ;;;###autoload -(defun eglot (managed-major-mode command &optional interactive) +(defun eglot (managed-major-mode project command &optional interactive) "Start a Language Server Protocol server. Server is started with COMMAND and manages buffers of MANAGED-MAJOR-MODE for the current project. +PROJECT is a project instance as returned by `project-current'. + COMMAND is a list of strings, an executable program and optionally its arguments. If the first and only string in the list is of the form \":\" it is taken as an @@ -323,8 +326,7 @@ MANAGED-MAJOR-MODE. INTERACTIVE is t if called interactively." (interactive (eglot--interactive)) - (let* ((project (project-current 'maybe)) - (short-name (eglot--project-short-name project))) + (let* ((short-name (eglot--project-short-name project))) (let ((current-process (eglot--current-process))) (if (and (process-live-p current-process) interactive @@ -339,7 +341,8 @@ INTERACTIVE is t if called interactively." interactive))) (eglot--message "Connected! Process `%s' now \ managing `%s' buffers in project `%s'." - proc managed-major-mode short-name)))))) + proc managed-major-mode short-name) + proc))))) (defun eglot-reconnect (process &optional interactive) "Reconnect to PROCESS.