Thursday, July 24, 2008

Don't treat Underscore as a word separator character on double-click

In just about all modern text-reading and text-writing applications, a double-left-click with the mouse on a word in the text causes that word to become selected.  Double-clicking a word in this manner is handy for quickly selecting a word in order to copy-and-paste or cut-and-paste it elsewhere, or to just delete the word.  (If you've never used double-click in this way before, go ahead and give it a try on one of the words in this post, right here in your web browser.)

I've recently noticed that not all applications handle double-click-selection of words that contain an underscore character (the character "_"; also called "underbar") in the same way.  Such words are frequently used by software developers for naming such things as variables and database fields; examples are max_records and customer_id. 

In some applications, double-clicking on any portion of a word containing an underscore results in the entire word being selected.  This is the behavior I want, since it lets me easily cut or copy the entire identifier elsewhere.  (For example, taking the example of the max_records identifier, if I double-click the word, it's far more common that what I'm trying to do is select and copy "max_records" for pasting elsewhere, rather than just "max" or just "records".)  The text editor Notepad2 works this way (shown here after a double-click on the word "max"):


The problem is that in some applications, double-clicking a word containing an underscore results in just the clicked portion of the word becoming selected; the underscore gets treated as a word separator character (like a space character would be treated).  Firefox 3 works this way (again, shown after a double-click on "max"):


Since typical (non-developer) users are seldom or never going to be working with documents with words that include underscore characters (and therefore aren't affected one way or another by what the behavior is), I think that the default behavior across all applications should be to select the entire word when a word including an underscore character is double-clicked.  The underscore should not be treated as a word separator character for the purposes of an application's logic that selects a word on a double-click.

It still might make sense for underscore characters to be treated as word separator characters in some other cases.  Such cases might include an application's spell check logic; another case might be the handling of navigating through a document a word at a time via the Ctrl+LeftArrow and Ctrl+RightArrow shortcut keys.

A few applications that get this behavior "right" (double-click selects an entire word with an underscore; not all other punctuation characters are specially handled this way):

  • Visual Studio 2008
  • Eclipse 3.3
  • Notepad2 (2.1.19)
  • Microsoft Excel (2003)

A few applications that don't get the double-click behavior "right" (double-click selects only the portion of the clicked word up to the underscore character):

  • Firefox 3
  • Internet Explorer 6
  • Toad for Oracle (
  • Microsoft Word (2003)
  • Acrobat Reader 7

Developers of this latter set of applications: If you agree, please go forth and effect positive change!  :-)  Developers of new applications, please keep this issue in mind when coding up the mouse click UI behavior for your new app.

Update 4/4/2011: There is an existing, long-standing (March 2003) Mozilla (Firefox) Bugzilla ticket for this: Bug 196175 - underscore should be part of word, not punctuation. As discussed in that comments on that ticket, though, it isn't clear that special-case logic should be added for the underscore character, since behavior from application to application even on a single platform is inconsistent (as I noted above for Windows applications). I voted for the ticket, but I'm not going to hold my breath at this point for it to be addressed soon!

Tuesday, July 15, 2008

Workaround: "The server is not responding" error when trying to add a contact in Groupwise Messenger

At work, our internal corporate standard IM client is Groupwise Messenger.  Today, the "Add Contact" function stopped working for me (after always having had it work fine in the past): When trying to add a new contact, the "Search Results" window would appear with its normal animated "searching..." icon, and then after 30 seconds, the search would time out with the error message "The server is not responding."  Despite the error message, I could view the online/offline status of my existing contacts with no problem (so I clearly had a working connection to the Groupwise server).

After playing with the client for a couple of minutes in an attempt to find a workaround, I did find a rather unusual workaround, somewhat to my surprise:

On the Find dialog (where you enter the name of the contact to find), tucked away in the top-right corner of the dialog is an "Advanced" button.  Clicking that button restyles the dialog with some additional "advanced" fields.  Performing the search while the Find dialog is in this Advanced mode causes the search to work correctly, and the "The server is not responding" error does not occur.

This workaround seems kind of bizarre to me -- I have no idea why it works, or what the cause of the initial issue is.  Still, I have successfully reproduced this workaround as a solution for the issue multiple times (and gone back to Basic mode in the Find dialog and had the search fail once again as it did originally), so I wanted to share the solution in hopes that it is helpful to someone.

Monday, July 07, 2008

How to search multiple domains with Google

It is possible to do a Google search and restrict the results to a single domain by using the Advanced Search form. You can also use the regular search form with syntax like:
search term(s)
where is the site you want to search. Google will show you search results from just that one site. For example: Search for "football" at As of the time of this writing, the Advanced Search form doesn't seem to support searching multiple specified domains instead of just a single one; adding a space between the domains entered on the "Search within a site or domain" field doesn't work (Google automatically removes any spaces before performing the search). Using one of the characters , ; : in the field as a delimiter doesn't work, either. However, you can do a multiple domain search by using syntax like this in the regular search form:
search term(s) OR
where and are the sites that you want to search. For example: Search for "football" at and

Wednesday, July 02, 2008

How to hide the Windows Search 4 search bar on the Windows XP Taskbar

File this one under "so obvious that I couldn't figure it out!"

Earlier today, I installed the recently-released Windows Search 4 for Windows XP.  I'm going to give it a try not so much as a search tool, but primarily as a means of opening documents more quickly in cases when I already know where the document I want is located, but the location is multiple levels deep in my filesystem hierarchy, and it takes a few seconds to drill all the way down to it; I'm hoping just typing a few characters of the document's name and then opening the document from the search results turns out to be faster.

When I installed Windows Search 4, it placed a search bar on my Windows Taskbar.  I didn't really want the search bar there; I like to have maximum real estate available on the Taskbar for my open applications' buttons.  (I don't have the Quick Launch bar or any other widgets present on my Taskbar, either; I use SlickRun to launch apps quickly using only the keyboard.)  I'm also currently running a black Windows theme and a black desktop background, and the bright white rectangle of the search field was a bit of an eyesore.

Since I knew that I could also bring up the search field with the global Win+F keyboard shortcut (as Windows Search 4 replaces the default Windows search functionality, including the Win+F shortcut), I poked around in the Windows Search options for a way to hide the search field on the Taskbar.  Not seeing any relevant options there, I Googled for an answer, and didn't come up with anything immediately, but eventually found the answer in a reader comment in a article comparing Windows Search 4 and Google Desktop 5.5. 

Commenter "Quikboy" on that article noted that it is possible to hide the Windows Search field on the Taskbar, not from within the Windows Search options, but in the same way that you can hide any other Taskbar widget: Right-click an empty portion of the Taskbar, then on the context menu that appears, open the Toolbars sub-menu, and uncheck Windows Search Deskbar.

So, that problem is solved!  It remains to be seen how useful Windows Search 4 turns out to be in my everyday work, but at least while I'm making that determination over the next few days, I won't have the search field cluttering up my Taskbar!