[StumpWM] Exit interactive keymaps with `q'

This commit is contained in:
Lucien Cartier-Tilet 2022-10-26 13:07:50 +02:00
parent 490db564ce
commit 2e3be809d9
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -1373,7 +1373,9 @@ redefine it:
#+begin_src lisp #+begin_src lisp
(define-interactive-keymap (iresize tile-group) (:on-enter #'setup-iresize (define-interactive-keymap (iresize tile-group) (:on-enter #'setup-iresize
:on-exit #'resize-unhide :on-exit #'resize-unhide
:abort-if #'abort-resize-p) :abort-if #'abort-resize-p
:exit-on ((kbd "RET") (kbd "ESC")
(kbd "C-g") (kbd "q")))
((my/kbd "c") "resize-direction left") ((my/kbd "c") "resize-direction left")
((my/kbd "t") "resize-direction down") ((my/kbd "t") "resize-direction down")
((my/kbd "s") "resize-direction up") ((my/kbd "s") "resize-direction up")
@ -1990,7 +1992,9 @@ else appears, such as a ~s-SPC C-g~ since I have ~which-key-mode~ enabled.
#+name: interactive-gen #+name: interactive-gen
#+begin_src emacs-lisp :var name="inter" keys=inter-mpc #+begin_src emacs-lisp :var name="inter" keys=inter-mpc
(format "%s" (format "%s"
`(define-interactive-keymap ,name () `(define-interactive-keymap ,name
"\n (:exit-on ((kbd \"RET\") (kbd \"ESC\")"
"\n (kbd \"C-g\") (kbd \"q\")))"
"\n " "\n "
,(mapconcat (lambda (keybind) ,(mapconcat (lambda (keybind)
(format "%s" (format "%s"
@ -2004,12 +2008,16 @@ else appears, such as a ~s-SPC C-g~ since I have ~which-key-mode~ enabled.
"\n "))) "\n ")))
#+end_src #+end_src
#+RESULTS[5f0a947d35c7efa568ec89859bed9e9f6ed0fa51]: interactive-gen #+RESULTS[b7d91bafe659a77aef5059ae17859a7fc715255e]: interactive-gen
: (define-interactive-keymap inter nil #+begin_src lisp
: ((my/kbd "c") "mpd-prev") (define-interactive-keymap inter
: ((my/kbd "t") "mpd-volume-down") (:exit-on ((kbd "RET") (kbd "ESC")
: ((my/kbd "s") "mpd-volume-up") (kbd "C-g") (kbd "q")))
: ((my/kbd "r") "mpd-next")) ((my/kbd "c") "mpd-prev")
((my/kbd "t") "mpd-volume-down")
((my/kbd "s") "mpd-volume-up")
((my/kbd "r") "mpd-next"))
#+end_src
#+name: num-to-char #+name: num-to-char
#+begin_src emacs-lisp :var table=number-to-char-table num=2 #+begin_src emacs-lisp :var table=number-to-char-table num=2