Last active
April 19, 2017 19:35
-
-
Save reinh/f7cbe38904b896516ebb808bbd542ae9 to your computer and use it in GitHub Desktop.
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 agda/comment-in () | |
(interactive) | |
(save-excursion | |
(search-backward "{-+}") | |
(forward-char 4) | |
(backward-delete-char 2) | |
(insert-string "(-}") | |
(search-forward "{+-}") | |
(backward-delete-char 3) | |
(insert-string "-)-}") | |
(search-backward "{-(-}") | |
(next-line) | |
(agda2-load))) | |
(defun agda/comment-out () | |
(interactive) | |
(save-excursion | |
(search-backward "{-(-}") | |
(forward-char 4) | |
(backward-delete-char 2) | |
(insert-string "+") | |
(search-forward "-)-}") | |
(backward-delete-char 4) | |
(insert-string "+-}") | |
(next-line) | |
(agda2-load))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A slightly modified version of @pigworker's comment region twidding idiom, as seen here: https://github.com/pigworker/CS410-16/blob/master/exercises/Ex1.agda#L160-L163
Changes:
save-excursion
.agda/comment-in
to expect the point to start inside the region rather than above it.