Skip to content

Instantly share code, notes, and snippets.

@davep
Created July 19, 2017 13:31
Show Gist options
  • Save davep/d184af4c3509636fb3516c376e490a33 to your computer and use it in GitHub Desktop.
Save davep/d184af4c3509636fb3516c376e490a33 to your computer and use it in GitHub Desktop.
;; Create and switch to a test buffer.
(with-current-buffer (get-buffer-create "*Foo*")
;; Ensure it's empty, for testing purposes.
(setf (buffer-string) "")
;; Insert some test text
(insert "hello, world!")
;; Now use `shell-command-on-region' to manipulate it.
(shell-command-on-region (point-min) (point-max) "tr a-z A-Z" (current-buffer) t))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment