diff options
| author | Karl Heuer | 1995-03-08 03:31:18 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-03-08 03:31:18 +0000 |
| commit | 5169b66ddc167f17660453982e73a1c379d2132e (patch) | |
| tree | acf7f850f9eeee134c0d032fe8ff9c0e2f735fc5 /src | |
| parent | 8de214e60dd57fd6270dfc1d7c0c3ccd21e711cf (diff) | |
| download | emacs-5169b66ddc167f17660453982e73a1c379d2132e.tar.gz emacs-5169b66ddc167f17660453982e73a1c379d2132e.zip | |
Moved clear_prefix_arg, finalize_prefix_arg, describe_prefix_arg to callint.c.
(command_loop_1): Removed inline code for prefix args.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 85 |
1 files changed, 2 insertions, 83 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index cf94944be21..8e1d3390a49 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -281,7 +281,7 @@ Lisp_Object Qself_insert_command; | |||
| 281 | Lisp_Object Qforward_char; | 281 | Lisp_Object Qforward_char; |
| 282 | Lisp_Object Qbackward_char; | 282 | Lisp_Object Qbackward_char; |
| 283 | Lisp_Object Qundefined; | 283 | Lisp_Object Qundefined; |
| 284 | Lisp_Object Quniversal_argument, Qdigit_argument, Qnegative_argument; | 284 | Lisp_Object Qdigit_argument, Qnegative_argument; |
| 285 | 285 | ||
| 286 | /* read_key_sequence stores here the command definition of the | 286 | /* read_key_sequence stores here the command definition of the |
| 287 | key sequence that it reads. */ | 287 | key sequence that it reads. */ |
| @@ -972,43 +972,6 @@ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, | |||
| 972 | error ("No recursive edit is in progress"); | 972 | error ("No recursive edit is in progress"); |
| 973 | } | 973 | } |
| 974 | 974 | ||
| 975 | void | ||
| 976 | clear_prefix_arg () | ||
| 977 | { | ||
| 978 | if (!current_perdisplay) | ||
| 979 | abort (); | ||
| 980 | current_perdisplay->prefix_factor = Qnil; | ||
| 981 | current_perdisplay->prefix_value = Qnil; | ||
| 982 | current_perdisplay->prefix_sign = 1; | ||
| 983 | current_perdisplay->prefix_partial = 0; | ||
| 984 | Vprefix_arg = Qnil; | ||
| 985 | } | ||
| 986 | |||
| 987 | static void | ||
| 988 | finalize_prefix_arg () | ||
| 989 | { | ||
| 990 | if (!NILP (current_perdisplay->prefix_factor)) | ||
| 991 | Vprefix_arg = Fcons (current_perdisplay->prefix_factor, Qnil); | ||
| 992 | else if (NILP (current_perdisplay->prefix_value)) | ||
| 993 | Vprefix_arg = (current_perdisplay->prefix_sign > 0 ? Qnil : Qminus); | ||
| 994 | else if (current_perdisplay->prefix_sign > 0) | ||
| 995 | Vprefix_arg = current_perdisplay->prefix_value; | ||
| 996 | else | ||
| 997 | XSETINT (Vprefix_arg, -XINT (current_perdisplay->prefix_value)); | ||
| 998 | current_perdisplay->prefix_partial = 0; | ||
| 999 | } | ||
| 1000 | |||
| 1001 | static void | ||
| 1002 | describe_prefix_arg () | ||
| 1003 | { | ||
| 1004 | if (INTEGERP (Vprefix_arg)) | ||
| 1005 | message ("Arg: %d", Vprefix_arg); | ||
| 1006 | else if (CONSP (Vprefix_arg)) | ||
| 1007 | message ("Arg: [%d]", XCONS (Vprefix_arg)->car); | ||
| 1008 | else if (EQ (Vprefix_arg, Qminus)) | ||
| 1009 | message ("Arg: -"); | ||
| 1010 | } | ||
| 1011 | |||
| 1012 | /* This is the actual command reading loop, | 975 | /* This is the actual command reading loop, |
| 1013 | sans error-handling encapsulation. */ | 976 | sans error-handling encapsulation. */ |
| 1014 | 977 | ||
| @@ -1191,48 +1154,7 @@ command_loop_1 () | |||
| 1191 | } | 1154 | } |
| 1192 | else | 1155 | else |
| 1193 | { | 1156 | { |
| 1194 | if (EQ (cmd, Quniversal_argument)) | 1157 | current_prefix_partial = current_perdisplay->prefix_partial; |
| 1195 | { | ||
| 1196 | if (!current_perdisplay->prefix_partial) | ||
| 1197 | { | ||
| 1198 | /* First C-u */ | ||
| 1199 | XSETFASTINT (current_perdisplay->prefix_factor, 4); | ||
| 1200 | current_perdisplay->prefix_value = Qnil; | ||
| 1201 | current_perdisplay->prefix_sign = 1; | ||
| 1202 | current_perdisplay->prefix_partial = 1; | ||
| 1203 | } | ||
| 1204 | else if (!NILP (current_perdisplay->prefix_factor)) | ||
| 1205 | { | ||
| 1206 | /* Subsequent C-u */ | ||
| 1207 | XSETINT (current_perdisplay->prefix_factor, | ||
| 1208 | XINT (current_perdisplay->prefix_factor) * 4); | ||
| 1209 | } | ||
| 1210 | else | ||
| 1211 | { | ||
| 1212 | /* Terminating C-u */ | ||
| 1213 | finalize_prefix_arg (); | ||
| 1214 | describe_prefix_arg (); | ||
| 1215 | } | ||
| 1216 | goto directly_done; | ||
| 1217 | } | ||
| 1218 | else if (EQ (cmd, Qnegative_argument)) | ||
| 1219 | { | ||
| 1220 | current_perdisplay->prefix_factor = Qnil; | ||
| 1221 | current_perdisplay->prefix_sign *= -1; | ||
| 1222 | current_perdisplay->prefix_partial = 1; | ||
| 1223 | goto directly_done; | ||
| 1224 | } | ||
| 1225 | else if (EQ (cmd, Qdigit_argument) && INTEGERP (keybuf[0])) | ||
| 1226 | { | ||
| 1227 | current_perdisplay->prefix_factor = Qnil; | ||
| 1228 | if (NILP (current_perdisplay->prefix_value)) | ||
| 1229 | XSETFASTINT (current_perdisplay->prefix_value, 0); | ||
| 1230 | XSETINT (current_perdisplay->prefix_value, | ||
| 1231 | (XINT (current_perdisplay->prefix_value) * 10 | ||
| 1232 | + (XINT (keybuf[0]) & 0177) - '0')); | ||
| 1233 | current_perdisplay->prefix_partial = 1; | ||
| 1234 | goto directly_done; | ||
| 1235 | } | ||
| 1236 | if (current_perdisplay->prefix_partial) | 1158 | if (current_perdisplay->prefix_partial) |
| 1237 | finalize_prefix_arg (); | 1159 | finalize_prefix_arg (); |
| 1238 | 1160 | ||
| @@ -6572,9 +6494,6 @@ syms_of_keyboard () | |||
| 6572 | Qundefined = intern ("undefined"); | 6494 | Qundefined = intern ("undefined"); |
| 6573 | staticpro (&Qundefined); | 6495 | staticpro (&Qundefined); |
| 6574 | 6496 | ||
| 6575 | Quniversal_argument = intern ("universal-argument"); | ||
| 6576 | staticpro (&Quniversal_argument); | ||
| 6577 | |||
| 6578 | Qdigit_argument = intern ("digit-argument"); | 6497 | Qdigit_argument = intern ("digit-argument"); |
| 6579 | staticpro (&Qdigit_argument); | 6498 | staticpro (&Qdigit_argument); |
| 6580 | 6499 | ||