]> git.eshelyaron.com Git - emacs.git/commit
Robustify Eglot for "transient" projects
authorJoão Távora <joaotavora@gmail.com>
Sat, 4 Mar 2023 12:49:00 +0000 (12:49 +0000)
committerJoão Távora <joaotavora@gmail.com>
Sat, 4 Mar 2023 12:49:00 +0000 (12:49 +0000)
commit0bfba49ca7cf90e841c076d6db9bb3826e7b6a57
tree256eb1f8f68d135b0a1b27a6de669301caef8c46
parentea5fd375bb2656562f57325b3d5c6fd17f6b2e72
Robustify Eglot for "transient" projects

When Eglot needs to synthesize a "transient" project for
default-directory sometimes the value of that variable is set to an
unexpanded value, sometimes not.  This can cause simple invocations
like.

   Emacs -Q ~/path/to-some-python-file.py -f eglot

to fail, because eglot--current-server will be looking for a project
in the registry called

    (transient . "~/path")

where in reality it is stored there as

    (transient . "/home/someuser/path")

The fix is to always expand default-directory in eglot--current-project.

* lisp/progmodes/eglot.el (eglot--current-project): Use
expand-file-name.
lisp/progmodes/eglot.el