summaryrefslogtreecommitdiff
path: root/.emacs.d/mysnippets/text-mode/emacs-lisp-mode/find-replace
diff options
context:
space:
mode:
authorSimeon Simeonov2015-02-04 21:41:42 +0100
committerSimeon Simeonov2015-02-04 21:41:42 +0100
commit897eee81de8b3f6adf0165f50e95600a7b89c20c (patch)
tree5ee19c07c40e822e15a6443e5db5601c28913454 /.emacs.d/mysnippets/text-mode/emacs-lisp-mode/find-replace
parent9a46567eb167e5aef4b2e760c5d6bdc4fe1ba06a (diff)
Standalone lisp and snippet repo
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 )