Skip to content

Instantly share code, notes, and snippets.

@davidsm
Created July 24, 2015 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidsm/e3edbfc32e5ac59665b2 to your computer and use it in GitHub Desktop.
Save davidsm/e3edbfc32e5ac59665b2 to your computer and use it in GitHub Desktop.
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