diff options
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-replace | 17 |
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 “<” and other chars in HTML. | ||
| 6 | This 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 "&" nil t)) | ||
| 12 | (goto-char (point-min)) | ||
| 13 | (while (search-forward "<" nil t) (replace-match "<" nil t)) | ||
| 14 | (goto-char (point-min)) | ||
| 15 | (while (search-forward ">" nil t) (replace-match ">" nil t)) | ||
| 16 | ) | ||
| 17 | ) | ||
