Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!itivax!umich!zip!spencer From: spencer@eecs.umich.edu (Spencer W. Thomas) Newsgroups: gnu.emacs.bug Subject: Re: replace-regexp Message-ID: Date: 12 Apr 89 00:48:42 GMT References: <8904102352.AA22601@inria.inria.fr> Sender: news@zippy.eecs.umich.edu Distribution: gnu Organization: University of Michigan EECS Dept Lines: 20 In-reply-to: loic%axis_d@axis.axis.fr's message of 10 Apr 89 23:52:42 GMT In article <8904102352.AA22601@inria.inria.fr> loic%axis_d@axis.axis.fr writes: > (replace-regexp "^." "" ()) > > It empties my buffer ! > ... > It should skip to the next new-line. Don't you think so ? Well, no. Emacs is a character-oriented editor, NOT a line-oriented editor. Would you want it to skip to the next line after each replacement if the strings were (say) "abc" and ""? How should it distinguish the two cases? To get the effect (that I presume) you want, you can say (replace-regexp "^.\\(.?\\)" "\\1") or (replace-regexp "^.\\(.*\\)" "\\1") I think the first will be a little more efficient. -- =Spencer (spencer@eecs.umich.edu)