diff options
author | Philip Kaludercic <philipk@posteo.net> | 2021-05-27 12:24:42 +0200 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2021-06-03 23:35:10 +0300 |
commit | 3916bf00c56274b39f921217168669f445e0df14 (patch) | |
tree | 7fffc69313ac57670aea4d423fe1e068fbc66c8b /lisp/windmove.el | |
parent | b5416d971a720e1dfb9aedd8e7d23f24b1ea5325 (diff) | |
download | emacs-3916bf00c56274b39f921217168669f445e0df14.tar.gz |
Add user options for default windmove commands (bug#41438)
* windmove.el (windmove--default-keybindings-type): Add type.
(windmove-default-keybindings): Add user option.
(windmove-display-default-keybindings): Add user option.
(windmove-delete-default-keybindings): Add user option.
(windmove-swap-states-default-keybindings): Add user option.
Diffstat (limited to 'lisp/windmove.el')
-rw-r--r-- | lisp/windmove.el | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/lisp/windmove.el b/lisp/windmove.el index ea4486348be..0eba97a91b7 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -732,6 +732,86 @@ Default value of MODIFIERS is `shift-super'." (windmove-swap-states-down down)))) + +(defconst windmove--default-keybindings-type + `(choice (const :tag "Don't bind" nil) + (cons :tag "Bind using" + (key-sequence :tag "Prefix") + (set :tag "Modifier" + :greedy t + ;; See `(elisp) Keyboard Events' + (const :tag "Meta" meta) + (const :tag "Control" control) + (const :tag "Shift" shift) + (const :tag "Hyper" hyper) + (const :tag "Super" super) + (const :tag "Alt" alt)))) + "Customisation type for windmove modifiers.") + +(defcustom windmove-default-keybindings nil + "Default bindings for regular windmove commands." + :set (lambda (sym val) + (windmove-install-defaults + (car val) (cdr val) + '((windmove-left left) + (windmove-right right) + (windmove-up up) + (windmove-down down)) + (null val)) + (set-default sym val)) + :type windmove--default-keybindings-type + :version "28.1" + :group 'windmove) + +(defcustom windmove-display-default-keybindings nil + "Default bindings for display windmove commands." + :set (lambda (sym val) + (windmove-install-defaults + (car val) (cdr val) + '((windmove-display-left left) + (windmove-display-right right) + (windmove-display-up up) + (windmove-display-down down) + (windmove-display-same-window ?0) + (windmove-display-new-frame ?f) + (windmove-display-new-tab ?t)) + (null val)) + (set-default sym val)) + :type windmove--default-keybindings-type + :version "28.1" + :group 'windmove) + +(defcustom windmove-delete-default-keybindings nil + "Default bindings for delete windmove commands." + :set (lambda (sym val) + (windmove-install-defaults + (car val) (cdr val) + '((windmove-delete-left left) + (windmove-delete-right right) + (windmove-delete-up up) + (windmove-delete-down down)) + (null val)) + (set-default sym val)) + :type windmove--default-keybindings-type + :version "28.1" + :group 'windmove) + +(defcustom windmove-swap-states-default-keybindings nil + "Default bindings for swap-state windmove commands." + :set (lambda (sym val) + (windmove-install-defaults + (car val) (cdr val) + '((windmove-swap-states-left left) + (windmove-swap-states-right right) + (windmove-swap-states-up up) + (windmove-swap-states-down down)) + (null val)) + (set-default sym val)) + :type windmove--default-keybindings-type + :version "28.1" + :group 'windmove) + + (provide 'windmove) ;;; windmove.el ends here |