Wednesday, January 09, 2008

Gmail Label Sort Order

I am taking the "Getting Things Done" training class taught by Kelly Forrister, a consultant from the David Allen Company. One of the tools can be used for GTD is gmail, and she wrote a nice article to explain how it's done. It basically involves creating a bunch of "@" labels for your action lists, a bunch of project labels for your projects, and corresponding filters and contacts and such.

The problem is, at Google, everyone subscribes to a googol number of internal mailing lists and already have a googol number of labels and filters for these lists to make the inbox manageable (just saw someone mentioning the mailing lists can be managed without labels; should look into that). So how do you keep your GTD labels sorted at the top? The obvious answer is to use the special characters like "@". But I googled around a little and didn't find any place explaining how exactly the gmail labels are sorted. I did a little experiment to find out (digging into gmail code is another, not necessarily faster approach :).

We have special characters, numbers, and alphabet letters. They are sorted in that order. The letters are sorted in case-insensitive order.

Special characters sort order:
_ , ; : ! ? . ` ~ ' " [ ] { @ $ * \ # % + < = >
(note: you can't create a label with "{" alone, but "{abc" is fine)

Illegal characters (can't use these in the labels):
& ( ) - / ^ | }

So there you have it. I think I am going to use "_" for Mind Sweep, "@" for action lists, and maybe "+" for projects.

The sort order is a little puzzling, as it's not in ASCII order. Maybe I should dig into the gmail code to find out. :)