Skip to content

Instantly share code, notes, and snippets.

@jcreedcmu
Created October 16, 2017 20:52
Show Gist options
  • Select an option

  • Save jcreedcmu/d258f476cead775200196aacec71b24e to your computer and use it in GitHub Desktop.

Select an option

Save jcreedcmu/d258f476cead775200196aacec71b24e to your computer and use it in GitHub Desktop.
;; if the binding at point is implicit, make it explicit, and vice-versa
(defun jcreed-swap-agda-implicit ()
(interactive)
(save-excursion
(if (re-search-backward "[({]" nil t)
(let ((ms (match-string 0)))
(cond
((equal ms "(")
(replace-match "{")
(re-search-forward ")")
(replace-match "}"))
((equal ms "{")
(replace-match "(")
(re-search-forward "}")
(replace-match ")")))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment