Commit 2601aa91 authored by Juri Linkov's avatar Juri Linkov
Browse files

* lisp/tab-bar.el (tab-bar--undefine-keys): New function from tab-bar-mode.

parent 8d5dfafa
...@@ -113,6 +113,15 @@ Possible modifier keys are `control', `meta', `shift', `hyper', `super' and ...@@ -113,6 +113,15 @@ Possible modifier keys are `control', `meta', `shift', `hyper', `super' and
(unless (global-key-binding [(control shift iso-lefttab)]) (unless (global-key-binding [(control shift iso-lefttab)])
(global-set-key [(control shift iso-lefttab)] 'tab-previous))) (global-set-key [(control shift iso-lefttab)] 'tab-previous)))
(defun tab-bar--undefine-keys ()
"Uninstall key bindings previously bound by `tab-bar--define-keys'."
(when (eq (global-key-binding [(control tab)]) 'tab-next)
(global-unset-key [(control tab)]))
(when (eq (global-key-binding [(control shift tab)]) 'tab-previous)
(global-unset-key [(control shift tab)]))
(when (eq (global-key-binding [(control shift iso-lefttab)]) 'tab-previous)
(global-unset-key [(control shift iso-lefttab)])))
(defun tab-bar--load-buttons () (defun tab-bar--load-buttons ()
"Load the icons for the tab buttons." "Load the icons for the tab buttons."
(when (and tab-bar-new-button (when (and tab-bar-new-button
...@@ -181,13 +190,7 @@ update." ...@@ -181,13 +190,7 @@ update."
(tab-bar--load-buttons)) (tab-bar--load-buttons))
(if tab-bar-mode (if tab-bar-mode
(tab-bar--define-keys) (tab-bar--define-keys)
;; Unset only keys bound by tab-bar (tab-bar--undefine-keys)))
(when (eq (global-key-binding [(control tab)]) 'tab-next)
(global-unset-key [(control tab)]))
(when (eq (global-key-binding [(control shift tab)]) 'tab-previous)
(global-unset-key [(control shift tab)]))
(when (eq (global-key-binding [(control shift iso-lefttab)]) 'tab-previous)
(global-unset-key [(control shift iso-lefttab)]))))
(defun tab-bar-handle-mouse (event) (defun tab-bar-handle-mouse (event)
"Text-mode emulation of switching tabs on the tab bar. "Text-mode emulation of switching tabs on the tab bar.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment