Fork me on GitHub
#emacs
<
2016-05-21
>
ag06:05:14

sorry for the delay, didn’t have time earlier for that: so here’s the snippet

(defun cljr-toggle-ignore-form ()
  "clojure - ignore (comment) form"
  (interactive)
  (if (search-backward "#_" 2 t 1)
      (delete-char 2)
    (progn
      (let ((fc (following-char)))
        (cond ((-contains? '( ?\) ?\] ?\} ) fc) (paredit-backward-up))
              ((-contains? '( ?\( ?\[ ?\: ?\{ ) fc) nil)
              (t (beginning-of-thing 'sexp)))
        (insert "#_")))))

ag06:05:08

I am surprised clj-refactor doesn’t have something like this already.