Skip to content

Instantly share code, notes, and snippets.

@iantruslove
Last active August 29, 2015 14:19
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 iantruslove/3ba86b00c0fe5ab0a962 to your computer and use it in GitHub Desktop.
Save iantruslove/3ba86b00c0fe5ab0a962 to your computer and use it in GitHub Desktop.
Emacs function to remove results from a Gorilla REPL clojure notebook file
(defun gorilla-empty-all-results* ()
(while (re-search-forward
";; @@\n\\(;; ->\n\\)?\\(;;;.*\n\\)*\\(;; <-\n\\)?;; =>\n\\(;;;.*\n\\)+;; <="
nil t)
(replace-match ";; @@")))
(defun gorilla-empty-all-results ()
"Empty all Gorilla REPL result blocks"
(interactive)
(save-excursion
(goto-char 0)
(gorilla-empty-all-results*)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment