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

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

Re: newbie elisp help ??


From: William Case
Subject: Re: newbie elisp help ??
Date: Wed, 15 Aug 2007 15:07:03 -0400

Hi Alexis;

BINGO! Worked like a charm.

On Wed, 2007-08-15 at 20:16 +0200, Alexis Roda wrote:
> En/na William Case ha escrit:
> > Hi;
> > 
> > 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? 
> 
> the insert function inserts "*" and returns nil. You call it by its side 
> effects, so you can safely ignore the return value (it will not be 
> inserted).
> 
> > 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.
> 
> Probably there's a better way:
> 
> (dotimes (some_var 27) (insert "* "))

Tried dotimes early on.  Couldn't get it to work so I moved on.
I don't remember what I did exactly, that was hours ago, but your
suggestion sure works.  Thanks.

-- 
Regards Bill





reply via email to

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