[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Replacement
From: |
Juri Linkov |
Subject: |
Re: Replacement |
Date: |
Fri, 28 Oct 2005 09:03:15 +0300 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
>> Let us consider a source text for LateX and assume that we want to
>> replace the command for an accented letter by the accented letter
>> itself. For example, replacing \`{a} by à using the accurate
>> coding. If we look into the documentation and would like to
>> perform this operation by means of a Lisp code, that should be:
>> (beginning-of-buffer)
>> (while (re-search-forward "\\\B`{a}" nil t)
>> (replace-match "Ã " nil nil))
>> Unfortunately, the replacement is \`{a} ====> \Ã
>
> "\\\B..." is the same as "\\B...". I think you meant "\\\\B..."
Unquoted string "\\\\B" is `\\B' which matches two characters `\' and `B'.
I don't think this is what is wanted. But "\\\\\\B" will work fine, since,
when unquoted, it is equal to `\\\B' which matches one character `\',
and the empty string not at word boundary with `\B'.
--
Juri Linkov
http://www.jurta.org/emacs/