abingham / emacs-ycmd

Emacs client for ycmd, the code completion system.
MIT License
383 stars 46 forks source link

Tiny modeline suggestion #453

Closed quicknir closed 6 years ago

quicknir commented 6 years ago

Using spacemacs, most other minor modes have some kind of nice (often unicode) character to represent being on. Ycmd uses, well, "ycmd" which is quite long and so on. It would be nice to allow the user to more easily customize this. I think this can be done by simply doing:

 (defun ycmd--mode-line-status-text ()
   "Get text for the mode line."
   (let ((force-semantic
          (when ycmd-force-semantic-completion "/s"))
         (text (pcase ycmd--last-status-change
                 (`parsed "")
                 (`parsing "*")
                 (`unparsed "?")
                 (`stopped "-")
                 (`starting ">")
                 (`errored "!"))))
     (concat ycmd-modeline-symbol force-semantic text)))

I.e. the same as the original code, just with ycmd-modeline-symbol replacing "ycmd". ycmd-modeline-symbol could be a customizable variable that defaults to "ycmd".

ptrv commented 6 years ago

See #454

quicknir commented 6 years ago

Wow thanks, that was quick! Just a quick question from the pr: I was surprised, but I guess there is probably a reason, to hard code a space before the customisable variable? I haven't had a chance to try this out and see how it will look.

abingham commented 6 years ago

I think the intent is so that "ycmd" is distinguishable from other modeline elements. But I think I see your point: with a single-character modeline for ycmd we won't want/need that space.

ptrv commented 6 years ago

I think you need the space also in spacemacs with single-character. The macro spacemacs|diminish is also always used with the space in the spacemacs config.

quicknir commented 6 years ago

Okay cool I had a feeling. I can't test this now, but if there are any issues I'll open a new issue. Thanks very much!

On Nov 11, 2017 1:38 PM, "Peter Vasil" notifications@github.com wrote:

I think you need the space also in spacemacs with single-character. The macro spacemacs|diminish is also always used with the space in the spacemacs config.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/abingham/emacs-ycmd/issues/453#issuecomment-343685267, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ-QCEoNiRpTwzZop2bQZaTf0wnMb_Jcks5s1em_gaJpZM4QaOpT .