Path: blob/master/elisp/emacs-for-python/yasnippet/snippets/emacs-lisp-mode/find-replace
1494 views
#name : find and replace on region
#contributor : Xah Lee
# --
(defun replace-html-chars-region (start end)
"Replace “<” to “<” and other chars in HTML.
This works on the current region."
(interactive "r")
(save-restriction
(narrow-to-region start end)
(goto-char (point-min))
(while (search-forward "&" nil t) (replace-match "&" nil t))
(goto-char (point-min))
(while (search-forward "<" nil t) (replace-match "<" nil t))
(goto-char (point-min))
(while (search-forward ">" nil t) (replace-match ">" nil t))
)
)