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

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

Re: replace deprecated function ?


From: Yuri Khan
Subject: Re: replace deprecated function ?
Date: Wed, 14 Feb 2018 09:36:09 +0700

On Wed, Feb 14, 2018 at 6:26 AM, Emanuel Berg <moasen@zoho.com> wrote:

>> Thanks Emanuel but I need it to be more
>> interactive.
>
> (defun replace-list-ask (list-pairs)
>   (save-excursion
>     (cl-loop for (search . replace) in list-pairs do
>              (goto-char (point-min))
>              (query-replace-regexp search replace) )))
>
> ;; (replace-list-ask '(("james" . "James") ("blish" . "Blish")))

This will ask for all jameses first, and then all blishes. The
original snippet probably intended to do them all in document order.



reply via email to

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