dbordak / telephone-line

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

Add ability to target header-line #133

Closed gagbo closed 1 year ago

gagbo commented 1 year ago

Hello,

Here is a small patch that adds a custom variable allowing to ask telephone-line to render in the header-line instead of the mode-line, in the spirit of nano-emacs I'm trying to see how it goes with a header-line instead of a mode-line.

(If you want to test:

(setq telephone-line-target 'header-line)
(setq-default mode-line-format nil)

)

gagbo commented 1 year ago

This makes the tab-bar invisible in my setup, I'll need to figure this out first

dbordak commented 1 year ago

Let me know when you figure that out, I like the idea.

gagbo commented 1 year ago

I think the tab-bar was only invisible because of an Emacs bug, even with telephone-line in the mode-line, when I have (internal-border-width . 20) in my default-frame-alist the tab-bar becomes invisible (or rather, Emacs redraws the internal border over the tab-bar). I'll need to make a proper repro case for the mailing list, but it's not related to the patch.

The other thing that I wanted to check out was "what happens if a package also wants to put stuff in the header-line ?". I tested with lsp-mode breadcrumbs feature and telephone-line gets concatenated after the breadcrumb. So it's a little weird, but multiple packages can live together on the header-line. I'll redo a review of the patch here and undraft this later this week

gagbo commented 1 year ago

It should be fine actually.

gagbo commented 1 year ago

For the record, it looks like that when you also have to live with other packages that force header-line usage https://i.imgur.com/8Rh7qeU.png

So, while this PR is nice to help make telephone-line a good citizen, some extra hackery might be necessary to achieve a proper swap of lines as I envisioned