Skip to content

Add #_ reader form  #334

@agzam

Description

@agzam

Clojure's #_ (Ignore next form reader macro) is very useful. Would be very cool to have a function and a dedicated key binding to toggle it.

My initial attempt looks like this:

(defun cljr-toggle-ignore-next-form ()
  "Ignore next 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 "#_")))))

What do you guys, think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions