emacs-exwm / exwm

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

Add exwm-minor-mode #53

Open progfolio opened 5 months ago

progfolio commented 5 months ago

Previous pull: https://github.com/ch11ng/exwm/pull/868

@medranocalvo Has already given blessing for someone to pick up this work.

There was some discussion regarding restoring a replaced window manager when exwm-mode is disabled. My suggestion would be to add a function to exwm-exit-functions which covers the cases we know we can replace easily and leave it up to the user to add such a function for cases we can't predict or reliably restore. Regardless, I think moving to a mode and away from "exwm-enable" is important.

Stebalien commented 5 months ago

My suggestion would be to add a function to exwm-exit-functions which covers the cases we

IMO, the user should use the minor mode hook.

minad commented 5 months ago

Just bike shedding, but do you have any other suggestions for a better mode name? I would have preferred exwm-window-mode (or exwm-buffer-mode) for exwm buffers and exwm-mode for the global window manager mode, but I think it is too late to change this now. Maybe exwm-wm-mode or even the verbose exwm-window-manager-mode for the global minor mode?

ethanmoss1 commented 5 months ago

Just playing devils advocate, shouldnt there just be hooks that are available the user to initalise another window manager if they really want. Correct me if im wrong but usually when closing a window manager not in a DE youre thrown out of the session. As for in a DE, usually the WM is restarted.

As for a name if deciding to go ahead im for verbosity over shortned names, helps when learning.

minad commented 5 months ago

@ethanmoss1 Yes, you can use the exwm-window-manager-mode-hook to run code during initialization and during shutdown, so one could in principle start another window manager there. But why would you? Just stick with EXWM ;)

ethanmoss1 commented 5 months ago

There are other window managers other than EXWM?! ;)

In that case, clear documentation and examples would be better that trying to guess how a user wants another window manager to take over from. IMO, thoughts?

Stebalien commented 5 months ago

Yeah, changing the per buffer mode would be nice but there's no graceful transition.

exwm-wm-mode isn't bad, tbh.

progfolio commented 5 months ago

Just bike shedding, but do you have any other suggestions for a better mode name?

Perhaps exwm-client-mode for the global minor mode?

medranocalvo commented 5 months ago

@medranocalvo Has already given blessing for someone to pick up this work.

Definitely, thank you.

There was some discussion regarding restoring a replaced window manager when exwm-mode is disabled. My suggestion would be to add a function to exwm-exit-functions which covers the cases we know we can replace easily and leave it up to the user to add such a function for cases we can't predict or reliably restore. Regardless, I think moving to a mode and away from "exwm-enable" is important.

This issue is tangential. The difficulty is that we must manually compile a database (alist) of commands to restart the previous WM. (This should be discussed in a separate ticket.)

Just bike shedding, but do you have any other suggestions for a better mode name? I would have preferred exwm-window-mode (or exwm-buffer-mode) for exwm buffers and exwm-mode for the global window manager mode, but I think it is too late to change this now. Maybe exwm-wm-mode or even the verbose exwm-window-manager-mode for the global minor mode?

Oh, yes. I would definitely prefer that. I was not brave enough before... but now I can blame you! Ehem... We are in version 0.X.

My proposal is:

minad commented 5 months ago

medranocalvo @.***> writes:

  • exwm: the EXWM global minor mode

I'd prefer if we adhere to the naming convention *-mode for modes. This makes them a little easier to spot, and it is more aligned with user expectations.

medranocalvo commented 5 months ago

medranocalvo @.***> writes:

  • exwm: the EXWM global minor mode

I'd prefer if we adhere to the naming convention *-mode for modes. This makes them a little easier to spot, and it is more aligned with user expectations.

Yes, you are right.

Then, how about:

In any case, this is only aesthetics.

minad commented 5 months ago

medranocalvo @.***> writes:

medranocalvo @.***> writes:

  • exwm: the EXWM global minor mode

I'd prefer if we adhere to the naming convention *-mode for modes. This makes them a little easier to spot, and it is more aligned with user expectations.

Yes, you are right.

Then, how about:

  • accept exwm-wm-mode (despite the redundancy... :-/)
  • obsolete exwm-mode in favor of exwm-x-window-mode (or similar). Is it possible to do this so that user configurations keep working but they receive a warning?
  • After a couple of releases/years obsolete exwm-wm-mode in favour of exwm-mode.

In any case, this is only aesthetics.

Yes, this is more or less the plan. We could also go the simpler route, keeping exwm-mode as is and only introduce the new exwm-wm-mode. There isn't much value in renamings, except if they lead to more consistency.

progfolio commented 5 months ago

exwm-mode as is and only introduce the new exwm-wm-mode.

Personally, I'm not a fan of the name "exwm-wm-mode". The only thing I could think of was "exwm-client-mode", but I'm not too hot on that either (though I do think it's clearer than the former).

minad commented 5 months ago

I consider exwm-client-mode misleading, not meaningful enough. What about exwm-manager-mode or exwm-desktop-mode? I still find exwm-wm-mode best, since that's what it is, a mode controlling the window manager.

progfolio commented 5 months ago

I consider exwm-client-mode misleading, not meaningful enough. What about exwm-manager-mode or exwm-desktop-mode? I still find exwm-wm-mode best, since that's what it is, a mode controlling the window manager.

Fair enough. Of your suggestions exwm-wm-mode is best.