]> git.eshelyaron.com Git - emacs.git/commit
Eglot: declare eglot-lsp-context bound to non-nil
authorJoão Távora <joaotavora@gmail.com>
Fri, 22 Dec 2023 23:53:23 +0000 (17:53 -0600)
committerEshel Yaron <me@eshelyaron.com>
Sat, 23 Dec 2023 07:14:28 +0000 (08:14 +0100)
commit49ae3ecf3118e16dec8dcd8f9cfbb96cda78cbad
tree557d72b19f75ae9a394bad798da587516d56245f
parent94cdf8da256f061d44cee409ae3dd3661d435cda
Eglot: declare eglot-lsp-context bound to non-nil

Otherwise, it'll be really hard to use it in the recommended fashion:

  (defun my/project-find-function (dir)
    (when-let ((match
                (and (bound-and-true-p eglot-lsp-context)
                     (locate-dominating-file dir "some-marker-file"))))
      `(transient . ,match)))

  (add-hook 'project-find-functions #'my/project-find-function)

because 'bound-and-true-p' will never return t even when the hook is called
from eglot--current-project.

Github-reference: https://github.com/joaotavora/eglot/discussions/1336
Github-reference: https://github.com/joaotavora/eglot/discussions/1337

* lisp/progmodes/eglot.el (eglot-lsp-context): Declare normally.

(cherry picked from commit 9cb85e950dac77b59d48d320c7d40689d019aad4)
lisp/progmodes/eglot.el