mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-23 21:17:59 +01:00
Fix local simulation keys
* exwm-input.el (exwm-input--set-simulation-keys): Try the local binding first do not clear the hash table (rely on GC).
This commit is contained in:
parent
7013b0122a
commit
277377c718
1 changed files with 11 additions and 10 deletions
|
@ -762,16 +762,17 @@ multiple keys."
|
||||||
(defun exwm-input--set-simulation-keys (simulation-keys &optional no-refresh)
|
(defun exwm-input--set-simulation-keys (simulation-keys &optional no-refresh)
|
||||||
"Set simulation keys."
|
"Set simulation keys."
|
||||||
(unless no-refresh
|
(unless no-refresh
|
||||||
;; Clear keymaps and the hash table.
|
;; Unbind simulation keys.
|
||||||
(when (hash-table-p exwm-input--simulation-keys)
|
(let ((hash (buffer-local-value 'exwm-input--simulation-keys
|
||||||
(maphash (lambda (key _value)
|
(current-buffer))))
|
||||||
(when (sequencep key)
|
(when (hash-table-p hash)
|
||||||
(if exwm-input--local-simulation-keys
|
(maphash (lambda (key _value)
|
||||||
(local-unset-key key)
|
(when (sequencep key)
|
||||||
(define-key exwm-mode-map key nil))))
|
(if exwm-input--local-simulation-keys
|
||||||
exwm-input--simulation-keys)
|
(local-unset-key key)
|
||||||
(clrhash exwm-input--simulation-keys))
|
(define-key exwm-mode-map key nil))))
|
||||||
;; Update the hash table.
|
hash)))
|
||||||
|
;; Abandon the old hash table.
|
||||||
(setq exwm-input--simulation-keys (make-hash-table :test #'equal)))
|
(setq exwm-input--simulation-keys (make-hash-table :test #'equal)))
|
||||||
(dolist (i simulation-keys)
|
(dolist (i simulation-keys)
|
||||||
(let ((original (vconcat (car i)))
|
(let ((original (vconcat (car i)))
|
||||||
|
|
Loading…
Reference in a new issue