mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-30 16:07:59 +01:00
* exwm-workspace.el: Use closures rather than `(lambda ...)
This commit is contained in:
parent
397ca5497e
commit
81e52263a7
1 changed files with 9 additions and 9 deletions
|
@ -176,9 +176,9 @@ NIL if FRAME is not a workspace"
|
||||||
(= (length key) 1)
|
(= (length key) 1)
|
||||||
(<= 0 (elt key 0) 127))
|
(<= 0 (elt key 0) 127))
|
||||||
(define-key map key
|
(define-key map key
|
||||||
`(lambda ()
|
(lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(exwm-workspace--switch-map-select-nth ,i)))))))
|
(exwm-workspace--switch-map-select-nth i)))))))
|
||||||
(define-key map "\C-a" (lambda () (interactive) (goto-history-element 1)))
|
(define-key map "\C-a" (lambda () (interactive) (goto-history-element 1)))
|
||||||
(define-key map "\C-e" (lambda ()
|
(define-key map "\C-e" (lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -497,17 +497,17 @@ PREFIX-DIGITS is a list of the digits introduced so far."
|
||||||
;; Go ahead if there are enough digits to select any workspace.
|
;; Go ahead if there are enough digits to select any workspace.
|
||||||
(set-transient-map
|
(set-transient-map
|
||||||
(let ((map (make-sparse-keymap))
|
(let ((map (make-sparse-keymap))
|
||||||
(cmd `(lambda ()
|
(cmd (let ((digits (cons d prefix-digits)))
|
||||||
|
(lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(exwm-workspace--switch-map-nth-prefix
|
(exwm-workspace--switch-map-nth-prefix digits)))))
|
||||||
',(cons d prefix-digits)))))
|
|
||||||
(dotimes (i 10)
|
(dotimes (i 10)
|
||||||
(define-key map (int-to-string i) cmd))
|
(define-key map (int-to-string i) cmd))
|
||||||
;; Accept
|
;; Accept
|
||||||
(define-key map [return]
|
(define-key map [return]
|
||||||
`(lambda ()
|
(lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(exwm-workspace--switch-map-select-nth ,n)))
|
(exwm-workspace--switch-map-select-nth n)))
|
||||||
map)))))
|
map)))))
|
||||||
|
|
||||||
(defun exwm-workspace--switch-map-select-nth (n)
|
(defun exwm-workspace--switch-map-select-nth (n)
|
||||||
|
|
Loading…
Reference in a new issue