Deprecate exwm-config

The example configuration should not be loaded directly. Instead copy the
relevant settings to your user configuration. Fix #57.

* exwm.el: Update commentary.
* exwm-config.el: Update commentary. Print warning when used.
(exwm-config-example, exwm-config-misc, exwm-config-ido): Mark as obsolete.
This commit is contained in:
Daniel Mendler 2024-06-07 12:04:16 +02:00
parent cc8592d30f
commit 382bdd899c
No known key found for this signature in database
GPG key ID: D88ADB2A2693CA43
2 changed files with 24 additions and 7 deletions

View file

@ -21,15 +21,26 @@
;;; Commentary: ;;; Commentary:
;; This module contains typical (yet minimal) configurations of EXWM. ;; This module contains an example configuration of EXWM. Do not require this
;; file directly in your user configuration. Instead take it as inspiration and
;; copy the relevant settings to your user configuration.
;;; Code: ;;; Code:
(require 'exwm) (require 'exwm)
(require 'ido)
(defun exwm-config--warn ()
"Print obsoletion warning."
(fset #'exwm-config--warn #'ignore)
(warn "The `exwm-config' file has been deprecated. We do not recommend
requiring `exwm-config' directly in your Emacs configuration. Instead
copy and modify the relevant settings to your configuration. The code
from here will be moved out of the source repository to the manual after
the next release. See https://github.com/emacs-exwm/exwm/issues/57."))
(defun exwm-config-example () (defun exwm-config-example ()
"Default configuration of EXWM." "Default configuration of EXWM."
(exwm-config--warn)
;; Set the initial workspace number. ;; Set the initial workspace number.
(unless (get 'exwm-workspace-number 'saved-value) (unless (get 'exwm-workspace-number 'saved-value)
(setq exwm-workspace-number 4)) (setq exwm-workspace-number 4))
@ -72,14 +83,15 @@
;; Enable EXWM ;; Enable EXWM
(exwm-enable) (exwm-enable)
;; Configure Ido ;; Configure Ido
(exwm-config-ido) (with-no-warnings (exwm-config-ido))
;; Other configurations ;; Other configurations
(exwm-config-misc)) (with-no-warnings (exwm-config-misc)))
(make-obsolete 'exwm-config-example "Copy the relevant settings to your configuration." "0.30")
(defun exwm-config--fix/ido-buffer-window-other-frame () (defun exwm-config--fix/ido-buffer-window-other-frame ()
"Fix `ido-buffer-window-other-frame'." "Fix `ido-buffer-window-other-frame'."
(defalias 'exwm-config-ido-buffer-window-other-frame (defalias 'exwm-config-ido-buffer-window-other-frame
(symbol-function #'ido-buffer-window-other-frame)) (symbol-function 'ido-buffer-window-other-frame))
(defun ido-buffer-window-other-frame (buffer) (defun ido-buffer-window-other-frame (buffer)
"This is a version redefined by EXWM. "This is a version redefined by EXWM.
@ -110,16 +122,21 @@ You can find the original one at `exwm-config-ido-buffer-window-other-frame'."
(defun exwm-config-ido () (defun exwm-config-ido ()
"Configure Ido to work with EXWM." "Configure Ido to work with EXWM."
(exwm-config--warn)
(declare-function ido-mode "ido")
(ido-mode 1) (ido-mode 1)
(add-hook 'exwm-init-hook #'exwm-config--fix/ido-buffer-window-other-frame)) (add-hook 'exwm-init-hook #'exwm-config--fix/ido-buffer-window-other-frame))
(make-obsolete 'exwm-config-ido "Copy the relevant settings to your configuration." "0.30")
(defun exwm-config-misc () (defun exwm-config-misc ()
"Other configurations." "Other configurations."
(exwm-config--warn)
;; Make more room ;; Make more room
(menu-bar-mode -1) (menu-bar-mode -1)
(tool-bar-mode -1) (tool-bar-mode -1)
(scroll-bar-mode -1) (scroll-bar-mode -1)
(fringe-mode 1)) (fringe-mode 1))
(make-obsolete 'exwm-config-misc "Copy the relevant settings to your configuration." "0.30")

View file

@ -49,8 +49,8 @@
;; 2. In '~/.emacs', add following lines (please modify accordingly): ;; 2. In '~/.emacs', add following lines (please modify accordingly):
;; ;;
;; (require 'exwm) ;; (require 'exwm)
;; (require 'exwm-config) ;; (setq exwm-input-global-keys `(([?\s-r] . exwm-reset)))
;; (exwm-config-example) ;; (exwm-enable)
;; ;;
;; 3. Link or copy the file 'xinitrc' to '~/.xinitrc'. ;; 3. Link or copy the file 'xinitrc' to '~/.xinitrc'.
;; 4. Launch EXWM in a console (e.g. tty1) with ;; 4. Launch EXWM in a console (e.g. tty1) with