Latest News

31st January 2010
Send to twitter Send to Facebook

A common problem facing emacs users is to replace a certain sequence of characters in a buffer with either a newline or tab or something else equally awkward. The solution is relatively simple.

Invoke search and place as normal (M-%), enter the text to be replaced, enter the replacing character using the following chart:

  • Newline(\n): C-qC-j
  • Tab(\t): C-qC-i
  • Carriage return(\r): C-qC-m

See the pattern? C-q is an escape sequence and C-[char] is the position in the alphabet of the ASCII offset of the replacement character. OK, perhaps that's a little tangled. But now you know.

About this blog

The taskboy blog is a exploration of computer technology by Joe Johnston. Topics of posts include practical examples Perl, PHP, Python and Java as well as book reviews, industry insights and miscellaneous good stuff.

Current Status

Watching _Brass Latern_. Ah IF, your coyness is your charm.

Posted: Sun Sep 05 16:02:15 +0000 2010