|
From: | Emanuel Berg |
Subject: | Re: replace deprecated function ? |
Date: | Wed, 14 Feb 2018 00:33:13 +0100 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
> (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) ))) Perhaps better looking: (defun replace-list-ask-2 (list-pairs) (cl-loop for (search . replace) in list-pairs do (query-replace-regexp search replace nil (point-min) (point-max)) )) ;; (replace-list-ask-2 '(("james" . "James") ("blish" . "Blish"))) ;; james blish james blish -- underground experts united http://user.it.uu.se/~embe8573
[Prev in Thread] | Current Thread | [Next in Thread] |