Fix read-only issue in emacs24

In emacs24, trying to prepend text to the filename triggered a "text
is read-only" error.