rougier / nano-emacs

GNU Emacs / N Λ N O - Emacs made simple
GNU General Public License v3.0
2.52k stars 194 forks source link

Correctly set per-window mode-line-format #104

Closed d4ncer closed 2 years ago

d4ncer commented 2 years ago

This sets mode-line-format as a window parameter rather than the default mode-line-format variable and doesn't override buffers that have mode-line-format already set locally (as do most child-frame buffers).

This means if you open the same buffer one on top of the other, the one on top correctly hides the mode line; the current logic that sets it via setq automatically sets it at the buffer level, regardless of window configuration.

This also fixes an issue with packages that use child-frames as they will often set mode-line-format as a buffer local variable when creating the buffer contents. I've tested it with the frames created by corfu & lsp-ui-doc and both work as expected.

rougier commented 2 years ago

Thanks for the report and the fix. I did not encounter the problem myself and I did not know you could set mode-line-format at window level.

Not related, but I saw on the screenhot you posted on corfu that you have a thin one pixel border on your frame on OSX and for some reason, I've a hard time setting such border. Did you do something special to get them? One problem for me is that I'm using large border on all my window and I'm unable to set the color on each frame independently.

rougier commented 2 years ago

Forget to ask: could you also make the PR on nano-modeline which is on ELPA. You would need to sign the copyright assignment if not yet done.

d4ncer commented 2 years ago

Thanks for the report and the fix. I did not encounter the problem myself and I did not know you could set mode-line-format at window level.

You should be able to replicate it pre-fix by opening the same buffer in two windows, one on top of the other. The window on top will have the 1px gray modline even though it shouldn't. I didn't realise you could set it either, but went down a rabbit hole to better understand the various ways modeline could be set. Glad I did :)

Not related, but I saw on the screenhot you posted on corfu that you have a thin one pixel border on your frame on OSX and for some reason, I've a hard time setting such border. Did you do something special to get them? One problem for me is that I'm using large border on all my window and I'm unable to set the color on each frame independently.

Hmm, nothing special. Here is the relevant code that achieves that border. Are you setting your border for all frames? If so, that might be the issue.

d4ncer commented 2 years ago

Forget to ask: could you also make the PR on nano-modeline which is on ELPA. You would need to sign the copyright assignment if not yet done.

Surely. I haven't assigned copyright before, will look into the process tomorrow.