From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: is insert(backspace and overwrite character) possible? Date: Sat, 08 May 2010 20:41:29 -0400 Organization: A noiseless patient Spider Message-ID: References: <87r5lm6u4g.fsf@merciadriluca-station.MERCIADRILUCA> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1273369252 12441 80.91.229.12 (9 May 2010 01:40:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 9 May 2010 01:40:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 09 03:40:50 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OAvVh-0007b6-8o for geh-help-gnu-emacs@m.gmane.org; Sun, 09 May 2010 03:40:49 +0200 Original-Received: from localhost ([127.0.0.1]:40835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAvVg-0000Na-Gy for geh-help-gnu-emacs@m.gmane.org; Sat, 08 May 2010 21:40:48 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!barmar.motzarella.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 67 Injection-Date: Sun, 9 May 2010 00:41:28 +0000 (UTC) Injection-Info: barmar.motzarella.org; posting-host="+bxBiZT/p0ZLLuDb5H+JCw"; logging-data="7479"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/IMO7ZnELpCDSfdIEkPqzN" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:jbuZoewn7lXtiP0rKE8L7mzW3BE= Original-Xref: usenet.stanford.edu gnu.emacs.help:178072 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:73600 Archived-At: In article <87r5lm6u4g.fsf@merciadriluca-station.MERCIADRILUCA>, Merciadri Luca 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 ***