Skip to content

Instantly share code, notes, and snippets.

@syohex
Created April 16, 2014 02:10
Show Gist options
  • Save syohex/10798319 to your computer and use it in GitHub Desktop.
Save syohex/10798319 to your computer and use it in GitHub Desktop.
toggle between `let` and `let*`
(defun my/toggle-let ()
(interactive)
(save-excursion
(when (re-search-backward "(\\(let\\)\\(\\*\\)?" nil t)
(goto-char (match-end 1))
(if (and (match-string 2) (string= (match-string 2) "*"))
(delete-char 1)
(insert "*"))
(backward-up-list)
(indent-pp-sexp))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment