mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-12-17 02:44:17 +00:00
added about 10 elisp keywords. work in progress to add more.
This commit is contained in:
17
snippets/emacs-lisp-mode/x-find-replace.yasnippet
Executable file
17
snippets/emacs-lisp-mode/x-find-replace.yasnippet
Executable file
@@ -0,0 +1,17 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: find and replace on region
|
||||
# --
|
||||
(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