emacs-exwm / exwm

Emacs X Window Manager
https://elpa.gnu.org/packages/exwm.html
GNU General Public License v3.0
278 stars 14 forks source link

Disable position indicator in EXWM buffers #82

Closed Stebalien closed 1 month ago

Stebalien commented 1 month ago
Stebalien commented 1 month ago

This is a bit opinionated but it seems like a reasonable default and it slightly simplifies my personal config.

minad commented 1 month ago

@Stebalien Thanks. I would also like to simplify my config slightly regarding the mode line. I prefer if we make the whole format customizable. We can introduce an exwm-mode-line-format variable which we use as override if non-nil. There are multiple other mode line fields which are not useful in the context of EXWM. For example I use this in my config:

(setq-local mode-line-format '("%e" mode-line-front-space
                               mode-line-buffer-identification "   "
                               mode-line-modes "   "
                               mode-line-misc-info "   "))

Would such a customization variable work for you too? We could even set a reasonable default along these lines.

Stebalien commented 1 month ago

I would generally prefer it if EXWM didn't mess with the rest of my mode-line. I'm also pretty sure that would interfere with, e.g., doom-modeline users.

minad commented 1 month ago

I would generally prefer it if EXWM didn't mess with the rest of my mode-line. I'm also pretty sure that would interfere with, e.g., doom-modeline users.

Yes, but it wouldn't do that if exwm-mode-line-format is set to nil. I am not fond of individually disabling elements, since I consider this more interference with the buffer state.

I just looked at the mode-line-format default value. It is quite complex with many additional variables which should be disabled in addition to the position information only (mule, remote, frame identification, ...).

In any case, if setting the complete mode line wouldn't work for you or users of special mode lines, then maybe this suggests that we we should just stay out of the mode line business completely? The mode lines are a common thing which users start to tweak in their configuration. The fewer cooks in the kitchen the better.

Stebalien commented 1 month ago

I don't feel strongly about merging this, no. But I do want to note that setting individual components on a per-mode basis has some precedent (e.g., doc-view/pdf-tools sets mode-line-position).

Of course, then there are packages like mpc that just mess with the entire mode line which is exactly what I'm arguing against doing here...

So yeah, let's just leave well enough alone.

minad commented 1 month ago

Hmm, I think I've changed my opinion. Or rather I try to be consistent. ;)

https://github.com/minad/osm/blob/2ba02faed5d57da97c1f6e13df36091d68ddefee/osm.el#L876

Maybe we can also identify additional elements which could be set to nil in graphical modes like EXWM or osm.el, where the usual buffer information doesn't apply.

I've also found some other inconsistencies. osm.el doesn't set the default-directory, which it probably should do similar to EXWM since the map display is somehow not connected to a directory and should rather default to /~ like EXWM.

EDIT: So I think all the following variables could (should?) be set in EXWM-like buffers. Do you see a reason to not setting them, in contrast to mode-line-position?

(setq-local mode-line-position nil
            mode-line-modified nil
            mode-line-mule-info nil
            mode-line-remote nil
            default-directory (expand-file-name "~/")) ;; For EXWM we do something smarter via procfs.

EDIT2: You've mentioned docview. It modifies mode-line-position in a different way - it sets it to the page number, so this makes sense. It leaves the rest of the settings alone. Similarly pdf-tools.

Stebalien commented 1 month ago

100% agree. It'll slightly break my custom mode-line-modified indicator, but that was a hack anyways...

EDIT2: You've mentioned docview. It modifies mode-line-position in a different way - it sets it to the page number, so this makes sense. It leaves the rest of the settings alone. Similarly pdf-tools.

Yep. In the case of EXWM, my thinking is that there really isn't a reasonable format (well, I guess we could specify floating/tiling but that should be pretty obvious to the user).

Stebalien commented 1 month ago

Want to submit a patch or should I?

Stebalien commented 1 month ago

https://github.com/emacs-exwm/exwm/pull/83

minad commented 1 month ago

Thanks!