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

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

Re: How to concatenate a backslash to a string


From: Mirko
Subject: Re: How to concatenate a backslash to a string
Date: 27 Nov 2006 10:27:22 -0800
User-agent: G2/1.0

Perry Smith wrote:
> On Nov 27, 2006, at 10:37 AM, Mirko wrote:
>
> > Hello group.
> >
> > When in *scratch* I try
> > (concat "\\" "%")
> > I get "\\%"
> >
> > But what I really want is to get "\%".   (I am trying to TeXify some
> > text and convert %->\%, $->\$, etc).
> >
> > If I try (concat "\" "%") I get a syntax error because the \ is
> > escaping the ".
>
> You may be getting what you want.  Notice that "\\" in the scratch
> buffer gives you back "\\" (I'm assuming you are hitting control-J to
> eval and print the line.
>
> I don't think you can get any string in the scratch buffer to print
> like you want it.  It will always have an even number of \'s when
> printed.
>
> Perry Smith ( address@hidden )
> Ease Software, Inc. ( http://www.easesoftware.com )
>
> Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems

Thanks to all three of you.  Indeed, I was confused by the output in
the *scratch* buffer.  Once I tested the ouput of my commands in an
actual buffer, I was got the expected behavior: a single backslash
followd by whatever symbol I wanted.

Thanks again

Mirko

PS  Another newbie question is brewing, but I am still trying to figure
it out :-)



reply via email to

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