From: João Távora Date: Fri, 15 Nov 2019 16:04:55 +0000 (+0000) Subject: Ensure process starts in project's root X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~273 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9101970ccf77c755a12d20d147187cff20929df4;p=emacs.git 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 --- 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))