diff options
| author | Robert Pluim | 2023-02-24 11:12:24 +0100 |
|---|---|---|
| committer | Robert Pluim | 2023-02-24 11:43:08 +0100 |
| commit | 573d9675fd74fc50f70b3bc64f24f838f799a8aa (patch) | |
| tree | 5e52022971c75cffae1eeba4a389bb98c90bcba8 /test | |
| parent | b0cbd5590b238fa9001e3f07b7035704ef976722 (diff) | |
| download | emacs-573d9675fd74fc50f70b3bc64f24f838f799a8aa.tar.gz emacs-573d9675fd74fc50f70b3bc64f24f838f799a8aa.zip | |
Fix insertion of keyboard macro containing named keys
* lisp/kmacro.el: Autoload `macro--string-to-vector'.
(kmacro-ring-head): Convert `last-kbd-macro' to a vector if it's a
string, since `kmacro' uses `key-parse' on it.
(kmacro-lambda-form): Remove require for 'macros
* test/lisp/kmacro-tests.el
(kmacro-tests-name-last-macro-key-parse-syntax):
Test that insertion of macros that contain strings that look
like named keys works correctly.
(Bug#61700)
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/kmacro-tests.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/lisp/kmacro-tests.el b/test/lisp/kmacro-tests.el index 551fd8b60fc..a325220e8d9 100644 --- a/test/lisp/kmacro-tests.el +++ b/test/lisp/kmacro-tests.el | |||
| @@ -614,6 +614,20 @@ This is a regression test for: Bug#3412, Bug#11817." | |||
| 614 | (kmacro-tests-should-insert "bb" | 614 | (kmacro-tests-should-insert "bb" |
| 615 | (kmacro-tests-simulate-command '(kmacro-tests-symbol-for-test)))) | 615 | (kmacro-tests-simulate-command '(kmacro-tests-symbol-for-test)))) |
| 616 | 616 | ||
| 617 | ;; Bug#61700 inserting named macro when the definition contains things | ||
| 618 | ;; that `key-parse' thinks are named keys | ||
| 619 | (kmacro-tests-deftest kmacro-tests-name-last-macro-key-parse-syntax () | ||
| 620 | "Name last macro can rebind a symbol it binds." | ||
| 621 | ;; Make sure our symbol is unbound. | ||
| 622 | (when (fboundp 'kmacro-tests-symbol-for-test) | ||
| 623 | (fmakunbound 'kmacro-tests-symbol-for-test)) | ||
| 624 | (setplist 'kmacro-tests-symbol-for-test nil) | ||
| 625 | (kmacro-tests-define-macro "<b> hello </>") | ||
| 626 | (kmacro-name-last-macro 'kmacro-tests-symbol-for-test) | ||
| 627 | ;; Now run the function bound to the symbol. | ||
| 628 | (kmacro-tests-should-insert "<b> hello </>" | ||
| 629 | (kmacro-tests-simulate-command '(kmacro-tests-symbol-for-test)))) | ||
| 630 | |||
| 617 | (kmacro-tests-deftest kmacro-tests-store-in-register () | 631 | (kmacro-tests-deftest kmacro-tests-store-in-register () |
| 618 | "Macro can be stored in and retrieved from a register." | 632 | "Macro can be stored in and retrieved from a register." |
| 619 | (use-local-map kmacro-tests-keymap) | 633 | (use-local-map kmacro-tests-keymap) |