reddit / emacs

how to hide current symbol from modeline

gdanov · 2022-10-10 09:39
I'm using latest emacs, prelude, doom and lsp-mode after one of the last upgrades I started seeing the current symbol in the mode line, which is often too long. How do I get rid of it? Can't figure out which of the packages above contributed that
WallyMetropolis · 2022-10-10 14:25
What do you mean by the current symbol? Can you share a screenshot? Sometimes, the only way to suss these things out is to bisect your config.
thetemp_ · 2022-10-10 15:04
It sounds like you're talking about `which-function-mode`. It's supposed to show the symbol-name of the current defun in square brackets. This gives you a reminder of what you're working on, even if the first line of the defun block has scrolled off-screen. But sometimes it takes up most of the modeline, because it assumes that the second argument in a top-level block is the symbol-name of the defun. So if you have a top-level block of something like: (message "But I must explain to you how all this mistaken idea of reprobating pleasure and extolling pain arose. To do so, I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness.") It will treat the string as a symbol-name. And if you have anything on your modeline configured to appear to the right of `which-func-format`, it will be pushed out of view. You should be able to turn it off with `(which-function-mode -1)`. Alternatively, maybe there is a way to have it ignore or truncate strings or other items that exceed a certain length. Might be worth looking into, as it could be a useful feature to have sometimes.
akirakom · 2022-10-10 15:07
If you are using Doom Emacs, then it must be [hide-modeline-mode](https://github.com/hlissner/emacs-hide-mode-line).
MonsieurPi · 2022-10-10 16:00
If you're talking about the symbol at point, take a look at [this](https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/)
gdanov · 2022-10-10 19:39
bingo!