Classic #Emacs tip: if you use query-replace 'foo' with 'bar', Emacs will replace 'Foo' with 'Bar' and 'FOO' with 'BAR'. Ingenious.