mirror of
https://github.com/ch11ng/exwm.git
synced 2025-02-26 06:14:33 +01:00
Rename variable to better convey its effect
This commit is contained in:
parent
22c7239f40
commit
99493190c6
2 changed files with 8 additions and 8 deletions
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(defvar exwm-workspace-number 4 "Number of workspaces (1 ~ 10).")
|
(defvar exwm-workspace-max-count 10 "Maximum number of workspaces.")
|
||||||
(defvar exwm-workspace--list nil "List of all workspaces (Emacs frames).")
|
(defvar exwm-workspace--list nil "List of all workspaces (Emacs frames).")
|
||||||
|
|
||||||
(defun exwm-workspace--count ()
|
(defun exwm-workspace--count ()
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
(define-key map (int-to-string i)
|
(define-key map (int-to-string i)
|
||||||
`(lambda ()
|
`(lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(when (< ,i exwm-workspace-number)
|
(when (< ,i exwm-workspace-max-count)
|
||||||
(goto-history-element ,(1+ i))
|
(goto-history-element ,(1+ i))
|
||||||
(exit-minibuffer)))))
|
(exit-minibuffer)))))
|
||||||
(define-key map "\C-a" (lambda () (interactive) (goto-history-element 1)))
|
(define-key map "\C-a" (lambda () (interactive) (goto-history-element 1)))
|
||||||
|
@ -220,9 +220,9 @@ The optional FORCE option is for internal use only."
|
||||||
(defun exwm-workspace--add-frame-as-workspace (frame)
|
(defun exwm-workspace--add-frame-as-workspace (frame)
|
||||||
"Configure frame FRAME to be treated as a workspace."
|
"Configure frame FRAME to be treated as a workspace."
|
||||||
(cond
|
(cond
|
||||||
((>= (exwm-workspace--count) exwm-workspace-number)
|
((>= (exwm-workspace--count) exwm-workspace-max-count)
|
||||||
(delete-frame frame)
|
(delete-frame frame)
|
||||||
(user-error "[EXWM] Too many workspaces: maximum is %d" exwm-workspace-number))
|
(user-error "[EXWM] Too many workspaces: maximum is %d" exwm-workspace-max-count))
|
||||||
((memq frame exwm-workspace--list)
|
((memq frame exwm-workspace--list)
|
||||||
(exwm--log "Frame is already a workspace: %s" frame))
|
(exwm--log "Frame is already a workspace: %s" frame))
|
||||||
(t
|
(t
|
||||||
|
@ -284,7 +284,7 @@ The optional FORCE option is for internal use only."
|
||||||
|
|
||||||
(defun exwm-workspace--init ()
|
(defun exwm-workspace--init ()
|
||||||
"Initialize workspace module."
|
"Initialize workspace module."
|
||||||
(cl-assert (and (< 0 exwm-workspace-number) (>= 10 exwm-workspace-number)))
|
(cl-assert (and (< 0 exwm-workspace-max-count) (>= 10 exwm-workspace-max-count)))
|
||||||
;; Prevent unexpected exit
|
;; Prevent unexpected exit
|
||||||
(setq confirm-kill-emacs
|
(setq confirm-kill-emacs
|
||||||
(lambda (prompt)
|
(lambda (prompt)
|
||||||
|
|
6
exwm.el
6
exwm.el
|
@ -571,17 +571,17 @@
|
||||||
;; Set _NET_NUMBER_OF_DESKTOPS
|
;; Set _NET_NUMBER_OF_DESKTOPS
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:ewmh:set-_NET_NUMBER_OF_DESKTOPS
|
(make-instance 'xcb:ewmh:set-_NET_NUMBER_OF_DESKTOPS
|
||||||
:window exwm--root :data exwm-workspace-number))
|
:window exwm--root :data exwm-workspace-max-count))
|
||||||
;; Set _NET_DESKTOP_VIEWPORT
|
;; Set _NET_DESKTOP_VIEWPORT
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:ewmh:set-_NET_DESKTOP_VIEWPORT
|
(make-instance 'xcb:ewmh:set-_NET_DESKTOP_VIEWPORT
|
||||||
:window exwm--root
|
:window exwm--root
|
||||||
:data (make-vector (* 2 exwm-workspace-number) 0)))
|
:data (make-vector (* 2 exwm-workspace-max-count) 0)))
|
||||||
;; Set _NET_WORKAREA (with minibuffer and bottom mode-line excluded)
|
;; Set _NET_WORKAREA (with minibuffer and bottom mode-line excluded)
|
||||||
(let* ((workareas
|
(let* ((workareas
|
||||||
(vector 0 0 (x-display-pixel-width) (x-display-pixel-height)))
|
(vector 0 0 (x-display-pixel-width) (x-display-pixel-height)))
|
||||||
(workareas (mapconcat (lambda (i) workareas)
|
(workareas (mapconcat (lambda (i) workareas)
|
||||||
(make-list exwm-workspace-number 0) [])))
|
(make-list exwm-workspace-max-count 0) [])))
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:ewmh:set-_NET_WORKAREA
|
(make-instance 'xcb:ewmh:set-_NET_WORKAREA
|
||||||
:window exwm--root :data workareas)))
|
:window exwm--root :data workareas)))
|
||||||
|
|
Loading…
Reference in a new issue