Subject: Re: bug#75918: [PATCH] Add new user option tab-bar-define-keys

From: Ship Mints <[email-masked]>
Date: Wed, 29 Jan 2025 14:28:29 -0500

This one should adequately address that backward compatibility issue.
Thanks for pointing it out.

On Wed, Jan 29, 2025 at 1:58 PM Juri Linkov <[email-masked]> wrote:

> > +  (when (memq tab-bar-define-keys '(t tab))
> > +    (define-key tab-bar-mode-map [(control tab)] #'tab-next)
> > +    (define-key tab-bar-mode-map [(control shift tab)] #'tab-previous)
> > +    (define-key tab-bar-mode-map [(control shift iso-lefttab)]
> #'tab-previous))
>
> But we still need to check with global-key-binding here
> before binding TAB keys.  This will ensure backwards-compatibility.
>
> > -(defun tab-bar-mode--tab-key-bind (map key binding)
> > -  ;; Don't override user customized global key bindings
> > -  (define-key map key
> > -    `(menu-item "" ,binding
> > -      :filter ,(lambda (cmd) (unless (global-key-binding key) cmd)))))
>