From: William Case <billlinux@rogers.com>
To: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
Cc: EMACS List <help-gnu-emacs@gnu.org>
Subject: Re: newbie elisp help ??
Date: Wed, 15 Aug 2007 14:16:56 -0400 [thread overview]
Message-ID: <1187201816.2712.177.camel@CASE> (raw)
In-Reply-To: <46C33C86.7010104@gmail.com>
Hi Lennart;
Thanks for the speedy reply.
On Wed, 2007-08-15 at 19:48 +0200, Lennart Borgman (gmail) wrote:
> 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 ?*))
Unfortunately, (make-string 50 ?*) is the single character '*', I was
shooting for something that was a repetition of two characters (*SPC) so
that my section divider looked like:
/* * * * * * * * * * * * * * * * * * * * */
I would begin and end the function with (insert 47).
I tried (insert (make-string 5 "* ")) and variations thereof, i.e. with
and without quotes and ASCII numbers.
--
Regards Bill
next prev parent reply other threads:[~2007-08-15 18:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-15 17:27 newbie elisp help ?? William Case
2007-08-15 17:48 ` Lennart Borgman (gmail)
2007-08-15 18:16 ` William Case [this message]
2007-08-15 18:24 ` Lennart Borgman (gmail)
[not found] ` <46C342F9.8070808@gmail.com>
2007-08-15 19:07 ` William Case
[not found] <mailman.4824.1187198869.32220.help-gnu-emacs@gnu.org>
2007-08-15 18:02 ` Pascal Bourguignon
2007-08-15 19:04 ` William Case
2007-08-17 20:44 ` Thien-Thi Nguyen
2007-08-15 20:08 ` Joel J. Adamson
2007-08-16 2:30 ` William Case
[not found] ` <mailman.4845.1187231410.32220.help-gnu-emacs@gnu.org>
2007-08-16 14:09 ` Joel J. Adamson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1187201816.2712.177.camel@CASE \
--to=billlinux@rogers.com \
--cc=help-gnu-emacs@gnu.org \
--cc=lennart.borgman@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.