Subject: bug#20904: If global-set-key is used to rebind <tab>, searching for a TAB character inserts a TAB

From: Stefan Monnier <[email-masked]>
Date: Fri, 26 Jun 2015 15:42:24 -0400

tags 20904 notabug
thanks

>> (global-set-key (kbd "<tab>") 'tab-to-tab-stop)
> I have found that changing the above form to:
>   (global-set-key (kbd "TAB") 'tab-to-tab-stop)
> avoids the problem (i.e., it allows the global binding of TAB to be
> changed to tab-to-tab-stop and allows searching for a TAB character).

That's right.
Most of Emacs (including Isearch) gives no special meaning to `tab', and
instead this key is typically remapped to TAB.
So unless you care about the difference between the two, you should
always bind the TAB and not `tab'.

        Stefan