emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot a406190 07/45: Per #63: Allow function contacts t


From: João Távora
Subject: [elpa] externals/eglot a406190 07/45: Per #63: Allow function contacts to be interactive
Date: Thu, 22 Nov 2018 19:15:27 -0500 (EST)

branch: externals/eglot
commit a40619053fac04eec5f0909a168b4addd1973d47
Author: Michał K <address@hidden>
Commit: mkcms <address@hidden>

    Per #63: Allow function contacts to be interactive
    
    * eglot.el (eglot-server-programs): Mention that the function must
      accept one argument.
    (eglot--guess-contact): Pass to functional contacts the interactive
    value.
---
 eglot.el | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/eglot.el b/eglot.el
index 57d19b3..4376d3a 100644
--- a/eglot.el
+++ b/eglot.el
@@ -124,8 +124,14 @@ of those modes.  CONTACT can be:
   `jsonrpc-process-connection', which you should see for the
   semantics of the mandatory :PROCESS argument.
 
-* A function of no arguments producing any of the above values
-  for CONTACT.")
+* A function of a single argument producing any of the above
+  values for CONTACT.  The argument's value is non-nil if the
+  connection was requested interactively (e.g. from the `eglot'
+  command), and nil if it wasn't (e.g. from `eglot-ensure').  If
+  the call is interactive, the function can ask the user for
+  hints on finding the required programs, etc.  Otherwise, it
+  should not ask the user for any input, and return nil or signal
+  an error if it can't produce a valid CONTACT.")
 
 (defface eglot-mode-line
   '((t (:inherit font-lock-constant-face :weight bold)))
@@ -353,7 +359,9 @@ be guessed."
                             (lambda (m1 m2)
                               (or (eq m1 m2)
                                   (and (listp m1) (memq m2 m1)))))))
-         (guess (if (functionp guess) (funcall guess) guess))
+         (guess (if (functionp guess)
+                    (funcall guess interactive)
+                  guess))
          (class (or (and (consp guess) (symbolp (car guess))
                          (prog1 (car guess) (setq guess (cdr guess))))
                     'eglot-lsp-server))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]