Ads by Google

Sunday, October 14, 2007

Repeating Numbers in Emacs

With the universal prefix, ' C-u', it's possible to repeat text, either the default 4 times or with numeric arguments 'n', n times.

C-u 1 0 #

will give you 10 #s.

What if you want 10 1s?

C-u 1 0 1

only specifies a 101 repeat sequence.

A quick peek at the manual reveals the answer.

`C-u 6 4 a' inserts 64 copies of the character `a'. But this does not work for inserting digits; `C-u 6 4 1' specifies an argument of 641. You can separate the argument from the digit to insert with another `C-u'; for example, `C-u 6 4 C-u 1' does insert 64 copies of the character `1'.

So the answer is 'C-u 1 0 C-u 1'.

Emacs has all the answers, you need to ask the right questions. :-)

Well, it's about Time....

to create my own blog, I guess after everyone else has been there, done that. I'm going to try to stick to Emacs as much as possible without trying to engage in flames, baiting and insults. But my patience is legendary by its absence, so it's not going to be a promise.

That's it. This is done through the Web posting method on blogger. I'll soon figure out Emacsen way of posting to Blogger.