diff options
| author | Tom Tromey | 2011-02-16 09:35:16 -0700 |
|---|---|---|
| committer | Tom Tromey | 2011-02-16 09:35:16 -0700 |
| commit | 1344aad491d0951920efef6cae1c6934f92cd59b (patch) | |
| tree | d251eb2e3842b09f1d269e0586668aa0e509f211 /src/macros.c | |
| parent | eb4916d71a6a4293b1dd51deb19cf267bb62b7ae (diff) | |
| download | emacs-1344aad491d0951920efef6cae1c6934f92cd59b.tar.gz emacs-1344aad491d0951920efef6cae1c6934f92cd59b.zip | |
Hide implementation of `struct kboard'
* callint.c (Fcall_interactively): Update.
* doc.c (Fsubstitute_command_keys): Update.
* cmds.c (Fself_insert_command): Update.
* keymap.c (Fcurrent_active_maps, Fkey_binding)
(Fdescribe_buffer_bindings): Update.
* macros.c (Fstart_kbd_macro, end_kbd_macro, Fend_kbd_macro)
(store_kbd_macro_char, Fcall_last_kbd_macro, Fexecute_kbd_macro):
Update.
* keyboard.c (echo_char, echo_dash, echo_now, cancel_echoing)
(echo_length, echo_truncate, cmd_error, command_loop_1)
(read_char, kbd_buffer_store_event_hold, make_lispy_event)
(menu_bar_items, tool_bar_items, read_char_minibuf_menu_prompt)
(read_key_sequence, Fcommand_execute, Fexecute_extended_command)
(Fdiscard_input, init_kboard, init_keyboard, mark_kboards):
Update.
* xfns.c (Fx_create_frame): Update.
* xterm.c (x_connection_closed, x_term_init): Update.
* term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN, init_tty):
Update.
* window.c (window_scroll_pixel_based, window_scroll_line_based):
Update.
* frame.c (make_frame_without_minibuffer, Fhandle_switch_frame)
(delete_frame): Update.
* lisp.h (DEFVAR_KBOARD): Update for change to field names.
* keyboard.h (struct kboard): Rename all Lisp_Object fields.
(KBOARD_INTERNAL_FIELD, KVAR): New macros.
Diffstat (limited to 'src/macros.c')
| -rw-r--r-- | src/macros.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/macros.c b/src/macros.c index 34ac08c3284..d90b31b503f 100644 --- a/src/macros.c +++ b/src/macros.c | |||
| @@ -56,7 +56,7 @@ If optional second arg, NO-EXEC, is non-nil, do not re-execute last | |||
| 56 | macro before appending to it. */) | 56 | macro before appending to it. */) |
| 57 | (Lisp_Object append, Lisp_Object no_exec) | 57 | (Lisp_Object append, Lisp_Object no_exec) |
| 58 | { | 58 | { |
| 59 | if (!NILP (current_kboard->defining_kbd_macro)) | 59 | if (!NILP (KVAR (current_kboard, defining_kbd_macro))) |
| 60 | error ("Already defining kbd macro"); | 60 | error ("Already defining kbd macro"); |
| 61 | 61 | ||
| 62 | if (!current_kboard->kbd_macro_buffer) | 62 | if (!current_kboard->kbd_macro_buffer) |
| @@ -85,9 +85,9 @@ macro before appending to it. */) | |||
| 85 | int cvt; | 85 | int cvt; |
| 86 | 86 | ||
| 87 | /* Check the type of last-kbd-macro in case Lisp code changed it. */ | 87 | /* Check the type of last-kbd-macro in case Lisp code changed it. */ |
| 88 | CHECK_VECTOR_OR_STRING (current_kboard->Vlast_kbd_macro); | 88 | CHECK_VECTOR_OR_STRING (KVAR (current_kboard, Vlast_kbd_macro)); |
| 89 | 89 | ||
| 90 | len = XINT (Flength (current_kboard->Vlast_kbd_macro)); | 90 | len = XINT (Flength (KVAR (current_kboard, Vlast_kbd_macro))); |
| 91 | 91 | ||
| 92 | /* Copy last-kbd-macro into the buffer, in case the Lisp code | 92 | /* Copy last-kbd-macro into the buffer, in case the Lisp code |
| 93 | has put another macro there. */ | 93 | has put another macro there. */ |
| @@ -100,11 +100,11 @@ macro before appending to it. */) | |||
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | /* Must convert meta modifier when copying string to vector. */ | 102 | /* Must convert meta modifier when copying string to vector. */ |
| 103 | cvt = STRINGP (current_kboard->Vlast_kbd_macro); | 103 | cvt = STRINGP (KVAR (current_kboard, Vlast_kbd_macro)); |
| 104 | for (i = 0; i < len; i++) | 104 | for (i = 0; i < len; i++) |
| 105 | { | 105 | { |
| 106 | Lisp_Object c; | 106 | Lisp_Object c; |
| 107 | c = Faref (current_kboard->Vlast_kbd_macro, make_number (i)); | 107 | c = Faref (KVAR (current_kboard, Vlast_kbd_macro), make_number (i)); |
| 108 | if (cvt && NATNUMP (c) && (XFASTINT (c) & 0x80)) | 108 | if (cvt && NATNUMP (c) && (XFASTINT (c) & 0x80)) |
| 109 | XSETFASTINT (c, CHAR_META | (XFASTINT (c) & ~0x80)); | 109 | XSETFASTINT (c, CHAR_META | (XFASTINT (c) & ~0x80)); |
| 110 | current_kboard->kbd_macro_buffer[i] = c; | 110 | current_kboard->kbd_macro_buffer[i] = c; |
| @@ -116,12 +116,12 @@ macro before appending to it. */) | |||
| 116 | /* Re-execute the macro we are appending to, | 116 | /* Re-execute the macro we are appending to, |
| 117 | for consistency of behavior. */ | 117 | for consistency of behavior. */ |
| 118 | if (NILP (no_exec)) | 118 | if (NILP (no_exec)) |
| 119 | Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, | 119 | Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), |
| 120 | make_number (1), Qnil); | 120 | make_number (1), Qnil); |
| 121 | 121 | ||
| 122 | message ("Appending to kbd macro..."); | 122 | message ("Appending to kbd macro..."); |
| 123 | } | 123 | } |
| 124 | current_kboard->defining_kbd_macro = Qt; | 124 | KVAR (current_kboard, defining_kbd_macro) = Qt; |
| 125 | 125 | ||
| 126 | return Qnil; | 126 | return Qnil; |
| 127 | } | 127 | } |
| @@ -131,9 +131,9 @@ macro before appending to it. */) | |||
| 131 | void | 131 | void |
| 132 | end_kbd_macro (void) | 132 | end_kbd_macro (void) |
| 133 | { | 133 | { |
| 134 | current_kboard->defining_kbd_macro = Qnil; | 134 | KVAR (current_kboard, defining_kbd_macro) = Qnil; |
| 135 | update_mode_lines++; | 135 | update_mode_lines++; |
| 136 | current_kboard->Vlast_kbd_macro | 136 | KVAR (current_kboard, Vlast_kbd_macro) |
| 137 | = make_event_array ((current_kboard->kbd_macro_end | 137 | = make_event_array ((current_kboard->kbd_macro_end |
| 138 | - current_kboard->kbd_macro_buffer), | 138 | - current_kboard->kbd_macro_buffer), |
| 139 | current_kboard->kbd_macro_buffer); | 139 | current_kboard->kbd_macro_buffer); |
| @@ -154,7 +154,7 @@ In Lisp, optional second arg LOOPFUNC may be a function that is called prior to | |||
| 154 | each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) | 154 | each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) |
| 155 | (Lisp_Object repeat, Lisp_Object loopfunc) | 155 | (Lisp_Object repeat, Lisp_Object loopfunc) |
| 156 | { | 156 | { |
| 157 | if (NILP (current_kboard->defining_kbd_macro)) | 157 | if (NILP (KVAR (current_kboard, defining_kbd_macro))) |
| 158 | error ("Not defining kbd macro"); | 158 | error ("Not defining kbd macro"); |
| 159 | 159 | ||
| 160 | if (NILP (repeat)) | 160 | if (NILP (repeat)) |
| @@ -162,19 +162,19 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) | |||
| 162 | else | 162 | else |
| 163 | CHECK_NUMBER (repeat); | 163 | CHECK_NUMBER (repeat); |
| 164 | 164 | ||
| 165 | if (!NILP (current_kboard->defining_kbd_macro)) | 165 | if (!NILP (KVAR (current_kboard, defining_kbd_macro))) |
| 166 | { | 166 | { |
| 167 | end_kbd_macro (); | 167 | end_kbd_macro (); |
| 168 | message ("Keyboard macro defined"); | 168 | message ("Keyboard macro defined"); |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | if (XFASTINT (repeat) == 0) | 171 | if (XFASTINT (repeat) == 0) |
| 172 | Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, repeat, loopfunc); | 172 | Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), repeat, loopfunc); |
| 173 | else | 173 | else |
| 174 | { | 174 | { |
| 175 | XSETINT (repeat, XINT (repeat)-1); | 175 | XSETINT (repeat, XINT (repeat)-1); |
| 176 | if (XINT (repeat) > 0) | 176 | if (XINT (repeat) > 0) |
| 177 | Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, repeat, loopfunc); | 177 | Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), repeat, loopfunc); |
| 178 | } | 178 | } |
| 179 | return Qnil; | 179 | return Qnil; |
| 180 | } | 180 | } |
| @@ -186,7 +186,7 @@ store_kbd_macro_char (Lisp_Object c) | |||
| 186 | { | 186 | { |
| 187 | struct kboard *kb = current_kboard; | 187 | struct kboard *kb = current_kboard; |
| 188 | 188 | ||
| 189 | if (!NILP (kb->defining_kbd_macro)) | 189 | if (!NILP (KVAR (kb, defining_kbd_macro))) |
| 190 | { | 190 | { |
| 191 | if (kb->kbd_macro_ptr - kb->kbd_macro_buffer == kb->kbd_macro_bufsize) | 191 | if (kb->kbd_macro_ptr - kb->kbd_macro_buffer == kb->kbd_macro_bufsize) |
| 192 | { | 192 | { |
| @@ -248,21 +248,21 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) | |||
| 248 | { | 248 | { |
| 249 | /* Don't interfere with recognition of the previous command | 249 | /* Don't interfere with recognition of the previous command |
| 250 | from before this macro started. */ | 250 | from before this macro started. */ |
| 251 | Vthis_command = current_kboard->Vlast_command; | 251 | Vthis_command = KVAR (current_kboard, Vlast_command); |
| 252 | /* C-x z after the macro should repeat the macro. */ | 252 | /* C-x z after the macro should repeat the macro. */ |
| 253 | real_this_command = current_kboard->Vlast_kbd_macro; | 253 | real_this_command = KVAR (current_kboard, Vlast_kbd_macro); |
| 254 | 254 | ||
| 255 | if (! NILP (current_kboard->defining_kbd_macro)) | 255 | if (! NILP (KVAR (current_kboard, defining_kbd_macro))) |
| 256 | error ("Can't execute anonymous macro while defining one"); | 256 | error ("Can't execute anonymous macro while defining one"); |
| 257 | else if (NILP (current_kboard->Vlast_kbd_macro)) | 257 | else if (NILP (KVAR (current_kboard, Vlast_kbd_macro))) |
| 258 | error ("No kbd macro has been defined"); | 258 | error ("No kbd macro has been defined"); |
| 259 | else | 259 | else |
| 260 | Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, prefix, loopfunc); | 260 | Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), prefix, loopfunc); |
| 261 | 261 | ||
| 262 | /* command_loop_1 sets this to nil before it returns; | 262 | /* command_loop_1 sets this to nil before it returns; |
| 263 | get back the last command within the macro | 263 | get back the last command within the macro |
| 264 | so that it can be last, again, after we return. */ | 264 | so that it can be last, again, after we return. */ |
| 265 | Vthis_command = current_kboard->Vlast_command; | 265 | Vthis_command = KVAR (current_kboard, Vlast_command); |
| 266 | 266 | ||
| 267 | return Qnil; | 267 | return Qnil; |
| 268 | } | 268 | } |
| @@ -322,7 +322,7 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) | |||
| 322 | executing_kbd_macro = final; | 322 | executing_kbd_macro = final; |
| 323 | executing_kbd_macro_index = 0; | 323 | executing_kbd_macro_index = 0; |
| 324 | 324 | ||
| 325 | current_kboard->Vprefix_arg = Qnil; | 325 | KVAR (current_kboard, Vprefix_arg) = Qnil; |
| 326 | 326 | ||
| 327 | if (!NILP (loopfunc)) | 327 | if (!NILP (loopfunc)) |
| 328 | { | 328 | { |