]> git.eshelyaron.com Git - emacs.git/commitdiff
Ensure process starts in project's root
authorJoão Távora <joaotavora@gmail.com>
Fri, 15 Nov 2019 16:04:55 +0000 (16:04 +0000)
committerJoão Távora <joaotavora@gmail.com>
Fri, 15 Nov 2019 19:24:15 +0000 (19:24 +0000)
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

index 51d0dee140da2ebf442e83ad9b9a64fa35f6f8cb..b30a236ed19a0fa65a0593645c98394c11b195db 100644 (file)
@@ -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))