mirror of
https://github.com/joaotavora/yasnippet.git
synced 2026-02-04 14:32:26 +00:00
Added some snippets for elisp-mode from Xah Lee.
This commit is contained in:
17
snippets/text-mode/emacs-lisp-mode/find-replace
Normal file
17
snippets/text-mode/emacs-lisp-mode/find-replace
Normal file
@@ -0,0 +1,17 @@
|
||||
#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))
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user