evil icon indicating copy to clipboard operation
evil copied to clipboard

Why does Evil store macros differently from `kmacro-to-register`?

Open okamsn opened this issue 3 years ago • 1 comments

Issue type

  • Question

Environment

Emacs version: 28.1 Operating System: Ubuntu 22.04 Evil version: 1.14.0 Evil installation type: MELPA Graphical/Terminal: X Tested in a make emacs session (see CONTRIBUTING.md): No

Reproduction steps

  • Start Emacs
  • Record Evil Macro into a register
  • Run view-register.
  • See that Evil kmacro is not displayed correctly.
  • Record Emacs macro.
  • Run kmacro-to-register.
  • Run view-register.
  • See that the Emacs kmacro is formatted correctly.
  • Run evil-view-registers.
  • See that the Evil macro is formatted correctly and that the Emacs macro is not formatted correctly.

Expected behavior

  • That Evil kmacros stored in registers would be formatted the same as Emacs kmacros stored in registers in commands like view-register and evil-view-registers.
  • That the data types would be the same.

Actual behavior

  • Evil seems to store its kmacros as strings or vectors, which Emacs does not recognize as kmacros in view-register.

Further notes

Question:

  • What is the benefit of not using the method that Emacs uses to store keyboard macros in registers?

okamsn avatar May 09 '22 01:05 okamsn

I don't know why, but having spent some time in this part of the codebase, I don't get the impression compatibility with Emacs' kmacro functionality was a top priority when this was implemented. A PR is welcome, but writing regression tests for macro functionality is hard (because tests use macros), so I'd expect a fairly thorough list of manual tests I can follow, in their absence.

tomdl89 avatar May 09 '22 20:05 tomdl89