0

Trying to get the modeline to show the current c++ function point is in, I modified my modeline in the following way:

    (setq-default mode-line-format
              (quote
               (#(" " 0 1
              ())
            mode-line-modified
            "    "
            mode-line-buffer-identification
            "    "
            (line-number-mode "%l/")
            (:eval (number-to-string (count-lines (point-min) (point-max))))        
            "    "
            mode-line-misc-info
            "    "
            )))

All is fine, except that now also [eglot:project] is shown in the modeline which I don't want. How can I remove that but keep the function name information (included in mode-line-misc-info)?

The value of mode-line-misc-info as reported by C-h v is:

((eglot--managed-mode (" [" eglot--mode-line-format "] ")) (which-function-mode (which-func-mode (#1="" which-func-format " "))) (global-mode-string (#1# global-mode-string)))
NickD
  • 27,023
  • 3
  • 23
  • 42
CD86
  • 543
  • 2
  • 9
  • What is the value of `mode-line-misc-info`? Do `C-h v mode-line-misc-info` to get it and add it to your question. – NickD May 04 '23 at 21:31
  • mode-line-misc-info is a variable defined in ‘bindings.el’. Its value is ((eglot--managed-mode (" [" eglot--mode-line-format "] ")) (which-function-mode (which-func-mode (#1="" which-func-format " "))) (global-mode-string (#1# global-mode-string))) – CD86 May 05 '23 at 09:39
  • So what happens if you get rid of the first element of `mode-line-misc-info` by evaluating the following form: `(setq mode-line-misc-info (cdr mode-line-misc-info))`. Does that look more like what you want? N.B. untested and no warranty is provided: you might want to do that in a throw-away session of Emacs, just in case. – NickD May 05 '23 at 12:59

0 Answers0