From: João Távora Date: Fri, 6 Jul 2018 17:39:20 +0000 (+0100) Subject: Unbreak completion when no possible annotation X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~479 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d8a14e9ea84a7636f230ed4a9870b064f48d98fc;p=emacs.git Unbreak completion when no possible annotation * eglot.el (eglot-completion-at-point): Handle case where no doc, detail or kind. GitHub-reference: close https://github.com/joaotavora/eglot/issues/37 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 509fe6c88dc..fd633388452 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1225,11 +1225,14 @@ DUMMY is ignored." (lambda (obj) (cl-destructuring-bind (&key detail documentation kind &allow-other-keys) (text-properties-at 0 obj) - (concat " " (propertize - (or (and documentation - (replace-regexp-in-string "\n.*" "" documentation)) - detail (cdr (assoc kind eglot--kind-names))) - 'face 'font-lock-function-name-face)))) + (let ((annotation + (or (and documentation + (replace-regexp-in-string "\n.*" "" documentation)) + detail + (cdr (assoc kind eglot--kind-names))))) + (when annotation + (concat " " (propertize annotation + 'face 'font-lock-function-name-face)))))) :display-sort-function (lambda (items) (sort items (lambda (a b)