evil-mc icon indicating copy to clipboard operation
evil-mc copied to clipboard

Support for AUCTeX commands?

Open 3rd3 opened this issue 9 years ago • 6 comments

I'm wondering what is in the way of supporting for example simply inserting a backslash (the AUCTeX TeX-insert-backslash command). What does need to be done to add support for it?

3rd3 avatar Apr 24 '16 16:04 3rd3

You just need to add it to the known commands. See evil-mc-known-commands.el

gabesoft avatar Apr 26 '16 14:04 gabesoft

  (nconc evil-mc-known-commands
         '(
           (TeX-insert-backslash . ((:default . evil-mc-execute-default-call-with-count)))
           (LaTeX-insert-left-brace . ((:default . evil-mc-execute-default-call-with-count)))
           (LaTeX-insert-right-brace . ((:default . evil-mc-execute-default-call-with-count)))
           (LaTeX-babel-insert-hyphen . ((:default . evil-mc-execute-default-call-with-count)))
           (TeX-insert-sub-or-superscript . ((:default . evil-mc-execute-default-call-with-count)))
           (TeX-insert-dollar . ((:default . evil-mc-execute-default-call-with-count)))
           ))

This is what I got so far, however inserting a dollar sign does not automatically insert the closing dollar sign for some reason. Also, the keys following the pass through command C-q are not recognized. I couldn't figure out which command is called because one cannot call describe-key in between as it seems. The other command work just fine.

3rd3 avatar Sep 23 '16 22:09 3rd3

If you want to see what command it's trying to execute just run evil-mc-executing-debug-on and you should see the debug statements in the Messages buffer when you try to run a command with the cursors enabled. But, the commands above are a good start. I'll add them in when I get a chance

gabesoft avatar Sep 23 '16 22:09 gabesoft

When inserting a dollar sign with debug on I simply get these messages:

evil-mc Execute TeX-insert-dollar for all cursors
evil-mc Execute TeX-insert-dollar with evil-mc-execute-default-call-with-count [3 times]

However, it still only inserts a dollar sign at the main cursor.

3rd3 avatar Sep 09 '17 14:09 3rd3

Maybe it is actually some smartparens function that needs to be whitelisted such that the second dollar sign is inserted as well?

3rd3 avatar Sep 09 '17 15:09 3rd3

You could try disabling smartparens just to see if the issue is caused by it

gabesoft avatar Sep 09 '17 15:09 gabesoft