help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie elisp help ??


From: Lennart Borgman (gmail)
Subject: Re: newbie elisp help ??
Date: Wed, 15 Aug 2007 19:48:54 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666

William Case wrote:
Hi;

I am trying to write a function that will insert a line of asterisks+
spaces across a buffer (as a section divider).  It was started as an
exercise and has become an exercise in futility.

I am working in the scratch pad using C-j to test the function as it is
being built.  I have:  (insert "* ").  It returns "* nil". Obviously I
don't want the "nil" to appear. How do I get rid of it?
More importantly to me, how do I get the (insert "* ") command to repeat
27 times to give me 54 characters across the buffer?  I know how to make
a recursive loop, but it seems to me this is a fairly common challenge
and there is a probably a function for repetition that I can't find.

I suppose I am asking for the programming equivalent of 'C-u n'.

'insert-char' allows for repeating but only one character at a time, not
two.

Any guidance would be appreciated.

Try this:

  M-: (insert (make-string 50 ?*))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]