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

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

Re: Then how to replace all my $$ ... $$ to \[ \] through search and rep


From: Reiner Steib
Subject: Re: Then how to replace all my $$ ... $$ to \[ \] through search and replace?
Date: Sat, 16 Aug 2008 17:45:07 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux)

On Sat, Aug 16 2008, harven wrote:

>> David Kastrup once mention this (or a similar example with
>> `replace-regexp') on some newsgroup or mailing list.  I don't remember
>> if it is possible to use this with M-x replace-... or
>> query-replace... as well.
>
> M-:(replace-regexp "\\$\\$" '("\\\[" "\\\]"))

Of course you can call `eval-expression', but I was takling about
commands (interactive functions).

> It is in fact a feature of the perform-replace function.
> Quoting the elisp manual section dealing with this function:

,----[ (info "(elisp)Search and Replace") ]
|  -- Function: perform-replace from-string replacements query-flag
|           regexp-flag delimited-flag &optional repeat-count map start
|           end
|      This function is the guts of `query-replace' and related commands.
|      [...]
| 
|      The argument REPLACEMENTS specifies what to replace occurrences
|      with.  If it is a string, that string is used.  It can also be a
|      list of strings, to be used in cyclic order.
`----

Thanks.

However, IMHO this neat feature should be available interactively
(maybe it is?) and the documentation should not be hidden in (info
"(elisp)Search and Replace") under the internal function
`perform-replace'.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/


reply via email to

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