Skip to content

Commit

Permalink
Fix joaotavora/eglot#236: much less noisy mode line
Browse files Browse the repository at this point in the history
* eglot.el (eglot--mode-line-format): Simplify.
  • Loading branch information
joaotavora committed Oct 5, 2019
1 parent ba3a538 commit 708e31f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lisp/progmodes/eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ Uses THING, FACE, DEFS and PREPEND."
(nick (and server (eglot--project-nickname server)))
(pending (and server (hash-table-count
(jsonrpc--request-continuations server))))
(`(,_id ,doing ,done-p ,detail) (and server (eglot--spinner server)))
(`(,_id ,doing ,done-p ,_detail) (and server (eglot--spinner server)))
(last-error (and server (jsonrpc-last-error server))))
(append
`(,(eglot--mode-line-props "eglot" 'eglot-mode-line nil))
Expand All @@ -1332,15 +1332,13 @@ Uses THING, FACE, DEFS and PREPEND."
(format "An error occured: %s\n" (plist-get last-error
:message)))))
,@(when (and doing (not done-p))
`("/" ,(eglot--mode-line-props
(format "%s%s" doing
(if detail (format ":%s" detail) ""))
'compilation-mode-line-run '())))
`("/" ,(eglot--mode-line-props doing
'compilation-mode-line-run '())))
,@(when (cl-plusp pending)
`("/" ,(eglot--mode-line-props
(format "%d outstanding requests" pending) 'warning
(format "%d" pending) 'warning
'((mouse-3 eglot-forget-pending-continuations
"fahgettaboudit"))))))))))
"forget pending continuations"))))))))))

(add-to-list 'mode-line-misc-info
`(eglot--managed-mode (" [" eglot--mode-line-format "] ")))
Expand Down

0 comments on commit 708e31f

Please sign in to comment.