annotate src/macros.c @ 105580:49a18cece067

* bs.el (bs-mode): Fix last change. (`revert-buffer-function' should be automatically buffer-local, but isn't.)
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 13 Oct 2009 01:13:08 +0000
parents e038c1a8307c
children 68dd71358159
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 /* Keyboard macros.
64770
a0d1312ede66 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64084
diff changeset
2 Copyright (C) 1985, 1986, 1993, 2000, 2001, 2002, 2003, 2004,
100951
e038c1a8307c Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 94963
diff changeset
3 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5 This file is part of GNU Emacs.
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79759
diff changeset
7 GNU Emacs is free software: you can redistribute it and/or modify
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 it under the terms of the GNU General Public License as published by
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79759
diff changeset
9 the Free Software Foundation, either version 3 of the License, or
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79759
diff changeset
10 (at your option) any later version.
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 GNU Emacs is distributed in the hope that it will be useful,
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 GNU General Public License for more details.
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79759
diff changeset
18 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20
4696
1fc792473491 Include <config.h> instead of "config.h".
Roland McGrath <roland@gnu.org>
parents: 2961
diff changeset
21 #include <config.h>
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 #include "lisp.h"
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 #include "macros.h"
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24 #include "commands.h"
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 #include "buffer.h"
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26 #include "window.h"
11341
e0f3fa4e7bf3 Include keyboard.h.
Richard M. Stallman <rms@gnu.org>
parents: 11009
diff changeset
27 #include "keyboard.h"
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28
35119
97a19f647a12 (Qkbd_macro_termination_hook): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 34361
diff changeset
29 Lisp_Object Qexecute_kbd_macro, Qkbd_macro_termination_hook;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30
15968
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
31 /* Kbd macro currently being executed (a string or vector). */
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
32
61983
f58aeabf21e7 (Vexecuting_kbd_macro): Renamed from Vexecuting_macro. All uses changed.
Richard M. Stallman <rms@gnu.org>
parents: 57962
diff changeset
33 Lisp_Object Vexecuting_kbd_macro;
15968
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
34
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
35 /* Index of next character to fetch from that macro. */
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
36
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
37 EMACS_INT executing_kbd_macro_index;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38
15968
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
39 /* Number of successful iterations so far
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
40 for innermost keyboard macro.
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
41 This is not bound at each level,
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
42 so after an error, it describes the innermost interrupted macro. */
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
43
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
44 int executing_kbd_macro_iterations;
15968
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
45
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
46 /* This is the macro that was executing.
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
47 This is not bound at each level,
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
48 so after an error, it describes the innermost interrupted macro.
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
49 We use it only as a kind of flag, so no need to protect it. */
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
50
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
51 Lisp_Object executing_kbd_macro;
15968
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
52
23434
1dd05eb0443d (Fexecute_kbd_macro): Set real_this_command.
Richard M. Stallman <rms@gnu.org>
parents: 22968
diff changeset
53 extern Lisp_Object real_this_command;
1dd05eb0443d (Fexecute_kbd_macro): Set real_this_command.
Richard M. Stallman <rms@gnu.org>
parents: 22968
diff changeset
54
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 Lisp_Object Fexecute_kbd_macro ();
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
57 DEFUN ("start-kbd-macro", Fstart_kbd_macro, Sstart_kbd_macro, 1, 2, "P",
41940
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
58 doc: /* Record subsequent keyboard input, defining a keyboard macro.
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
59 The commands are recorded even as they are executed.
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
60 Use \\[end-kbd-macro] to finish recording and make the macro available.
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
61 Use \\[name-last-kbd-macro] to give it a permanent name.
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
62 Non-nil arg (prefix arg) means append to last macro defined;
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
63 this begins by re-executing that macro as if you typed it again.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47348
diff changeset
64 If optional second arg, NO-EXEC, is non-nil, do not re-execute last
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
65 macro before appending to it. */)
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
66 (append, no_exec)
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
67 Lisp_Object append, no_exec;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 {
11009
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
69 if (!NILP (current_kboard->defining_kbd_macro))
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 error ("Already defining kbd macro");
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71
11009
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
72 if (!current_kboard->kbd_macro_buffer)
10910
b0edc245c9b7 (defining_kbd_macro): Delete; now part of perdisplay. All uses changed.
Karl Heuer <kwzh@gnu.org>
parents: 10856
diff changeset
73 {
11009
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
74 current_kboard->kbd_macro_bufsize = 30;
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
75 current_kboard->kbd_macro_buffer
14301
621f53083d60 * macros.c (Fstart_kbd_macro): Use xmalloc.
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
76 = (Lisp_Object *)xmalloc (30 * sizeof (Lisp_Object));
10910
b0edc245c9b7 (defining_kbd_macro): Delete; now part of perdisplay. All uses changed.
Karl Heuer <kwzh@gnu.org>
parents: 10856
diff changeset
77 }
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 update_mode_lines++;
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 434
diff changeset
79 if (NILP (append))
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 {
14301
621f53083d60 * macros.c (Fstart_kbd_macro): Use xmalloc.
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
81 if (current_kboard->kbd_macro_bufsize > 200)
621f53083d60 * macros.c (Fstart_kbd_macro): Use xmalloc.
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
82 {
621f53083d60 * macros.c (Fstart_kbd_macro): Use xmalloc.
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
83 current_kboard->kbd_macro_bufsize = 30;
621f53083d60 * macros.c (Fstart_kbd_macro): Use xmalloc.
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
84 current_kboard->kbd_macro_buffer
15223
be1bc5b3f14e (Fstart_kbd_macro): Add missing xrealloc arg.
Karl Heuer <kwzh@gnu.org>
parents: 14301
diff changeset
85 = (Lisp_Object *)xrealloc (current_kboard->kbd_macro_buffer,
be1bc5b3f14e (Fstart_kbd_macro): Add missing xrealloc arg.
Karl Heuer <kwzh@gnu.org>
parents: 14301
diff changeset
86 30 * sizeof (Lisp_Object));
14301
621f53083d60 * macros.c (Fstart_kbd_macro): Use xmalloc.
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
87 }
11009
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
88 current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_buffer;
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
89 current_kboard->kbd_macro_end = current_kboard->kbd_macro_buffer;
14301
621f53083d60 * macros.c (Fstart_kbd_macro): Use xmalloc.
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
90 message ("Defining kbd macro...");
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 }
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 else
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 {
26825
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
94 int i, len;
49745
282c490f6cd4 (Fstart_kbd_macro): If appending, and last keyboard
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
95 int cvt;
26825
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
96
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
97 /* Check the type of last-kbd-macro in case Lisp code changed it. */
71839
c31d8ae32af3 (Fstart_kbd_macro): Use CHECK_VECTOR_OR_STRING.
Kim F. Storm <storm@cua.dk>
parents: 68651
diff changeset
98 CHECK_VECTOR_OR_STRING (current_kboard->Vlast_kbd_macro);
26825
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
99
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
100 len = XINT (Flength (current_kboard->Vlast_kbd_macro));
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
101
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
102 /* Copy last-kbd-macro into the buffer, in case the Lisp code
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
103 has put another macro there. */
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
104 if (current_kboard->kbd_macro_bufsize < len + 30)
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
105 {
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
106 current_kboard->kbd_macro_bufsize = len + 30;
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
107 current_kboard->kbd_macro_buffer
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
108 = (Lisp_Object *)xrealloc (current_kboard->kbd_macro_buffer,
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
109 (len + 30) * sizeof (Lisp_Object));
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
110 }
49745
282c490f6cd4 (Fstart_kbd_macro): If appending, and last keyboard
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
111
282c490f6cd4 (Fstart_kbd_macro): If appending, and last keyboard
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
112 /* Must convert meta modifier when copying string to vector. */
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
113 cvt = STRINGP (current_kboard->Vlast_kbd_macro);
26825
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
114 for (i = 0; i < len; i++)
49745
282c490f6cd4 (Fstart_kbd_macro): If appending, and last keyboard
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
115 {
282c490f6cd4 (Fstart_kbd_macro): If appending, and last keyboard
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
116 Lisp_Object c;
282c490f6cd4 (Fstart_kbd_macro): If appending, and last keyboard
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
117 c = Faref (current_kboard->Vlast_kbd_macro, make_number (i));
49913
eabc4e7986e9 (Fstart_kbd_macro): Remove redundant assignment.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 49745
diff changeset
118 if (cvt && NATNUMP (c) && (XFASTINT (c) & 0x80))
eabc4e7986e9 (Fstart_kbd_macro): Remove redundant assignment.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 49745
diff changeset
119 XSETFASTINT (c, CHAR_META | (XFASTINT (c) & ~0x80));
49745
282c490f6cd4 (Fstart_kbd_macro): If appending, and last keyboard
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
120 current_kboard->kbd_macro_buffer[i] = c;
282c490f6cd4 (Fstart_kbd_macro): If appending, and last keyboard
Kim F. Storm <storm@cua.dk>
parents: 49600
diff changeset
121 }
26825
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
122
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
123 current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_buffer + len;
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
124 current_kboard->kbd_macro_end = current_kboard->kbd_macro_ptr;
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
125
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
126 /* Re-execute the macro we are appending to,
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
127 for consistency of behavior. */
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
128 if (NILP (no_exec))
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
129 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro,
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
130 make_number (1), Qnil);
26825
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
131
66dfce1feb9c (Fstart_kbd_macro): Handle case where last-kbd-macro
Richard M. Stallman <rms@gnu.org>
parents: 24530
diff changeset
132 message ("Appending to kbd macro...");
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 }
11009
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
134 current_kboard->defining_kbd_macro = Qt;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47348
diff changeset
135
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 return Qnil;
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137 }
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138
47348
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
139 /* Finish defining the current keyboard macro. */
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
140
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
141 void
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
142 end_kbd_macro ()
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
143 {
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
144 current_kboard->defining_kbd_macro = Qnil;
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
145 update_mode_lines++;
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
146 current_kboard->Vlast_kbd_macro
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
147 = make_event_array ((current_kboard->kbd_macro_end
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
148 - current_kboard->kbd_macro_buffer),
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
149 current_kboard->kbd_macro_buffer);
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
150 }
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
151
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
152 DEFUN ("end-kbd-macro", Fend_kbd_macro, Send_kbd_macro, 0, 2, "p",
41940
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
153 doc: /* Finish defining a keyboard macro.
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
154 The definition was started by \\[start-kbd-macro].
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
155 The macro is now available for use via \\[call-last-kbd-macro],
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
156 or it can be given a name with \\[name-last-kbd-macro] and then invoked
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
157 under that name.
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
158
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
159 With numeric arg, repeat macro now that many times,
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
160 counting the definition just completed as the first repetition.
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
161 An argument of zero means repeat until error.
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
162
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47348
diff changeset
163 In Lisp, optional second arg LOOPFUNC may be a function that is called prior to
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
164 each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
165 (repeat, loopfunc)
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
166 Lisp_Object repeat, loopfunc;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
167 {
11009
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
168 if (NILP (current_kboard->defining_kbd_macro))
22915
ef9dd93e3077 (Fexecute_kbd_macro): Fix error message.
Richard M. Stallman <rms@gnu.org>
parents: 20299
diff changeset
169 error ("Not defining kbd macro");
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170
14081
addc50fc3981 (Fend_kbd_macro, Fexecute_kbd_macro): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13773
diff changeset
171 if (NILP (repeat))
addc50fc3981 (Fend_kbd_macro, Fexecute_kbd_macro): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13773
diff changeset
172 XSETFASTINT (repeat, 1);
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
173 else
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40635
diff changeset
174 CHECK_NUMBER (repeat);
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175
11009
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
176 if (!NILP (current_kboard->defining_kbd_macro))
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
177 {
47348
7e9809c820b0 (end_kbd_macro): New function.
Kim F. Storm <storm@cua.dk>
parents: 47307
diff changeset
178 end_kbd_macro ();
14301
621f53083d60 * macros.c (Fstart_kbd_macro): Use xmalloc.
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
179 message ("Keyboard macro defined");
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
180 }
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181
14081
addc50fc3981 (Fend_kbd_macro, Fexecute_kbd_macro): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13773
diff changeset
182 if (XFASTINT (repeat) == 0)
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
183 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, repeat, loopfunc);
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
184 else
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
185 {
14081
addc50fc3981 (Fend_kbd_macro, Fexecute_kbd_macro): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13773
diff changeset
186 XSETINT (repeat, XINT (repeat)-1);
addc50fc3981 (Fend_kbd_macro, Fexecute_kbd_macro): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13773
diff changeset
187 if (XINT (repeat) > 0)
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
188 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, repeat, loopfunc);
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 }
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
190 return Qnil;
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
191 }
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
192
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
193 /* Store character c into kbd macro being defined */
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
194
20299
608c1a9aefc8 (store_kbd_macro_char): Define as returning nothing.
Andreas Schwab <schwab@suse.de>
parents: 16562
diff changeset
195 void
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
196 store_kbd_macro_char (c)
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
197 Lisp_Object c;
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
198 {
39135
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
199 struct kboard *kb = current_kboard;
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
200
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
201 if (!NILP (kb->defining_kbd_macro))
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202 {
39135
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
203 if (kb->kbd_macro_ptr - kb->kbd_macro_buffer == kb->kbd_macro_bufsize)
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
204 {
39135
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
205 int ptr_offset, end_offset, nbytes;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47348
diff changeset
206
39135
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
207 ptr_offset = kb->kbd_macro_ptr - kb->kbd_macro_buffer;
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
208 end_offset = kb->kbd_macro_end - kb->kbd_macro_buffer;
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
209 kb->kbd_macro_bufsize *= 2;
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
210 nbytes = kb->kbd_macro_bufsize * sizeof *kb->kbd_macro_buffer;
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
211 kb->kbd_macro_buffer
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
212 = (Lisp_Object *) xrealloc (kb->kbd_macro_buffer, nbytes);
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
213 kb->kbd_macro_ptr = kb->kbd_macro_buffer + ptr_offset;
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
214 kb->kbd_macro_end = kb->kbd_macro_buffer + end_offset;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
215 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47348
diff changeset
216
39135
73d05c66ef70 (store_kbd_macro_char): Fix computation of kbd_macro_end.
Gerd Moellmann <gerd@gnu.org>
parents: 37926
diff changeset
217 *kb->kbd_macro_ptr++ = c;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
218 }
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
219 }
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
220
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
221 /* Declare that all chars stored so far in the kbd macro being defined
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
222 really belong to it. This is done in between editor commands. */
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
223
20299
608c1a9aefc8 (store_kbd_macro_char): Define as returning nothing.
Andreas Schwab <schwab@suse.de>
parents: 16562
diff changeset
224 void
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
225 finalize_kbd_macro_chars ()
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
226 {
11009
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
227 current_kboard->kbd_macro_end = current_kboard->kbd_macro_ptr;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
228 }
12845
9ee2045cda62 (Fcancel_kbd_macro_events): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12119
diff changeset
229
9ee2045cda62 (Fcancel_kbd_macro_events): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12119
diff changeset
230 DEFUN ("cancel-kbd-macro-events", Fcancel_kbd_macro_events,
9ee2045cda62 (Fcancel_kbd_macro_events): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12119
diff changeset
231 Scancel_kbd_macro_events, 0, 0, 0,
41940
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
232 doc: /* Cancel the events added to a keyboard macro for this command. */)
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
233 ()
12845
9ee2045cda62 (Fcancel_kbd_macro_events): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12119
diff changeset
234 {
9ee2045cda62 (Fcancel_kbd_macro_events): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12119
diff changeset
235 current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_end;
31829
43566b0aec59 Avoid some more compiler warnings.
Gerd Moellmann <gerd@gnu.org>
parents: 26825
diff changeset
236 return Qnil;
12845
9ee2045cda62 (Fcancel_kbd_macro_events): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12119
diff changeset
237 }
13773
7d50ac085b12 (Fstore_kbd_macro_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12845
diff changeset
238
7d50ac085b12 (Fstore_kbd_macro_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12845
diff changeset
239 DEFUN ("store-kbd-macro-event", Fstore_kbd_macro_event,
7d50ac085b12 (Fstore_kbd_macro_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12845
diff changeset
240 Sstore_kbd_macro_event, 1, 1, 0,
41940
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
241 doc: /* Store EVENT into the keyboard macro being defined. */)
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
242 (event)
13773
7d50ac085b12 (Fstore_kbd_macro_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12845
diff changeset
243 Lisp_Object event;
7d50ac085b12 (Fstore_kbd_macro_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12845
diff changeset
244 {
7d50ac085b12 (Fstore_kbd_macro_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12845
diff changeset
245 store_kbd_macro_char (event);
7d50ac085b12 (Fstore_kbd_macro_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12845
diff changeset
246 return Qnil;
7d50ac085b12 (Fstore_kbd_macro_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12845
diff changeset
247 }
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
248
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
249 DEFUN ("call-last-kbd-macro", Fcall_last_kbd_macro, Scall_last_kbd_macro,
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
250 0, 2, "p",
41940
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
251 doc: /* Call the last keyboard macro that you defined with \\[start-kbd-macro].
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
252
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
253 A prefix argument serves as a repeat count. Zero means repeat until error.
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
254
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
255 To make a macro permanent so you can call it even after
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47348
diff changeset
256 defining others, use \\[name-last-kbd-macro].
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
257
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47348
diff changeset
258 In Lisp, optional second arg LOOPFUNC may be a function that is called prior to
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
259 each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
260 (prefix, loopfunc)
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
261 Lisp_Object prefix, loopfunc;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
262 {
16562
4999fc12564e (Fcall_last_kbd_macro): Set this_command from last_command
Richard M. Stallman <rms@gnu.org>
parents: 15976
diff changeset
263 /* Don't interfere with recognition of the previous command
4999fc12564e (Fcall_last_kbd_macro): Set this_command from last_command
Richard M. Stallman <rms@gnu.org>
parents: 15976
diff changeset
264 from before this macro started. */
22968
edcf24874ef5 (Fcall_last_kbd_macro): this_command renamed to Vthis_command.
Richard M. Stallman <rms@gnu.org>
parents: 22915
diff changeset
265 Vthis_command = current_kboard->Vlast_command;
24530
14cc75ebfd7b (Fexecute_kbd_macro): Save real_this_command.
Karl Heuer <kwzh@gnu.org>
parents: 24482
diff changeset
266 /* C-x z after the macro should repeat the macro. */
14cc75ebfd7b (Fexecute_kbd_macro): Save real_this_command.
Karl Heuer <kwzh@gnu.org>
parents: 24482
diff changeset
267 real_this_command = current_kboard->Vlast_kbd_macro;
16562
4999fc12564e (Fcall_last_kbd_macro): Set this_command from last_command
Richard M. Stallman <rms@gnu.org>
parents: 15976
diff changeset
268
11009
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
269 if (! NILP (current_kboard->defining_kbd_macro))
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
270 error ("Can't execute anonymous macro while defining one");
11009
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
271 else if (NILP (current_kboard->Vlast_kbd_macro))
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
272 error ("No kbd macro has been defined");
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
273 else
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
274 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, prefix, loopfunc);
16562
4999fc12564e (Fcall_last_kbd_macro): Set this_command from last_command
Richard M. Stallman <rms@gnu.org>
parents: 15976
diff changeset
275
4999fc12564e (Fcall_last_kbd_macro): Set this_command from last_command
Richard M. Stallman <rms@gnu.org>
parents: 15976
diff changeset
276 /* command_loop_1 sets this to nil before it returns;
4999fc12564e (Fcall_last_kbd_macro): Set this_command from last_command
Richard M. Stallman <rms@gnu.org>
parents: 15976
diff changeset
277 get back the last command within the macro
4999fc12564e (Fcall_last_kbd_macro): Set this_command from last_command
Richard M. Stallman <rms@gnu.org>
parents: 15976
diff changeset
278 so that it can be last, again, after we return. */
22968
edcf24874ef5 (Fcall_last_kbd_macro): this_command renamed to Vthis_command.
Richard M. Stallman <rms@gnu.org>
parents: 22915
diff changeset
279 Vthis_command = current_kboard->Vlast_command;
16562
4999fc12564e (Fcall_last_kbd_macro): Set this_command from last_command
Richard M. Stallman <rms@gnu.org>
parents: 15976
diff changeset
280
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
281 return Qnil;
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
282 }
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
283
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
284 /* Restore Vexecuting_kbd_macro and executing_kbd_macro_index.
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
285 Called when the unwind-protect in Fexecute_kbd_macro gets invoked. */
15968
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
286
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
287 static Lisp_Object
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
288 pop_kbd_macro (info)
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
289 Lisp_Object info;
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
290 {
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
291 Lisp_Object tem;
61983
f58aeabf21e7 (Vexecuting_kbd_macro): Renamed from Vexecuting_macro. All uses changed.
Richard M. Stallman <rms@gnu.org>
parents: 57962
diff changeset
292 Vexecuting_kbd_macro = XCAR (info);
24530
14cc75ebfd7b (Fexecute_kbd_macro): Save real_this_command.
Karl Heuer <kwzh@gnu.org>
parents: 24482
diff changeset
293 tem = XCDR (info);
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
294 executing_kbd_macro_index = XINT (XCAR (tem));
24530
14cc75ebfd7b (Fexecute_kbd_macro): Save real_this_command.
Karl Heuer <kwzh@gnu.org>
parents: 24482
diff changeset
295 real_this_command = XCDR (tem);
35119
97a19f647a12 (Qkbd_macro_termination_hook): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 34361
diff changeset
296 Frun_hooks (1, &Qkbd_macro_termination_hook);
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
297 return Qnil;
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
298 }
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
299
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
300 DEFUN ("execute-kbd-macro", Fexecute_kbd_macro, Sexecute_kbd_macro, 1, 3, 0,
41940
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
301 doc: /* Execute MACRO as string of editor command characters.
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
302 If MACRO is a symbol, its function definition is used.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47348
diff changeset
303 COUNT is a repeat count, or nil for once, or 0 for infinite loop.
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
304
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47348
diff changeset
305 Optional third arg LOOPFUNC may be a function that is called prior to
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
306 each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
307 (macro, count, loopfunc)
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
308 Lisp_Object macro, count, loopfunc;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
309 {
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
310 Lisp_Object final;
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
311 Lisp_Object tem;
46295
b77ef572e1c9 Use macro SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents: 41940
diff changeset
312 int pdlcount = SPECPDL_INDEX ();
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
313 int repeat = 1;
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
314 struct gcpro gcpro1, gcpro2;
15968
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
315 int success_count = 0;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
316
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
317 executing_kbd_macro_iterations = 0;
24482
9b722e922325 (Fexecute_kbd_macro): Initialize executing_macro_iterations at beginning.
Karl Heuer <kwzh@gnu.org>
parents: 23434
diff changeset
318
14100
0950fefc4bd1 (Fexecute_kbd_macro): Reindent properly.
Erik Naggum <erik@naggum.no>
parents: 14094
diff changeset
319 if (!NILP (count))
0950fefc4bd1 (Fexecute_kbd_macro): Reindent properly.
Erik Naggum <erik@naggum.no>
parents: 14094
diff changeset
320 {
0950fefc4bd1 (Fexecute_kbd_macro): Reindent properly.
Erik Naggum <erik@naggum.no>
parents: 14094
diff changeset
321 count = Fprefix_numeric_value (count);
0950fefc4bd1 (Fexecute_kbd_macro): Reindent properly.
Erik Naggum <erik@naggum.no>
parents: 14094
diff changeset
322 repeat = XINT (count);
0950fefc4bd1 (Fexecute_kbd_macro): Reindent properly.
Erik Naggum <erik@naggum.no>
parents: 14094
diff changeset
323 }
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
324
647
529171c8b71c entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
325 final = indirect_function (macro);
9122
9ba3f17d6631 (Fexecute_kbd_macro): Use type test macros.
Karl Heuer <kwzh@gnu.org>
parents: 4696
diff changeset
326 if (!STRINGP (final) && !VECTORP (final))
22915
ef9dd93e3077 (Fexecute_kbd_macro): Fix error message.
Richard M. Stallman <rms@gnu.org>
parents: 20299
diff changeset
327 error ("Keyboard macros must be strings or vectors");
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
328
61983
f58aeabf21e7 (Vexecuting_kbd_macro): Renamed from Vexecuting_macro. All uses changed.
Richard M. Stallman <rms@gnu.org>
parents: 57962
diff changeset
329 tem = Fcons (Vexecuting_kbd_macro,
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
330 Fcons (make_number (executing_kbd_macro_index),
24530
14cc75ebfd7b (Fexecute_kbd_macro): Save real_this_command.
Karl Heuer <kwzh@gnu.org>
parents: 24482
diff changeset
331 real_this_command));
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
332 record_unwind_protect (pop_kbd_macro, tem);
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
333
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
334 GCPRO2 (final, loopfunc);
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
335 do
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
336 {
61983
f58aeabf21e7 (Vexecuting_kbd_macro): Renamed from Vexecuting_macro. All uses changed.
Richard M. Stallman <rms@gnu.org>
parents: 57962
diff changeset
337 Vexecuting_kbd_macro = final;
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
338 executing_kbd_macro = final;
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
339 executing_kbd_macro_index = 0;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
340
12119
d7b51659a56d (Fexecute_kbd_macro): Vprefix_arg is now part of kboard.
Karl Heuer <kwzh@gnu.org>
parents: 11341
diff changeset
341 current_kboard->Vprefix_arg = Qnil;
46887
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
342
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
343 if (!NILP (loopfunc))
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
344 {
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
345 Lisp_Object cont;
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
346 cont = call0 (loopfunc);
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
347 if (NILP (cont))
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
348 break;
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
349 }
d9b11a5b4ebf (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
Kim F. Storm <storm@cua.dk>
parents: 46295
diff changeset
350
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
351 command_loop_1 ();
1682
af0995b9b142 * macros.c (Fend_kbd_macro): Don't use XFASTINT to check if arg is
Jim Blandy <jimb@redhat.com>
parents: 647
diff changeset
352
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
353 executing_kbd_macro_iterations = ++success_count;
15968
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
354
1682
af0995b9b142 * macros.c (Fend_kbd_macro): Don't use XFASTINT to check if arg is
Jim Blandy <jimb@redhat.com>
parents: 647
diff changeset
355 QUIT;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
356 }
9122
9ba3f17d6631 (Fexecute_kbd_macro): Use type test macros.
Karl Heuer <kwzh@gnu.org>
parents: 4696
diff changeset
357 while (--repeat
61983
f58aeabf21e7 (Vexecuting_kbd_macro): Renamed from Vexecuting_macro. All uses changed.
Richard M. Stallman <rms@gnu.org>
parents: 57962
diff changeset
358 && (STRINGP (Vexecuting_kbd_macro) || VECTORP (Vexecuting_kbd_macro)));
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
359
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
360 executing_kbd_macro = Qnil;
15968
231e14e38946 (executing_macro_iterations, executing_macro): New vars.
Richard M. Stallman <rms@gnu.org>
parents: 15223
diff changeset
361
61983
f58aeabf21e7 (Vexecuting_kbd_macro): Renamed from Vexecuting_macro. All uses changed.
Richard M. Stallman <rms@gnu.org>
parents: 57962
diff changeset
362 real_this_command = Vexecuting_kbd_macro;
23434
1dd05eb0443d (Fexecute_kbd_macro): Set real_this_command.
Richard M. Stallman <rms@gnu.org>
parents: 22968
diff changeset
363
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
364 UNGCPRO;
14094
e5e4fe8e968f (Fexecute_kbd_macro): Local var `pdlcount' renamed from
Karl Heuer <kwzh@gnu.org>
parents: 14081
diff changeset
365 return unbind_to (pdlcount, Qnil);
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
366 }
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
367
20299
608c1a9aefc8 (store_kbd_macro_char): Define as returning nothing.
Andreas Schwab <schwab@suse.de>
parents: 16562
diff changeset
368 void
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
369 init_macros ()
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
370 {
61983
f58aeabf21e7 (Vexecuting_kbd_macro): Renamed from Vexecuting_macro. All uses changed.
Richard M. Stallman <rms@gnu.org>
parents: 57962
diff changeset
371 Vexecuting_kbd_macro = Qnil;
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
372 executing_kbd_macro = Qnil;
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
373 }
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
374
20299
608c1a9aefc8 (store_kbd_macro_char): Define as returning nothing.
Andreas Schwab <schwab@suse.de>
parents: 16562
diff changeset
375 void
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
376 syms_of_macros ()
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
377 {
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
378 Qexecute_kbd_macro = intern ("execute-kbd-macro");
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
379 staticpro (&Qexecute_kbd_macro);
35119
97a19f647a12 (Qkbd_macro_termination_hook): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 34361
diff changeset
380 Qkbd_macro_termination_hook = intern ("kbd-macro-termination-hook");
97a19f647a12 (Qkbd_macro_termination_hook): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 34361
diff changeset
381 staticpro (&Qkbd_macro_termination_hook);
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
382
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
383 defsubr (&Sstart_kbd_macro);
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
384 defsubr (&Send_kbd_macro);
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
385 defsubr (&Scall_last_kbd_macro);
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
386 defsubr (&Sexecute_kbd_macro);
12845
9ee2045cda62 (Fcancel_kbd_macro_events): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12119
diff changeset
387 defsubr (&Scancel_kbd_macro_events);
13773
7d50ac085b12 (Fstore_kbd_macro_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12845
diff changeset
388 defsubr (&Sstore_kbd_macro_event);
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
389
11009
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
390 DEFVAR_KBOARD ("defining-kbd-macro", defining_kbd_macro,
57962
47f8ff58e33e (syms_of_macros) <defining-kbd-macro>: Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
391 doc: /* Non-nil while a keyboard macro is being defined. Don't set this!
47f8ff58e33e (syms_of_macros) <defining-kbd-macro>: Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
392 The value is the symbol `append' while appending to the definition of
47f8ff58e33e (syms_of_macros) <defining-kbd-macro>: Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
393 an existing macro. */);
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
394
61983
f58aeabf21e7 (Vexecuting_kbd_macro): Renamed from Vexecuting_macro. All uses changed.
Richard M. Stallman <rms@gnu.org>
parents: 57962
diff changeset
395 DEFVAR_LISP ("executing-kbd-macro", &Vexecuting_kbd_macro,
f58aeabf21e7 (Vexecuting_kbd_macro): Renamed from Vexecuting_macro. All uses changed.
Richard M. Stallman <rms@gnu.org>
parents: 57962
diff changeset
396 doc: /* Currently executing keyboard macro (string or vector).
f58aeabf21e7 (Vexecuting_kbd_macro): Renamed from Vexecuting_macro. All uses changed.
Richard M. Stallman <rms@gnu.org>
parents: 57962
diff changeset
397 This is nil when not executing a keyboard macro. */);
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
398
62024
4f7e1a56469e (executing_kbd_macro_index): Rename from executing_macro_index.
Kim F. Storm <storm@cua.dk>
parents: 61983
diff changeset
399 DEFVAR_INT ("executing-kbd-macro-index", &executing_kbd_macro_index,
47307
06c376f5df86 (executing_macro_index): Change type to EMACS_INT.
Kim F. Storm <storm@cua.dk>
parents: 46887
diff changeset
400 doc: /* Index in currently executing keyboard macro; undefined if none executing. */);
06c376f5df86 (executing_macro_index): Change type to EMACS_INT.
Kim F. Storm <storm@cua.dk>
parents: 46887
diff changeset
401
11009
399469e5eb5b Rename perdisplay to kboard.
Karl Heuer <kwzh@gnu.org>
parents: 10992
diff changeset
402 DEFVAR_KBOARD ("last-kbd-macro", Vlast_kbd_macro,
41940
63819c5d6049 Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 40656
diff changeset
403 doc: /* Last kbd macro defined, as a string or vector; nil if none defined. */);
246
81e375c3eb58 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
404 }
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49913
diff changeset
405
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49913
diff changeset
406 /* arch-tag: d293fcc9-2266-4163-9198-7fa0de12ec9e
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49913
diff changeset
407 (do not change this comment) */