unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
Subject: Re: delete the first few chars of each line
Date: 21 Sep 2003 21:51:47 +0200	[thread overview]
Message-ID: <x5wuc1yl64.fsf@lola.goethe.zz> (raw)
In-Reply-To: m2k782c4eo.fsf@yahoo.com

Zimmen Gnauh <yah00204052@yahoo.com> writes:

>   To delete the first 10 chars of a line. Is there any simpler way
> than the following:
> 
> (let beg (progn (beginning-of-line) (point))
>         (delete-region beg 10))

This is a trick question.  The code above does something completely
different.

I'd probably do something like
(progn
  (beginning-of-line)
  (delete-region (point) (+ 10 (point))))

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2003-09-21 19:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-21 19:43 delete the first few chars of each line Zimmen Gnauh
2003-09-21 19:51 ` David Kastrup [this message]
2003-09-21 20:21   ` Stefan Monnier
2003-09-21 20:49     ` David Kastrup
2003-09-22 20:08 ` Pascal Bourguignon

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x5wuc1yl64.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).