drym-org / symex.el

An intuitive way to edit Lisp symbolic expressions ("symexes") structurally in Emacs
Other
271 stars 22 forks source link

Incorporate evil-repeat into `symex-command` macros #97

Open countvajhula opened 1 year ago

countvajhula commented 1 year ago

In order to mark a function as repeatable for the purposes of evil-repeat (dot), we do this in symex-evil.el:

  (dolist (fn symex--evil-repeatable-commands)
    (evil-add-command-properties fn :repeat t)))

This loops through a list of explicitly declared repeatable commands which are then "registered" for repetition in this way. This has a few drawbacks:

  1. We need to explicitly declare commands as repeatable, so it's extra maintenance work.
  2. If users write commands for Symex, they would need to explicitly register it for repetition in the same way.

Now that we have the new macros symex-define-command and symex-define-insertion-command (which are basically just the same function definitions as before but wrapped with logic common to all commands -- currently just tidying), we can add the registration in the macros and eliminate the need to explicitly maintain the list. User commands defined using these macros would also implicitly be repeatable.

countvajhula commented 1 year ago

@j-shilling in case you have time to look at it