dbordak / telephone-line

A new implementation of Powerline for Emacs
GNU General Public License v3.0
554 stars 51 forks source link

How to show and hide segments dynamically? #56

Closed shackra closed 6 years ago

shackra commented 6 years ago

I have the Python virtualenv environment shown on my mode-line with telephone-line, but when no environment is activated, I get a orange empty separator.

From your experience, what can you suggest to show and hide segments on telephone-line dynamically under certain conditions?

dbordak commented 6 years ago

Are you asking about hiding entire supersegments? Like, an entire color? If so, that's not possible and it'd be very difficult to implement -- There's too much pre-rendering done on a low level.

shackra commented 6 years ago

Well, yes. But I was having in mind a way to manipulate the variable that holds the segments as it seems more straightforward

dbordak commented 6 years ago

No, like I said, it's pre-rendered -- changing those variables won't do anything until you load a new buffer.

dbordak commented 6 years ago

I guess for this specific case, you could set this by major mode -- Enable the entire supersegment for python (whether you're in a venv or not) and disable it otherwise. Would that work?

shackra commented 6 years ago

Let me try that and I'll be back with you in a couple of days!

shackra commented 6 years ago

I went on a easier route: Will leave it always on.