Last active
August 29, 2015 14:19
-
-
Save iantruslove/3ba86b00c0fe5ab0a962 to your computer and use it in GitHub Desktop.
Emacs function to remove results from a Gorilla REPL clojure notebook file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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