diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-04-01 20:07:33 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-04-01 20:07:33 -0400 |
commit | c75f65442ddfd2427d95278c44214c0cf1d5a2ee (patch) | |
tree | 2f8c0d01cca64216d8592e1e0d0522c8ccc97c82 /lisp/font-lock.el | |
parent | a15f9d4e58223c6b40b0522e2f2921830b136894 (diff) | |
download | emacs-c75f65442ddfd2427d95278c44214c0cf1d5a2ee.tar.gz emacs-c75f65442ddfd2427d95278c44214c0cf1d5a2ee.tar.bz2 emacs-c75f65442ddfd2427d95278c44214c0cf1d5a2ee.zip |
kmacro: Represent it as an OClosure
Merge the old lambda+list into a single OClosure object which plays
both roles at the same time. Take advantage of it to provide a
`cl-print-object` method so kmacro objects print nicely using the
`key-parse` syntax.
Also replace the old `kmacro-lambda-form` with a new `kmacro` constructor
which takes a `key-parse` syntax, so that the code inserted with
`insert-kbd-macro` is now more readable.
* lisp/kmacro.el (kmacro): New OClosure type.
(kmacro-ring-head): Use `kmacro` constructor.
(kmacro-push-ring): Convert `elt` from old representation if needed.
(kmacro-split-ring-element, kmacro-view-ring-2nd, kmacro-view-macro):
Adapt to new representation.
(kmacro-exec-ring-item): Turn into obsolete alias.
(kmacro-call-ring-2nd, kmacro-end-or-call-macro): Adjust accordingly.
(kmacro-start-macro): Simplify call to `kmacro-push-ring`.
(kmacro): New constructor function. Replaces `kmacro-lambda-form`.
(kmacro-lambda-form): Use it and declare obsolete.
(kmacro-extract-lambda): Rewrite and declare obsolete.
(kmacro-p): Rewrite.
(cl-print-object): New method.
(kmacro-bind-to-key, kmacro-name-last-macro): Simplify.
* lisp/macros.el (macro--string-to-vector): New function.
(insert-kbd-macro): Use it. Generate code using the `kmacro` constructor.
* test/lisp/kmacro-tests.el (kmacro-tests-kmacro-bind-to-single-key):
Silence warning.
(kmacro-tests-name-last-macro-bind-and-rebind): Strengthen the test a bit.
(kmacro-tests--cl-print): New test.
Diffstat (limited to 'lisp/font-lock.el')
0 files changed, 0 insertions, 0 deletions