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: David Kastrup
Subject: Re: How to concatenate a backslash to a string
Date: Mon, 27 Nov 2006 17:58:11 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

"Mirko" <address@hidden> writes:

> Hello group.
>
> When in *scratch* I try
> (concat "\\" "%")
> I get "\\%"

Sure.

> But what I really want is to get "\%".

There is no such thing.  This is illegal string syntax.

> (I am trying to TeXify some text and convert %->\%, $->\$, etc).

Have you tried what happens if you do
(insert "\\%")
in a buffer?

> If I try (concat "\" "%") I get a syntax error because the \ is
> escaping the ".

Sure.  But you don't expect when typing
(insert "x")
that the quote characters end up in your buffer, as they are merely
part of the string syntax.  So why do you expect that the doubled
backslashes, which are merely part of the string syntax, end up in the
buffer?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

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