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

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

Re: is insert(backspace and overwrite character) possible?


From: Barry Margolin
Subject: Re: is insert(backspace and overwrite character) possible?
Date: Sat, 08 May 2010 20:41:29 -0400
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

In article <87r5lm6u4g.fsf@merciadriluca-station.MERCIADRILUCA>,
 Merciadri Luca <Luca.Merciadri@student.ulg.ac.be> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> 
> In some definition, I have
> 
> ==
> (insert "-- \n")
> ==
> 
> Let's say that the text is
> 
> ==
> dummy text
> 
> ==
> 
> It then writes
> ==
> dummy text
> - --
> 
> ==
> 
> That's nice, but my text is not that one, unfortunately. Let's say
> that the text is
> 
> ==
> dummy text
> - - --
> ==
> 
> How can I make an `insert' to overwrite the first `-' and the related
> space? With
> 
> ==
> dummy text
> - - --
> ==
> 
> I would like to have
> 
> ==
> dummy text
> - --
> ==
> 
> by simply calling insert. Is it possible? I know that this is possible
> in C language.

You can't do it just with insert, and I don't know how you would do it 
in C, either.  You need to write a conditional, like

(if (looking-at "- ")
    (delete-char 2))

before doing the insert.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


reply via email to

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