From 9101970ccf77c755a12d20d147187cff20929df4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 15 Nov 2019 16:04:55 +0000 Subject: [PATCH] Ensure process starts in project's root Also fix https://github.com/joaotavora/eglot/issues/347. * eglot.el (eglot--connect): Bind default-directory around make process. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/330 --- lisp/progmodes/eglot.el | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 51d0dee140d..b30a236ed19 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -813,15 +813,17 @@ This docstring appeases checkdoc, that's all." (setq autostart-inferior-process inferior) connection)))) ((stringp (car contact)) - `(:process ,(lambda () - (make-process - :name readable-name - :command contact - :connection-type 'pipe - :coding 'utf-8-emacs-unix - :noquery t - :stderr (get-buffer-create - (format "*%s stderr*" readable-name)))))))) + `(:process + ,(lambda () + (let ((default-directory default-directory)) + (make-process + :name readable-name + :command contact + :connection-type 'pipe + :coding 'utf-8-emacs-unix + :noquery t + :stderr (get-buffer-create + (format "*%s stderr*" readable-name))))))))) (spread (lambda (fn) (lambda (server method params) (apply fn server method (append params nil))))) (server @@ -1961,7 +1963,9 @@ is not active." :textDocument/completion (eglot--CompletionParams) :deferred :textDocument/completion - :cancel-on-input t)) + :cancel-on-input (prog1 non-essential + (when non-essential + (message "OH IT'S NON ESSENTIAL"))))) (setq items (append (if (vectorp resp) resp (plist-get resp :items)) nil)) -- 2.39.2