[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28008: 25.2; Resume kmacro definition errors C-u C-u <F3>
From: |
Tino Calancha |
Subject: |
bug#28008: 25.2; Resume kmacro definition errors C-u C-u <F3> |
Date: |
Tue, 08 Aug 2017 14:26:54 +0900 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Allen Li <vianchielfaura@gmail.com> writes:
> Reproduction:
>
> 1. emacs -Q
> 2. F3
> 3. Type some stuff (asdfasdf)
> 4. C-g
> 5. C-u C-u F3
>
> Expected: kmacro definition resumes
>
> Actual: error
>
> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
> start-kbd-macro(t t)
Thank you for the report.
I)
Isn't it this behavior expected?
C-g ends `start-kbd-macro' before any macro has
being saved; i.e., `last-kbd-macro' is nil, so we cannot append to it.
You must have a saved macro to append:
emacs -Q
F3
(insert "a") RET
F4 ; save it in `last-kbd-macro'
C-u C-u F3 ; Apped to it.
(insert "b") RET
F4 ; Save it.
F4 ; This insert "ab" in the current buffer.
2)
Expected or not, i think `kmacro-start-macro' might throw an error
when the user wants to append and `start-kbd-macro' is nil.
--8<-----------------------------cut here---------------start------------->8---
commit 9c86eed0b015950a4ae06243c5807d9b864eb69f
Author: Tino Calancha <tino.calancha@gmail.com>
Date: Tue Aug 8 14:14:55 2017 +0900
Append kbd macro only if last-kbd-macro is non-nil
* lisp/kmacro.el (kmacro-start-macro): Append only if
last-kbd-macro is non-nil (Bug#28008).
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index 2db8061fa4..8eff7e5c2e 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -584,7 +584,8 @@ kmacro-start-macro
kmacro-last-counter kmacro-counter
kmacro-counter-format kmacro-default-counter-format
kmacro-counter-format-start kmacro-default-counter-format))
-
+ (when (and append (null last-kbd-macro))
+ (user-error "No kbd macro has been defined"))
(start-kbd-macro append
(and append
(if kmacro-execute-before-append
--8<-----------------------------cut here---------------end--------------->8---
In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
of 2017-08-08
Repository revision: c3445aed51944becb3e58f5dace8121c0021f6c7
- bug#28008: 25.2; Resume kmacro definition errors C-u C-u <F3>, Allen Li, 2017/08/08
- bug#28008: 25.2; Resume kmacro definition errors C-u C-u <F3>,
Tino Calancha <=
- bug#28008: 25.2; Resume kmacro definition errors C-u C-u <F3>, Allen Li, 2017/08/08
- bug#28008: 25.2; Resume kmacro definition errors C-u C-u <F3>, Tino Calancha, 2017/08/11
- bug#28008: 25.2; Resume kmacro definition errors C-u C-u <F3>, Eli Zaretskii, 2017/08/11
- bug#28008: 25.2; Resume kmacro definition errors C-u C-u <F3>, Tino Calancha, 2017/08/11
- bug#28008: 25.2; Resume kmacro definition errors C-u C-u <F3>, Tino Calancha, 2017/08/11
- bug#28008: 25.2; Resume kmacro definition errors C-u C-u <F3>, Allen Li, 2017/08/13