Skip to content

Add global minor modes for EXWM's features #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

Stebalien
Copy link
Contributor

(fixup commits before merging)

progfolio and others added 3 commits June 3, 2024 10:57
* exwm-core.el (exwm--define-global-minor-mode):
Macro for arranging EXWM mode hooks, logging.
* exwm-background.el: Add global mode definition
(exwm-background-enable): mark obsolete
* exwm-randr.el (randr): as above
(exwm-randr-enable): as above
* exwm-systemtray.el (systemtray): as above
(exwm-systemtray-mode): as above
* exwm-xim.el (xim): as above
(exwm-xim-enable): as above
* exwm-xsettings.el (xsettings): as above
(exwm-xsettings-enable): as above

Condition defcustom setters on global mode presence.
@Stebalien
Copy link
Contributor Author

This applies the feedback from #43.

Unfortunately, the autoloads aren't quite correct for minor modes and I'm not sure if there's a way to fix them while still using macros. Specifically, the autoloads should look something like:

(defvar exwm-systemtray-mode nil "....")
(custom-autoload exwm-systemtray-mode "exwm-systemtray" nil)
(autoload 'exwm-systemtray-mode "exwm-systemtray" "..." t)

Importantly, we're missing the custom-autoload which lets one enable minor-modes via the customize system.

@minad
Copy link
Member

minad commented Jun 4, 2024

Unfortunately, the autoloads aren't quite correct for minor modes and I'm not sure if there's a way to fix them while still using macros. Specifically, the autoloads should look something like:

Maybe a better alternative would be to not use a macro for the whole mode, but only for the body exwm--minor-mode-body? It could also be a function taking a symbol argument. We cannot automatically define the obsolete function then, but we side step the autoload problem.

@progfolio
Copy link
Collaborator

progfolio commented Jun 4, 2024

This applies the feedback from #43.

Unfortunately, the autoloads aren't quite correct for minor modes and I'm not sure if there's a way to fix them while still using macros. Specifically, the autoloads should look something like:

(defvar exwm-systemtray-mode nil "....")
(custom-autoload exwm-systemtray-mode "exwm-systemtray" nil)
(autoload 'exwm-systemtray-mode "exwm-systemtray" "..." t)

Importantly, we're missing the custom-autoload which lets one enable minor-modes via the customize system.

Anything after the autoload-cookie will be copied verbatim to the generated autoloads file.
e.g.

;;;###autoload(defvar exwm-xsettings-mode nil)
;;;###autoload(custom-autoload 'exwm-xsettings-mode "exwm-xsettings" nil)
;;;###autoload(autoload 'exwm-xsettings-mode "exwm-xsettings"
;;;###autoload"Global minor mode for toggling EXWM Xsettings support.")
(exwm--define-global-minor-mode xsettings
  "Global minor mode for toggling EXWM Xsettings support.")

@progfolio
Copy link
Collaborator

@Stebalien see #46

@minad
Copy link
Member

minad commented Jun 4, 2024

Merged #46

@minad minad closed this Jun 4, 2024
@Stebalien Stebalien deleted the feat/systemtray-mode branch January 3, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants