From 28b199c3448104161aa93ea0ec0732c367421c54 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sun, 20 May 2018 00:44:21 +0100 Subject: [PATCH] Fix a bug introduced in the previous commit * eglot.el (eglot--format-markup): Ignore errors when calling possibly unknown functions. (eglot-completion-at-point): Use eglot--format-markup (eglot--hover-info): Yak shaving --- lisp/progmodes/eglot.el | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 72e5d31473a..9d7253af26d 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -779,7 +779,8 @@ If optional MARKER, return a marker instead" (list (plist-get markup :value) (intern (concat (plist-get markup :language) "-mode" )))))) (with-temp-buffer - (funcall mode) (insert string) (font-lock-ensure) (buffer-string)))) + (ignore-errors (funcall mode)) + (insert string) (font-lock-ensure) (buffer-string)))) (defun eglot--server-capable (&rest feats) "Determine if current server is capable of FEATS." @@ -1324,10 +1325,7 @@ DUMMY is ignored" :documentation))))) (when documentation (with-current-buffer (get-buffer-create " *eglot doc*") - (erase-buffer) - (ignore-errors (funcall (intern "markdown-mode"))) - (font-lock-ensure) - (insert documentation) + (insert (eglot--format-markup documentation)) (current-buffer))))) :exit-function (lambda (_string _status) (eglot--signal-textDocument/didChange) @@ -1339,10 +1337,8 @@ DUMMY is ignored" (concat (and range (pcase-let ((`(,beg ,end) (eglot--range-region range))) (concat (buffer-substring beg end) ": "))) (mapconcat #'eglot--format-markup - (append (cond ((vectorp contents) - contents) - (contents - (list contents)))) "\n"))) + (append (cond ((vectorp contents) contents) + (contents (list contents)))) "\n"))) (defun eglot--sig-info (sigs active-sig active-param) (cl-loop -- 2.39.2