Mercurial > emacs
comparison src/macros.c @ 14081:addc50fc3981
(Fend_kbd_macro, Fexecute_kbd_macro): Harmonize arguments with
documentation.
author | Erik Naggum <erik@naggum.no> |
---|---|
date | Tue, 09 Jan 1996 00:33:09 +0000 |
parents | 7d50ac085b12 |
children | e5e4fe8e968f |
comparison
equal
deleted
inserted
replaced
14080:439185f0ef37 | 14081:addc50fc3981 |
---|---|
79 under that name.\n\ | 79 under that name.\n\ |
80 \n\ | 80 \n\ |
81 With numeric arg, repeat macro now that many times,\n\ | 81 With numeric arg, repeat macro now that many times,\n\ |
82 counting the definition just completed as the first repetition.\n\ | 82 counting the definition just completed as the first repetition.\n\ |
83 An argument of zero means repeat until error.") | 83 An argument of zero means repeat until error.") |
84 (arg) | 84 (repeat) |
85 Lisp_Object arg; | 85 Lisp_Object repeat; |
86 { | 86 { |
87 if (NILP (current_kboard->defining_kbd_macro)) | 87 if (NILP (current_kboard->defining_kbd_macro)) |
88 error ("Not defining kbd macro."); | 88 error ("Not defining kbd macro."); |
89 | 89 |
90 if (NILP (arg)) | 90 if (NILP (repeat)) |
91 XSETFASTINT (arg, 1); | 91 XSETFASTINT (repeat, 1); |
92 else | 92 else |
93 CHECK_NUMBER (arg, 0); | 93 CHECK_NUMBER (repeat, 0); |
94 | 94 |
95 if (!NILP (current_kboard->defining_kbd_macro)) | 95 if (!NILP (current_kboard->defining_kbd_macro)) |
96 { | 96 { |
97 current_kboard->defining_kbd_macro = Qnil; | 97 current_kboard->defining_kbd_macro = Qnil; |
98 update_mode_lines++; | 98 update_mode_lines++; |
101 - current_kboard->kbd_macro_buffer), | 101 - current_kboard->kbd_macro_buffer), |
102 current_kboard->kbd_macro_buffer); | 102 current_kboard->kbd_macro_buffer); |
103 message("Keyboard macro defined"); | 103 message("Keyboard macro defined"); |
104 } | 104 } |
105 | 105 |
106 if (XFASTINT (arg) == 0) | 106 if (XFASTINT (repeat) == 0) |
107 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, arg); | 107 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, repeat); |
108 else | 108 else |
109 { | 109 { |
110 XSETINT (arg, XINT (arg)-1); | 110 XSETINT (repeat, XINT (repeat)-1); |
111 if (XINT (arg) > 0) | 111 if (XINT (repeat) > 0) |
112 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, arg); | 112 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, repeat); |
113 } | 113 } |
114 return Qnil; | 114 return Qnil; |
115 } | 115 } |
116 | 116 |
117 /* Store character c into kbd macro being defined */ | 117 /* Store character c into kbd macro being defined */ |
201 | 201 |
202 DEFUN ("execute-kbd-macro", Fexecute_kbd_macro, Sexecute_kbd_macro, 1, 2, 0, | 202 DEFUN ("execute-kbd-macro", Fexecute_kbd_macro, Sexecute_kbd_macro, 1, 2, 0, |
203 "Execute MACRO as string of editor command characters.\n\ | 203 "Execute MACRO as string of editor command characters.\n\ |
204 If MACRO is a symbol, its function definition is used.\n\ | 204 If MACRO is a symbol, its function definition is used.\n\ |
205 COUNT is a repeat count, or nil for once, or 0 for infinite loop.") | 205 COUNT is a repeat count, or nil for once, or 0 for infinite loop.") |
206 (macro, prefixarg) | 206 (macro, count) |
207 Lisp_Object macro, prefixarg; | 207 Lisp_Object macro, count; |
208 { | 208 { |
209 Lisp_Object final; | 209 Lisp_Object final; |
210 Lisp_Object tem; | 210 Lisp_Object tem; |
211 int count = specpdl_ptr - specpdl; | 211 int count = specpdl_ptr - specpdl; |
212 int repeat = 1; | 212 int repeat = 1; |
213 struct gcpro gcpro1; | 213 struct gcpro gcpro1; |
214 | 214 |
215 if (!NILP (prefixarg)) | 215 if (!NILP (count)) |
216 prefixarg = Fprefix_numeric_value (prefixarg), | 216 count = Fprefix_numeric_value (count), |
217 repeat = XINT (prefixarg); | 217 repeat = XINT (count); |
218 | 218 |
219 final = indirect_function (macro); | 219 final = indirect_function (macro); |
220 if (!STRINGP (final) && !VECTORP (final)) | 220 if (!STRINGP (final) && !VECTORP (final)) |
221 error ("Keyboard macros must be strings or vectors."); | 221 error ("Keyboard macros must be strings or vectors."); |
222 | 222 |