From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Santanu Newsgroups: gmane.emacs.help Subject: Re: What's wrong with this code?? Date: Tue, 18 May 2010 10:34:34 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <65c33ee7-8443-4cec-8227-9005bf4fe494@v29g2000prb.googlegroups.com> <87eiha5ipf.fsf@fh-trier.de> <47907911-2186-4668-81d3-e0475196ade1@n37g2000prc.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291832362 14363 80.91.229.12 (8 Dec 2010 18:19:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 18:19:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 08 19:19:18 2010 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 1PQObm-0006Jd-7v for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 19:19:18 +0100 Original-Received: from localhost ([127.0.0.1]:58062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQObl-00058Y-IP for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 13:19:17 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!p5g2000pri.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-NNTP-Posting-Host: 115.242.236.48 Original-X-Trace: posting.google.com 1274204074 1149 127.0.0.1 (18 May 2010 17:34:34 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 18 May 2010 17:34:34 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p5g2000pri.googlegroups.com; posting-host=115.242.236.48; posting-account=R_BDFgoAAABML1HpMLCTWTyWOZzR1via User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:178246 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:75777 Archived-At: On May 18, 7:37=A0pm, Fr=E9d=E9ric Perrin wrote: > Santanu writes: > > On May 18, 2:20=A0am, Andreas Politz wrote: > >> Santanu writes: > >> > Can you tell me what is wrong with this code: > >> > ------------------- > >> > (setq > >> > =A0 =A0go-packages-installed > >> > =A0 =A0(split-string > >> > =A0 =A0 (shell-command-to-string > >> > =A0 =A0 =A0"cd $GOROOT/src/pkg && find . -iname *.go | sed -e 's|^\.= /||g; s|/ > >> > [^/]*\.go||g' | sort | uniq"\ > >> > ))) > > >> You have to escape the backslash characters, because of string > >> expansion. > > > BTW, can you also explain a bit what it means when I don't put the > > double backslash character, and instead use a single backslash? I > > ask this because my original code (the incorrect one above) did > > produce some correct results. > > The first expression in the sed was =AB s|^./||g; =BB (which didn't hurt, > because it seems that you don't have directories whoose name contains > only a single letter), and the second wes =AB s|/[^/]*.go||g =BB, with th= e > LHS matching strings such as =AB /svgo =BB. Ah... I see. Now I understand. So, basically, just a singe '\' character in an elisp regexp string acts as if it wasn't even there in the first place. Thank you for the explanation. Regards, Santanu