From f062b726cc4f6fa2ccfdd843f459c0189db16cfa Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Thu, 7 Jun 2012 23:50:58 +0200 Subject: [PATCH] New function to search & replace through the ECL project using regexp. --- src/util/emacs.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/util/emacs.el b/src/util/emacs.el index 29ee5dfb8..8b3536c6e 100644 --- a/src/util/emacs.el +++ b/src/util/emacs.el @@ -43,6 +43,17 @@ (perform-replace from-string to-string t nil delimited nil nil start end)))) +(defun query-replace-regexp-ecl (from-string to-string &optional delimited start end) + (interactive (query-replace-read-args "Query replace" nil)) + (setq ecl-search-string from-string) + (let ((remaining (member (buffer-file-name (current-buffer)) ecl-files))) + (dolist (i (or remaining ecl-files)) + (let ((b (find-buffer-visiting i))) + (unless (equal b (current-buffer)) + (switch-to-buffer b) + (beginning-of-buffer))) + (query-replace-regexp from-string to-string delimited start end)))) + (defun search-ecl (string) (interactive "sString: ") (setq ecl-search-string string)