Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Emacs string replace function that works on the entire buffer regardless of cursor position
(provide 'mystuff)
(defun replace-all (from to)
(interactive "sReplace: \nsWith: ")
(save-excursion
(goto-char (point-min))
(replace-string from to)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment