ch11ng / exwm

Emacs X Window Manager
2.85k stars 134 forks source link

Apply exwm-workspace-index-map on exwm-workspace-move-window #549

Closed vuquangtam closed 5 years ago

vuquangtam commented 5 years ago

When i set

(setq exwm-workspace-index-map
      (lambda (index) (number-to-string (1+ index))))

numbers on modeline show correctly but keyboard keep as default behavior. Ex: modeline when using exwm-workspace-move-window show 1 2 3 4 5, but when i press 1 it move window to workspace 2.

ch11ng commented 5 years ago

This is set by exwm-input-global-keys or exwm-input-set-key. If you don't have them in your Emacs init file then it's probably exwm-config-default. Either way you'll need to turn your old config into something like the this:

(setq exwm-input-global-keys
      `(,@(mapcar (lambda (i)
                    `(,(kbd (format "s-%d" (1+ i))) .
                      (lambda ()
                        (interactive)
                        (exwm-workspace-switch-create ,i))))
                  (number-sequence 0 8))))
vuquangtam commented 5 years ago

This is set by exwm-input-global-keys or exwm-input-set-key. If you don't have them in your Emacs init file then it's probably exwm-config-default. Either way you'll need to turn your old config into something like the this:

(setq exwm-input-global-keys
      `(,@(mapcar (lambda (i)
                    `(,(kbd (format "s-%d" (1+ i))) .
                      (lambda ()
                        (interactive)
                        (exwm-workspace-switch-create ,i))))
                  (number-sequence 0 8))))

Hi, sorry for describe not clearly :), my problem isn't about keybinding, the problem is in interactive minibuffer when using exwm-workspace-move-window like below image, the number is mapped correctly but when i press 1 it still move to workspace 2. image

ch11ng commented 5 years ago

Thanks for the clarification! Please check out dd96fffb52a4e7e5b506b28881b518b0359375c4.