]> git.eshelyaron.com Git - emacs.git/commit
kmacro: Simplify register code and recent change
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 24 Feb 2023 19:18:24 +0000 (14:18 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 24 Feb 2023 19:18:24 +0000 (14:18 -0500)
commita129f257720dbef9adcaff58862d45ac142f93f6
tree99b56f2ee6e9ff4b749345efebc074901826b046
parent926e3fb3be5c84e71316c6f184abe05bdb29bff2
kmacro: Simplify register code and recent change

While reviewing uses of `last-kbd-macro` for more problems like
those of bug#61700 I noticed that we don't need the `kmacro-register`
type any more (we can directly use the new `kmacro` type instead).
Also `macros.el` requires `kmacro` so rather than autoload
`macro--string-to-vector` it's simpler to move the function to
`kmacro.el`.  And while at it fold into it the `stringp` test that's used
before every call to that function.

* lisp/kmacro.el (kmacro--to-vector): Rename from
`macro--string-to-vector`, move from `mcros.el`, and make it work for
vectors.
(kmacro-ring-head, kmacro-lambda-form): Simplify accordingly.
(cl-print-object): Remove unused declaration.
(kmacro-register): Delete type.  Use `kmacro` objects instead.
(register-val-jump-to, register-val-describe, register-val-insert):
Rewrite accordingly.
(kmacro-to-register): Put the `kmacro` object.

* lisp/macros.el (macro--string-to-vector): Move to `kmacro.el`.
(insert-kbd-macro): Use `kmacro--to-vector`.

* src/macros.c (end_kbd_macro): Always generate a vector.
lisp/kmacro.el
lisp/macros.el
src/macros.c