Emacs command of the day: sp-rewrap-pair (part of the must-have smartparens package). It lets you go from foo(bar) to foo[bar] effortlessly.