dbordak / telephone-line

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

Disable telephone line in term-mode (or any major mode) #99

Closed ema2159 closed 5 years ago

ema2159 commented 5 years ago

Is there a way to do this? I don't like the way telephone line looks on my terminal (I use Shell Pop which pops up a terminal buffer down in the screen)

avalonwilliams commented 5 years ago

Replace your call to telephone-line-mode with this

(if (display-graphic-p)
    (telephone-line-mode 2))

This will only enable telephone-line-mode automatically when not running in a terminal.

ema2159 commented 5 years ago

That is not what I mean. I think its better to show you an image to be more clear telephone_line_screenshot ^ This is what I want to disable

avalonwilliams commented 5 years ago

Oh, my bad. In that case, the following should work according to the function documentation on it, but it isn't working on my machine, so I think it's a bug.

;; Replace foo-mode with whatever hook you want
(add-hook 'foo-mode-hook
          lambda ()
          (interactive)
          (telephone-line-mode -1))

But it seems as though, even after disabling the mode, the prompt won't become disabled. I think it's a bug.

Evaluating (telephone-line-mode -1) outside of this function using M-: results in it not hiding as well.

ema2159 commented 5 years ago

Yes, I tried that and didn't work either so let's hope somebody fix this! Anyway, thank you for your help!

dbordak commented 5 years ago

I think this not working is related to the early-buffer issues. Have you tried setting mode-line-format to nil in the relevant buffers?

ema2159 commented 5 years ago

I think this not working is related to the early-buffer issues. Have you tried setting mode-line-format to nil in the relevant buffers?

^This seems to work pretty fine.

The (telephone-line-mode) function should be fixed though!

dbordak commented 5 years ago

The (telephone-line-mode) function should be fixed though!

It's actually working as intended. To use it on a hook like that, it'd need to be a local mode -- In order for anyone to enable it, they'd need to hook it onto every mode. Since it's global, you can't use a hook to disable it either.

I could add another function to disable it in the current buffer, but there's no way I can make (telephone-line-mode) do that

ema2159 commented 5 years ago

I could add another function to disable it in the current buffer ^This sounds good, but shouldn't the (telephone-line-mode) function be called (telephone-line-global-mode) then?

dbordak commented 5 years ago

Possibly. That convention sorta exists, but AFAICT it's not used when the type of plugin is assumed to be global -- for instance, the other powerline plugins, ivy, helm, etc.