summaryrefslogtreecommitdiff
path: root/.emacs.d/mysnippets/text-mode/emacs-lisp-mode/find-replace
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/mysnippets/text-mode/emacs-lisp-mode/find-replace')
-rw-r--r--.emacs.d/mysnippets/text-mode/emacs-lisp-mode/find-replace17
1 files changed, 0 insertions, 17 deletions
diff --git a/.emacs.d/mysnippets/text-mode/emacs-lisp-mode/find-replace b/.emacs.d/mysnippets/text-mode/emacs-lisp-mode/find-replace
deleted file mode 100644
index cefcf51..0000000
--- a/.emacs.d/mysnippets/text-mode/emacs-lisp-mode/find-replace
+++ /dev/null
@@ -1,17 +0,0 @@
1#name : find and replace on region
2#contributor : Xah Lee
3# --
4(defun replace-html-chars-region (start end)
5 "Replace “<” to “&lt;” and other chars in HTML.
6This works on the current region."
7 (interactive "r")
8 (save-restriction
9 (narrow-to-region start end)
10 (goto-char (point-min))
11 (while (search-forward "&" nil t) (replace-match "&amp;" nil t))
12 (goto-char (point-min))
13 (while (search-forward "<" nil t) (replace-match "&lt;" nil t))
14 (goto-char (point-min))
15 (while (search-forward ">" nil t) (replace-match "&gt;" nil t))
16 )
17 )