[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

<tab> differs from TAB, tab-key differs from C-i. What?!

From: cons
Subject: <tab> differs from TAB, tab-key differs from C-i. What?!
Date: Fri, 22 Aug 2008 03:26:03 -0700 (PDT)
User-agent: G2/1.0

Hello! I'm very confused about one thing:

Go to *scratch*-buffer and press 'C-h b' (describe-bindings). Under
'Major Mode Bindings' TAB is bound to lisp-indent-line. This mean that
when I press the tab-key or C-i (the same thing), lisp-indent-line is
executed. Fine.

BUT, now try this. Evaluate these 2 expressions in *scratch*:

(defun foo ()
  (message "Executed foo."))
(global-set-key (kbd "<tab>") 'foo)

Once again, press 'C-h b'. Our new binding of <tab> to foo is found
under 'Global Bindings'. So, we have the old local binding (major
mode) of TAB to lisp-indent-line that shadows a global binding of
<tab> to foo. Now pressing the tab-key or C-i should mean the same
thing (produce ascii code 9), which in turn should execute lisp-indent-
line (since local bindings takes precedence over global bindings),

Wrong. Pressing the tab-key executes foo, and pressing C-i executes
lisp-indent-line. So, TAB seems to mean pressing C-i, which apparently
differs from <tab> which seems to mean pressing the tab-key. Now, this
is becoming a mess.

1) Shouldn't pressing the tab-key and C-i mean the same thing?
2) Shouldn't all emacs' representations of a tab (<tab>, TAB, ?\t,
"\t", ascii code 9, <C-i>, ?\C-i, ?\^i etc etc) mean the same thing?

Best regards,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]