From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: weber Newsgroups: gmane.emacs.help Subject: Re: "C-a" the first character in each line? Date: Sun, 24 Jun 2007 13:59:37 -0000 Organization: http://groups.google.com Message-ID: <1182693577.251257.35950@u2g2000hsc.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1182696042 18596 80.91.229.12 (24 Jun 2007 14:40:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 24 Jun 2007 14:40:42 +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 Jun 24 16:40:41 2007 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.50) id 1I2TGZ-0007g0-IP for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Jun 2007 16:40:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2TGZ-0000lh-39 for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Jun 2007 10:40:39 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!u2g2000hsc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-NNTP-Posting-Host: 189.6.212.239 Original-X-Trace: posting.google.com 1182693577 23745 127.0.0.1 (24 Jun 2007 13:59:37 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 24 Jun 2007 13:59:37 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.4) Gecko/20061201 Firefox/2.0.0.4 (Ubuntu-feisty),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: u2g2000hsc.googlegroups.com; posting-host=189.6.212.239; posting-account=pG57fA0AAADtQ-4h1MyvjXjZpSNZC0zj Original-Xref: shelby.stanford.edu gnu.emacs.help:149656 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:45245 Archived-At: On Jun 24, 10:20 am, Nikos Apostolakis wrote: > Hello group, > > in the scratch buffer I did > > ----------------- > (while (search-forward-regexp "^\\(.\\)" nil t) > (replace-match "\% \1")) > > laa > moo > nii > ----------------- > > I expected > > % > % laa > % moo > % nii > > but isnstead I get > > % ^A > % ^Aaa > % ^Aoo > % ^Aii > > where ^A stands for the character "C-a". > > What am I missing? > > TIA, > Nikos Dunno why, but \\1 instead of \1 solves it. Or alternatively: (while (search-forward-regexp "^\\(.\\)" nil t) (replace-match (concat "% "(match-string 1)))) which looks better to me... HTH, weber