comparison src/callint.c @ 173:8eaf7971accc r20-3b13

Import from CVS: tag r20-3b13
author cvs
date Mon, 13 Aug 2007 09:49:09 +0200
parents 15872534500d
children 9ad43877534d
comparison
equal deleted inserted replaced
172:a38aed19690b 173:8eaf7971accc
181 181
182 tem = Fmarker_buffer (current_buffer->mark); 182 tem = Fmarker_buffer (current_buffer->mark);
183 if (NILP (tem) || (XBUFFER (tem) != current_buffer)) 183 if (NILP (tem) || (XBUFFER (tem) != current_buffer))
184 error ("The mark is not set now"); 184 error ("The mark is not set now");
185 185
186 return (marker_position (current_buffer->mark)); 186 return marker_position (current_buffer->mark);
187 } 187 }
188 188
189 static Lisp_Object 189 static Lisp_Object
190 callint_prompt (CONST Bufbyte *prompt_start, Bytecount prompt_length, 190 callint_prompt (CONST Bufbyte *prompt_start, Bytecount prompt_length,
191 CONST Lisp_Object *args, int nargs) 191 CONST Lisp_Object *args, int nargs)
194 struct gcpro gcpro1; 194 struct gcpro gcpro1;
195 195
196 /* Fformat no longer smashes its arg vector, so no need to copy it. */ 196 /* Fformat no longer smashes its arg vector, so no need to copy it. */
197 197
198 if (!strchr ((char *) XSTRING_DATA (s), '%')) 198 if (!strchr ((char *) XSTRING_DATA (s), '%'))
199 return (s); 199 return s;
200 GCPRO1 (s); 200 GCPRO1 (s);
201 RETURN_UNGCPRO (emacs_doprnt_string_lisp (0, s, 0, nargs, args)); 201 RETURN_UNGCPRO (emacs_doprnt_string_lisp (0, s, 0, nargs, args));
202 } 202 }
203 203
204 /* `lambda' for RECORD-FLAG is an XEmacs addition. */ 204 /* `lambda' for RECORD-FLAG is an XEmacs addition. */
241 int set_zmacs_region_stays = 0; 241 int set_zmacs_region_stays = 0;
242 int mouse_event_count = 0; 242 int mouse_event_count = 0;
243 243
244 if (!NILP (keys)) 244 if (!NILP (keys))
245 { 245 {
246 int i; 246 int i, len;
247 247
248 CHECK_VECTOR (keys); 248 CHECK_VECTOR (keys);
249 for (i = 0; i < vector_length (XVECTOR (keys)); i++) 249 len = XVECTOR_LENGTH (keys);
250 CHECK_LIVE_EVENT (vector_data (XVECTOR (keys))[i]); 250 for (i = 0; i < len; i++)
251 CHECK_LIVE_EVENT (XVECTOR_DATA (keys)[i]);
251 } 252 }
252 253
253 /* Save this now, since use of minibuffer will clobber it. */ 254 /* Save this now, since use of minibuffer will clobber it. */
254 prefix = Vcurrent_prefix_arg; 255 prefix = Vcurrent_prefix_arg;
255 256
328 /* Compute the arg values using the user's expression. */ 329 /* Compute the arg values using the user's expression. */
329 specs = Feval (specs); 330 specs = Feval (specs);
330 if (EQ (record_flag, Qlambda)) /* XEmacs addition */ 331 if (EQ (record_flag, Qlambda)) /* XEmacs addition */
331 { 332 {
332 UNGCPRO; 333 UNGCPRO;
333 return (specs); 334 return specs;
334 } 335 }
335 if (!NILP (record_flag) || i != num_input_chars) 336 if (!NILP (record_flag) || i != num_input_chars)
336 { 337 {
337 /* We should record this command on the command history. */ 338 /* We should record this command on the command history. */
338 /* #### The following is too specific; should have general 339 /* #### The following is too specific; should have general
502 503
503 if (argcount == 0) 504 if (argcount == 0)
504 { 505 {
505 /* Interactive function or no arguments; just call it */ 506 /* Interactive function or no arguments; just call it */
506 if (EQ (record_flag, Qlambda)) 507 if (EQ (record_flag, Qlambda))
507 return (Qnil); 508 return Qnil;
508 if (!NILP (record_flag)) 509 if (!NILP (record_flag))
509 { 510 {
510 Vcommand_history = Fcons (list1 (function), Vcommand_history); 511 Vcommand_history = Fcons (list1 (function), Vcommand_history);
511 } 512 }
512 specbind (Qcommand_debug_status, Qnil); 513 specbind (Qcommand_debug_status, Qnil);
518 fun = funcall_recording_as (function, 1, &fun); 519 fun = funcall_recording_as (function, 1, &fun);
519 UNGCPRO; 520 UNGCPRO;
520 } 521 }
521 if (set_zmacs_region_stays) 522 if (set_zmacs_region_stays)
522 zmacs_region_stays = 1; 523 zmacs_region_stays = 1;
523 return (unbind_to (speccount, fun)); 524 return unbind_to (speccount, fun);
524 } 525 }
525 526
526 /* Read interactive arguments */ 527 /* Read interactive arguments */
527 { 528 {
528 /* args[-1] is the function to call */ 529 /* args[-1] is the function to call */
926 specbind (Qcommand_debug_status, Qnil); 927 specbind (Qcommand_debug_status, Qnil);
927 fun = Ffuncall (argcount + 1, args - 1); 928 fun = Ffuncall (argcount + 1, args - 1);
928 UNGCPRO; 929 UNGCPRO;
929 if (set_zmacs_region_stays) 930 if (set_zmacs_region_stays)
930 zmacs_region_stays = 1; 931 zmacs_region_stays = 1;
931 return (unbind_to (speccount, fun)); 932 return unbind_to (speccount, fun);
932 } 933 }
933 } 934 }
934 935
935 DEFUN ("prefix-numeric-value", Fprefix_numeric_value, 1, 1, 0, /* 936 DEFUN ("prefix-numeric-value", Fprefix_numeric_value, 1, 1, 0, /*
936 Return numeric meaning of raw prefix argument ARG. 937 Return numeric meaning of raw prefix argument ARG.
950 else if (CONSP (raw) && INTP (XCAR (raw))) 951 else if (CONSP (raw) && INTP (XCAR (raw)))
951 val = XINT (XCAR (raw)); 952 val = XINT (XCAR (raw));
952 else 953 else
953 val = 1; 954 val = 1;
954 955
955 return (make_int (val)); 956 return make_int (val);
956 957
957 } 958 }
958 959
959 void 960 void
960 syms_of_callint (void) 961 syms_of_callint (void)