what should Ctrl+Tab do?

10 views
Skip to first unread message

Xah Lee

unread,
Sep 29, 2009, 10:28:01 PM9/29/09
to ErgoEmacs
Milan mentioned that Ctrl+Tab should do switch buffers or switching
windows.

... here's some info and opinion i have on this.

the current default to switch windows is Alt+` , and switch to
previous is Alt+~ (that is Alt+Shift+` on US layout).

This was chosen because it is standard on the Mac.
I'm not completely satisfied with that choice. Here's some reasons:

• it is unknown on Windows, which is used by some 90% of users.

• on some keyboard key layouts don't have ` and ~ as shifted versions
of the same physical key. This breaks the shift symmetry. (although
non-us layout are used by minority, probably less than 20% of the
whole world's professional programers)

•not all keyboard hardware have the ` key at the same place. (Though,
majority of US keyboards have it above Tab key.)

As to the Ctrl+Tab or “Ctrl+Shift+Tab”, here are some advantages i
know of.

• somewhat standard on Windows (it really depends on the application,
or type of apps. Mostly, in i think all Windows browsers support this
for switching tabs, but note that in firefox and chrome they also use
Ctrl+Pgup and PgDn. ).

However, there are some disadvantages that i never liked:

• Switching windows or buffers is a common operation. It should have
Alt instead of Ctrl, for easy operation.

• The Ctrl+Tab is possible spot for quite a lot operations. e.g. any
sort of completion, jump to next field, insert tab or some alternative
behavior of indentation... etc.

• I don't think Ctrl+Tab is that universal... because it depends on
application.

• The Tab key is really a lousy key for ergonomics, because it is
pressed by pinky and involves a strech and move of hand.
Unfortunately, many apps that uses Tab as shortcuts today are rather
frequently used commands. (such as switching window, jump to next
input point)

also, note that we have Ctrl+ PgUp and PgDn for switching buffers.

we also have to consider if we add tab bar mode eventually. When in
tabbar mode, it has its own concept of switching tabs, not based on
switching buffers... i am not sure it is good, and in the past i used
it, it has its own order of tabs... so it changes the way which buffer
is open when you close one. Quite confusing for me, and is one of the
reason that i eventually stopped using it and removed it from my emacs
pages.

So, the above are background info and reasons for and against.

I'm not sure Alt+` and ~ are best... but this kinda things can never
be best... there are only so many spots among so many functions... and
have to consider of common familiarity vs unfamiliar but ergonomic.

some convenient ref: http://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts

I think me and david pretty much decided that Alt+t would be the
shortcut for our new smart complete symbol. So, that frees one command
for occupying Ctrl+tab (which many emacs users bound it to that
themselves)

Xah
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

milan

unread,
Oct 1, 2009, 2:03:27 AM10/1/09
to ErgoEmacs
Heya!

On Sep 30, 4:28 am, Xah Lee <xah...@gmail.com> wrote:

> Milan mentioned that Ctrl+Tab should do switch buffers or switching windows.

In my comment I intentionally left out the "should do switch
something" part just stating it is not mapped to anything... I do not
consider C-tab a very good or ergonomic shortcut at all, using it
would require completely leaving home row for the left hand, even
worse, if you have your Ctrl where capslock is supposed to be, the
entire left hand suddenly sits aside the keyboard instead of hovering
over it. However, due to frequent use in other (mostly TDI)
application and due to its location on the keyboard people just might
expect something to be happening there (indeed, most likely some kind
of inner-application document- or tab switch).

> ... here's some info and opinion i have on this.

very happy to give some feedback!

> the current default to switch windows is Alt+` , and switch to
>previous is Alt+~ (that is Alt+Shift+` on US layout).

I usually don't have more than one emacs frame, yet I still reflected
on the issue: Alt+` is indeed a much more ergonomic position on the
keyboard and be a good place since it is almost the same move as alt-
tab and because their functionality is somewhat related. Only
downside: Alt+` overstreches left pinky, at least for me. Although,
when I ever have multiple frames open, from time to time I catch
myself using one of the ugliest shortcuts in emacs history: C-x 5 o,
or even worse: typing out M-x other-frame where I could as well have
pressed alt-tab or shift-alt-tab a dozen times. To me, having
something ergonomic (in the "meta-space" ) invoking other-frame seems
vastly superior to using alt-tab which also cycles through all running
application windows.

> This was chosen because it is standard on the Mac.

Yay! Another mac-specific thingie i never knew about.

> • on some keyboard key layouts don't have ` and ~ as shifted versions
> of the same physical key. This breaks the shift symmetry. (although
> non-us layout are used by minority, probably less than 20% of the
> whole world's professional programers)

I don't know if you thought of layouts similar to the German qwertz
one here: basically same as US but not in the details (where it
counts). Personally I wouldn't underestimate the amount of users not
willing to give up the national layout they grew up with in favor for
the US layout, especially bearing in mind that national layouts have
special characters on them that are inevitable for writing in their
mother tongue. In that light, it could be a good idea to have switch-
to-previous/next-frame bound to something ergonomic AND more
universal, for instance Alt-m and Shift-Alt-m (just now I've put these
in my .emacs). Also, I don't think it is a wise choice to focus too
much on professional coders as EE's target group, rather users of text
editors in general (that is, text editor as in notepad.exe, which
again means almost every computer user out there except for grandma).

> •not all keyboard hardware have the ` key at the same place. (Though,
> majority of US keyboards have it above Tab key.)

Here comes reality. My beloved Cherry G84-4100(aka happy hacking for
the poor) has the `/~ key only accessible via fn-modifier. 1, !, ~ and
` all cluttered to one physical key resulting in a tremendous wrench
trying to press Alt-(Shift)-fn-1. Oh. Suddenly I remember why I was
using that rotten C-x 5 o :-)
[OT]
My keyboard:
http://images.google.com/images?hl=de&source=hp&q=cherry%20g84%204100
Note to self: Someday I shall make a dvorak-classic version with
switch-to-next-frame bound to M-[ (M-1 in nonclassic-dv) and other
minor adoptions. (Yes, I am convinced of the superiority of Dvorák's
original layout over the watered down ANSI version, and yes I had to
create it myself for windows using that blasted ms keyboard layout
creator.) Also, I remapped (using Keytweak) "<>|" key to LAlt, LAlt to
AltGr, AltGr to Right-Alt, right winkey to another AltGr, having all
special characters i need like äö€üß a swell as bunch of ahk macros in
AltGr-space without losing the two alt-keys left and right to the
space bar. (In fact, I bought this keyboard after having read your
texts on the emacs pinky problem and the other keyboard articles; I
believe it deserves a place in the gallery, but also the happy hacking
and typematix ones). The reason why I think the mini G84 is awesome:
it gives me three easily accessible Mod-keys right under each thumb!
Also its fully mechanical which, for me, is a must.
[/OT]

> • somewhat standard on Windows (it really depends on the application,
> or type of apps. Mostly, in i think all Windows browsers support this
> for switching tabs, but note that in firefox and chrome they also use
> Ctrl+Pgup and PgDn. ).

Great we have those for next-user-buffer and the like. I noticed Alt-
Pg*, Shift-Pg* and Alt-Shift-Pg* are still available, aren't they?
That's six possible shortcuts! Correct me if I'm wrong, maybe some of
them won't be usable because of internal emacs magic or overlapping
with the OS' keys.

> However, there are some disadvantages that i never liked:
> • Switching windows or buffers is a common operation. It should have
> Alt instead of Ctrl, for easy operation.

indeed.

> • The Ctrl+Tab is possible spot for quite a lot operations. e.g. any
> sort of completion, jump to next field, insert tab or some alternative
> behavior of indentation... etc.
> • I don't think Ctrl+Tab is that universal... because it depends on
> application.

Yes, it is certainly not universal in meaning but I believe there is
consent it should do something useful and not scary, and by no means
just "beep around". Despite its unergonomicness (does that
wordexist?!) in touchtyping-mode I think it is a valuable shortcut in
viewing- mode, one hand at mouse, other hand at switch-keys and copy
cut paste.

> • The Tab key is really a lousy key for ergonomics, because it is
> pressed by pinky and involves a strech and move of hand.

indeed.

> Unfortunately, many apps that uses Tab as shortcuts today are rather
> frequently used commands. (such as switching window, jump to next
> input point)

Unfortunately, tab-completing is also one of the most frequently used
features among cli users which suggests the root of evil lies in
keyboard hardware (mal)design here.

> also, note that we have Ctrl+ PgUp and PgDn for switching buffers.

which I really appreciate and make use of on a daily basis.

> we also have to consider if we add tab bar mode eventually. When in
> tabbar mode, it has its own concept of switching tabs, not based on
> switching buffers... i am not sure it is good, and in the past i used
> it, it has its own order of tabs... so it changes the way which buffer
> is open when you close one. Quite confusing for me, and is one of the
> reason that i eventually stopped using it and removed it from my emacs
> pages.

I didn't know you were planning to eventually introduce a TDI. In that
case I'd of course opt for C-tab bound to switching tabs like in ff.
Until then, any functionality other than beep at the user might be
worth considering. Oh, and if the tabbar-mode turns out to be an
unintuitive piece of crap unlike modern TDI applications, it might be
a good idea not to include it at all. At the moment, emacs is neither
really MDI nor really SDI, I wouldn't want to go so far to add another
"not real TDI" to the list. On the other hand, leaving this and many
many other choices to the user is what makes emacs such a great
professional text editor. All in all, I am very indifferent about the
tab-bar-mode idea. I tried it once in my early emacs days but didn't
see the benefit back then; I guess I'll have to give it another shot
before I can give an opinion or statement.

> So, the above are background info and reasons for and against.
> I'm not sure Alt+` and ~ are best... but this kinda things can never
> be best... there are only so many spots among so many functions... and
> have to consider of common familiarity vs unfamiliar but ergonomic.

I have my doubts concerning the usefulness of Alt+` and ~ on (m)any
keyboard layouts other than US, however, if I had to decide I'd say
they definitely have to stay. Yet, Ctrl-tab definitely has to do
_something_ and if it is only popping up ibuffer or dired or speedbar
or whatever (not saying that any of these would be of great importance
for or use to the average Joe Schmo notepad.exe user, but better than
just beep).

Keep up the great work and discussion!

In great disbelief and amazement of having triggered 5 full mousewheel
scrolls worth of text by uttering just one line,
having had breakfast just now being very very MAAAAAD at those line-
breaks,

cheers,

Milan
Reply all
Reply to author
Forward
0 new messages