mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-27 14:57:59 +01:00
define the deprecated enable functions with the macro
This commit is contained in:
parent
74e4443a08
commit
514db268c2
6 changed files with 24 additions and 53 deletions
|
@ -194,13 +194,6 @@ may kill this connection when they replace it.")
|
||||||
(exwm--define-global-minor-mode background
|
(exwm--define-global-minor-mode background
|
||||||
"Global minor mode for toggling EXWM background support.")
|
"Global minor mode for toggling EXWM background support.")
|
||||||
|
|
||||||
(defun exwm-background-enable ()
|
|
||||||
"Enable background support for EXWM."
|
|
||||||
(add-hook 'exwm-init-hook #'exwm-background-mode)
|
|
||||||
(add-hook 'exwm-exit-hook (apply-partially #'exwm-background-mode -1))
|
|
||||||
(when exwm--connection (exwm-background-mode)))
|
|
||||||
(make-obsolete #'exwm-background-enable "Use `exwm-background-mode' instead." "0.40")
|
|
||||||
|
|
||||||
(provide 'exwm-background)
|
(provide 'exwm-background)
|
||||||
|
|
||||||
;;; exwm-background.el ends here
|
;;; exwm-background.el ends here
|
||||||
|
|
42
exwm-core.el
42
exwm-core.el
|
@ -412,24 +412,30 @@ One of `line-mode' or `char-mode'.")
|
||||||
"Define global minor mode named exwm-NAME-mode.
|
"Define global minor mode named exwm-NAME-mode.
|
||||||
EXWM's init-hook and exit-hook are modified to call INIT and EXIT functions.
|
EXWM's init-hook and exit-hook are modified to call INIT and EXIT functions.
|
||||||
If an X connection exists, the mode is immediately enabled or disabled."
|
If an X connection exists, the mode is immediately enabled or disabled."
|
||||||
(declare (indent 1) (debug t))
|
(declare (doc-string 2) (indent 1) (debug t))
|
||||||
(let ((mode (intern (format "exwm-%s-mode" name)))
|
(let* ((mode (intern (format "exwm-%s-mode" name)))
|
||||||
(init (or init (intern (format "exwm-%s--init" name))))
|
(enable (intern (format "exwm-%s-enable" name)))
|
||||||
(exit (or exit (intern (format "exwm-%s--exit" name)))))
|
(enabledoc (format "Enable %s support for EXWM." name))
|
||||||
`(define-minor-mode ,mode
|
(deprecation (format "Use `%s' instead." mode))
|
||||||
,doc
|
(init (or init (intern (format "exwm-%s--init" name))))
|
||||||
:global t
|
(exit (or exit (intern (format "exwm-%s--exit" name)))))
|
||||||
:group 'exwm
|
`(prog1
|
||||||
(exwm--log)
|
(define-minor-mode ,mode
|
||||||
(cond
|
,doc
|
||||||
(,mode
|
:global t
|
||||||
(add-hook 'exwm-init-hook #',init)
|
:group 'exwm
|
||||||
(add-hook 'exwm-exit-hook #',exit)
|
(exwm--log)
|
||||||
(when exwm--connection (,init)))
|
(cond
|
||||||
(t
|
(,mode
|
||||||
(remove-hook 'exwm-init-hook #',init)
|
(add-hook 'exwm-init-hook #',init)
|
||||||
(remove-hook 'exwm-exit-hook #',exit)
|
(add-hook 'exwm-exit-hook #',exit)
|
||||||
(when exwm--connection (,exit)))))))
|
(when exwm--connection (,init)))
|
||||||
|
(t
|
||||||
|
(remove-hook 'exwm-init-hook #',init)
|
||||||
|
(remove-hook 'exwm-exit-hook #',exit)
|
||||||
|
(when exwm--connection (,exit)))))
|
||||||
|
(defun ,enable () ,enabledoc (,mode 1))
|
||||||
|
(make-obsolete #',enable ,deprecation "0.40"))))
|
||||||
|
|
||||||
|
|
||||||
(provide 'exwm-core)
|
(provide 'exwm-core)
|
||||||
|
|
|
@ -360,13 +360,6 @@ Refresh when any RandR 1.5 monitor changes."
|
||||||
(exwm--define-global-minor-mode randr
|
(exwm--define-global-minor-mode randr
|
||||||
"Global minor mode for toggling EXWM RandR support.")
|
"Global minor mode for toggling EXWM RandR support.")
|
||||||
|
|
||||||
(defun exwm-randr-enable ()
|
|
||||||
"Enable RandR support for EXWM."
|
|
||||||
(add-hook 'exwm-init-hook #'exwm-randr-mode)
|
|
||||||
(add-hook 'exwm-exit-hook (apply-partially #'exwm-randr-mode -1))
|
|
||||||
(when exwm--connection (exwm-randr-mode)))
|
|
||||||
(make-obsolete #'exwm-randr-enable "Use `exwm-randr-mode' instead." "0.40")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'exwm-randr)
|
(provide 'exwm-randr)
|
||||||
|
|
|
@ -686,13 +686,6 @@ Argument DATA contains the raw event data."
|
||||||
(exwm--define-global-minor-mode systemtray
|
(exwm--define-global-minor-mode systemtray
|
||||||
"Global minor mode for toggling EXWM systemtray.")
|
"Global minor mode for toggling EXWM systemtray.")
|
||||||
|
|
||||||
(defun exwm-systemtray-enable ()
|
|
||||||
"Enable system tray support for EXWM."
|
|
||||||
(add-hook 'exwm-init-hook #'exwm-systemtray-mode)
|
|
||||||
(add-hook 'exwm-exit-hook (apply-partially #'exwm-systemtray-mode -1))
|
|
||||||
(when exwm--connection (exwm-systemtray-mode)))
|
|
||||||
(make-obsolete #'exwm-systemtray-enable "Use `exwm-systemtray-mode' instead." "0.40")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'exwm-systemtray)
|
(provide 'exwm-systemtray)
|
||||||
|
|
|
@ -801,13 +801,6 @@ Such event would be received when the client window is destroyed."
|
||||||
(exwm--define-global-minor-mode xim
|
(exwm--define-global-minor-mode xim
|
||||||
"Global minor mode for toggling EXWM XIM support.")
|
"Global minor mode for toggling EXWM XIM support.")
|
||||||
|
|
||||||
(defun exwm-xim-enable ()
|
|
||||||
"Enable XIM support for EXWM."
|
|
||||||
(add-hook 'exwm-init-hook #'exwm-xim-mode)
|
|
||||||
(add-hook 'exwm-exit-hook (apply-partially #'exwm-xim-mode -1))
|
|
||||||
(when exwm--connection (exwm-xim-mode)))
|
|
||||||
(make-obsolete #'exwm-xim-enable "Use `exwm-xim-mode' instead." "0.40")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'exwm-xim)
|
(provide 'exwm-xim)
|
||||||
|
|
|
@ -331,13 +331,6 @@ SERIAL is a sequence number."
|
||||||
(exwm--define-global-minor-mode xsettings
|
(exwm--define-global-minor-mode xsettings
|
||||||
"Global minor mode for toggling EXWM Xsettings support.")
|
"Global minor mode for toggling EXWM Xsettings support.")
|
||||||
|
|
||||||
(defun exwm-xsettings-enable ()
|
|
||||||
"Enable xsettings support for EXWM."
|
|
||||||
(add-hook 'exwm-init-hook #'exwm-xsettings-mode)
|
|
||||||
(add-hook 'exwm-exit-hook (apply-partially #'exwm-xsettings-mode -1))
|
|
||||||
(when exwm--connection (exwm-xsettings-mode)))
|
|
||||||
(make-obsolete #'exwm-xsettings-enable "Use `exwm-xsettings-mode' instead." "0.40")
|
|
||||||
|
|
||||||
(provide 'exwm-xsettings)
|
(provide 'exwm-xsettings)
|
||||||
|
|
||||||
;;; exwm-xsettings.el ends here
|
;;; exwm-xsettings.el ends here
|
||||||
|
|
Loading…
Reference in a new issue