diff options
| author | Karl Heuer | 1994-09-27 02:12:02 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-09-27 02:12:02 +0000 |
| commit | 7510b296e72bf09e34c7a08a92e065518759789c (patch) | |
| tree | fcb2823c0df282cc081b816985bf9afefe2a2539 /src | |
| parent | fb8116a7bfd5c7411a62e5d414a043e016a2c6f4 (diff) | |
| download | emacs-7510b296e72bf09e34c7a08a92e065518759789c.tar.gz emacs-7510b296e72bf09e34c7a08a92e065518759789c.zip | |
(read_minibuf, Fread_from_minibuffer, Fread_buffer, Ftry_completion,
Ftry_completion, Fall_completions, Fcompleting_read, do_completion,
assoc_for_completion, Fminibuffer_complete_word, Fdisplay_completion_list,
Fself_insert_and_exit): Use type test macros.
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index d5f75bd35b7..4d64c33f2cb 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -131,11 +131,11 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos) | |||
| 131 | int count = specpdl_ptr - specpdl; | 131 | int count = specpdl_ptr - specpdl; |
| 132 | Lisp_Object mini_frame; | 132 | Lisp_Object mini_frame; |
| 133 | 133 | ||
| 134 | if (XTYPE (prompt) != Lisp_String) | 134 | if (!STRINGP (prompt)) |
| 135 | prompt = build_string (""); | 135 | prompt = build_string (""); |
| 136 | 136 | ||
| 137 | /* Emacs in -batch mode calls minibuffer: print the prompt. */ | 137 | /* Emacs in -batch mode calls minibuffer: print the prompt. */ |
| 138 | if (noninteractive && XTYPE (prompt) == Lisp_String) | 138 | if (noninteractive && STRINGP (prompt)) |
| 139 | printf ("%s", XSTRING (prompt)->data); | 139 | printf ("%s", XSTRING (prompt)->data); |
| 140 | 140 | ||
| 141 | if (!enable_recursive_minibuffers | 141 | if (!enable_recursive_minibuffers |
| @@ -187,7 +187,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos) | |||
| 187 | up Emacs and buf's default directory is Qnil. Here's a hack; can | 187 | up Emacs and buf's default directory is Qnil. Here's a hack; can |
| 188 | you think of something better to do? Find another buffer with a | 188 | you think of something better to do? Find another buffer with a |
| 189 | better directory, and use that one instead. */ | 189 | better directory, and use that one instead. */ |
| 190 | if (XTYPE (val) == Lisp_String) | 190 | if (STRINGP (val)) |
| 191 | current_buffer->directory = val; | 191 | current_buffer->directory = val; |
| 192 | else | 192 | else |
| 193 | { | 193 | { |
| @@ -200,7 +200,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos) | |||
| 200 | Lisp_Object other_buf; | 200 | Lisp_Object other_buf; |
| 201 | 201 | ||
| 202 | other_buf = XCONS (XCONS (buf_list)->car)->cdr; | 202 | other_buf = XCONS (XCONS (buf_list)->car)->cdr; |
| 203 | if (XTYPE (XBUFFER (other_buf)->directory) == Lisp_String) | 203 | if (STRINGP (XBUFFER (other_buf)->directory)) |
| 204 | { | 204 | { |
| 205 | current_buffer->directory = XBUFFER (other_buf)->directory; | 205 | current_buffer->directory = XBUFFER (other_buf)->directory; |
| 206 | break; | 206 | break; |
| @@ -228,7 +228,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos) | |||
| 228 | if (!NILP (initial)) | 228 | if (!NILP (initial)) |
| 229 | { | 229 | { |
| 230 | Finsert (1, &initial); | 230 | Finsert (1, &initial); |
| 231 | if (!NILP (backup_n) && XTYPE (backup_n) == Lisp_Int) | 231 | if (!NILP (backup_n) && INTEGERP (backup_n)) |
| 232 | Fforward_char (backup_n); | 232 | Fforward_char (backup_n); |
| 233 | } | 233 | } |
| 234 | 234 | ||
| @@ -271,7 +271,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos) | |||
| 271 | 271 | ||
| 272 | /* Add the value to the appropriate history list unless it is empty. */ | 272 | /* Add the value to the appropriate history list unless it is empty. */ |
| 273 | if (XSTRING (val)->size != 0 | 273 | if (XSTRING (val)->size != 0 |
| 274 | && XTYPE (Vminibuffer_history_variable) == Lisp_Symbol | 274 | && SYMBOLP (Vminibuffer_history_variable) |
| 275 | && ! EQ (XSYMBOL (Vminibuffer_history_variable)->value, Qunbound)) | 275 | && ! EQ (XSYMBOL (Vminibuffer_history_variable)->value, Qunbound)) |
| 276 | { | 276 | { |
| 277 | /* If the caller wanted to save the value read on a history list, | 277 | /* If the caller wanted to save the value read on a history list, |
| @@ -436,7 +436,7 @@ DEFUN ("read-from-minibuffer", Fread_from_minibuffer, Sread_from_minibuffer, 1, | |||
| 436 | CHECK_STRING (prompt, 0); | 436 | CHECK_STRING (prompt, 0); |
| 437 | if (!NILP (initial_contents)) | 437 | if (!NILP (initial_contents)) |
| 438 | { | 438 | { |
| 439 | if (XTYPE (initial_contents) == Lisp_Cons) | 439 | if (CONSP (initial_contents)) |
| 440 | { | 440 | { |
| 441 | position = Fcdr (initial_contents); | 441 | position = Fcdr (initial_contents); |
| 442 | initial_contents = Fcar (initial_contents); | 442 | initial_contents = Fcar (initial_contents); |
| @@ -455,7 +455,7 @@ DEFUN ("read-from-minibuffer", Fread_from_minibuffer, Sread_from_minibuffer, 1, | |||
| 455 | else | 455 | else |
| 456 | keymap = get_keymap (keymap,2); | 456 | keymap = get_keymap (keymap,2); |
| 457 | 457 | ||
| 458 | if (XTYPE (hist) == Lisp_Symbol) | 458 | if (SYMBOLP (hist)) |
| 459 | { | 459 | { |
| 460 | histvar = hist; | 460 | histvar = hist; |
| 461 | histpos = Qnil; | 461 | histpos = Qnil; |
| @@ -569,7 +569,7 @@ If optional third arg REQUIRE-MATCH is non-nil, only existing buffer names are a | |||
| 569 | Lisp_Object args[3]; | 569 | Lisp_Object args[3]; |
| 570 | struct gcpro gcpro1; | 570 | struct gcpro gcpro1; |
| 571 | 571 | ||
| 572 | if (XTYPE (def) == Lisp_Buffer) | 572 | if (BUFFERP (def)) |
| 573 | def = XBUFFER (def)->name; | 573 | def = XBUFFER (def)->name; |
| 574 | if (!NILP (def)) | 574 | if (!NILP (def)) |
| 575 | { | 575 | { |
| @@ -618,7 +618,7 @@ The argument given to PREDICATE is the alist element or the symbol from the obar | |||
| 618 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 618 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 619 | 619 | ||
| 620 | CHECK_STRING (string, 0); | 620 | CHECK_STRING (string, 0); |
| 621 | if (!list && XTYPE (alist) != Lisp_Vector) | 621 | if (!list && !VECTORP (alist)) |
| 622 | return call3 (alist, string, pred, Qnil); | 622 | return call3 (alist, string, pred, Qnil); |
| 623 | 623 | ||
| 624 | bestmatch = Qnil; | 624 | bestmatch = Qnil; |
| @@ -669,7 +669,7 @@ The argument given to PREDICATE is the alist element or the symbol from the obar | |||
| 669 | 669 | ||
| 670 | /* Is this element a possible completion? */ | 670 | /* Is this element a possible completion? */ |
| 671 | 671 | ||
| 672 | if (XTYPE (eltstring) == Lisp_String | 672 | if (STRINGP (eltstring) |
| 673 | && XSTRING (string)->size <= XSTRING (eltstring)->size | 673 | && XSTRING (string)->size <= XSTRING (eltstring)->size |
| 674 | && 0 > scmp (XSTRING (eltstring)->data, XSTRING (string)->data, | 674 | && 0 > scmp (XSTRING (eltstring)->data, XSTRING (string)->data, |
| 675 | XSTRING (string)->size)) | 675 | XSTRING (string)->size)) |
| @@ -821,7 +821,7 @@ The argument given to PREDICATE is the alist element or the symbol from the obar | |||
| 821 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 821 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 822 | 822 | ||
| 823 | CHECK_STRING (string, 0); | 823 | CHECK_STRING (string, 0); |
| 824 | if (!list && XTYPE (alist) != Lisp_Vector) | 824 | if (!list && !VECTORP (alist)) |
| 825 | { | 825 | { |
| 826 | return call3 (alist, string, pred, Qt); | 826 | return call3 (alist, string, pred, Qt); |
| 827 | } | 827 | } |
| @@ -873,7 +873,7 @@ The argument given to PREDICATE is the alist element or the symbol from the obar | |||
| 873 | 873 | ||
| 874 | /* Is this element a possible completion? */ | 874 | /* Is this element a possible completion? */ |
| 875 | 875 | ||
| 876 | if (XTYPE (eltstring) == Lisp_String | 876 | if (STRINGP (eltstring) |
| 877 | && XSTRING (string)->size <= XSTRING (eltstring)->size | 877 | && XSTRING (string)->size <= XSTRING (eltstring)->size |
| 878 | /* Reject alternatives that start with space | 878 | /* Reject alternatives that start with space |
| 879 | unless the input starts with space. */ | 879 | unless the input starts with space. */ |
| @@ -975,7 +975,7 @@ DEFUN ("completing-read", Fcompleting_read, Scompleting_read, 2, 6, 0, | |||
| 975 | position = Qnil; | 975 | position = Qnil; |
| 976 | if (!NILP (init)) | 976 | if (!NILP (init)) |
| 977 | { | 977 | { |
| 978 | if (XTYPE (init) == Lisp_Cons) | 978 | if (CONSP (init)) |
| 979 | { | 979 | { |
| 980 | position = Fcdr (init); | 980 | position = Fcdr (init); |
| 981 | init = Fcar (init); | 981 | init = Fcar (init); |
| @@ -989,7 +989,7 @@ DEFUN ("completing-read", Fcompleting_read, Scompleting_read, 2, 6, 0, | |||
| 989 | } | 989 | } |
| 990 | } | 990 | } |
| 991 | 991 | ||
| 992 | if (XTYPE (hist) == Lisp_Symbol) | 992 | if (SYMBOLP (hist)) |
| 993 | { | 993 | { |
| 994 | histvar = hist; | 994 | histvar = hist; |
| 995 | histpos = Qnil; | 995 | histpos = Qnil; |
| @@ -1095,7 +1095,7 @@ do_completion () | |||
| 1095 | || NILP (Vminibuffer_completion_table)) | 1095 | || NILP (Vminibuffer_completion_table)) |
| 1096 | tem = assoc_for_completion (Fbuffer_string (), | 1096 | tem = assoc_for_completion (Fbuffer_string (), |
| 1097 | Vminibuffer_completion_table); | 1097 | Vminibuffer_completion_table); |
| 1098 | else if (XTYPE (Vminibuffer_completion_table) == Lisp_Vector) | 1098 | else if (VECTORP (Vminibuffer_completion_table)) |
| 1099 | { | 1099 | { |
| 1100 | /* the primitive used by Fintern_soft */ | 1100 | /* the primitive used by Fintern_soft */ |
| 1101 | extern Lisp_Object oblookup (); | 1101 | extern Lisp_Object oblookup (); |
| @@ -1104,7 +1104,7 @@ do_completion () | |||
| 1104 | /* Bypass intern-soft as that loses for nil */ | 1104 | /* Bypass intern-soft as that loses for nil */ |
| 1105 | tem = oblookup (Vminibuffer_completion_table, | 1105 | tem = oblookup (Vminibuffer_completion_table, |
| 1106 | XSTRING (tem)->data, XSTRING (tem)->size); | 1106 | XSTRING (tem)->data, XSTRING (tem)->size); |
| 1107 | if (XTYPE (tem) != Lisp_Symbol) | 1107 | if (!SYMBOLP (tem)) |
| 1108 | tem = Qnil; | 1108 | tem = Qnil; |
| 1109 | else if (!NILP (Vminibuffer_completion_predicate)) | 1109 | else if (!NILP (Vminibuffer_completion_predicate)) |
| 1110 | tem = call1 (Vminibuffer_completion_predicate, tem); | 1110 | tem = call1 (Vminibuffer_completion_predicate, tem); |
| @@ -1166,7 +1166,7 @@ assoc_for_completion (key, list) | |||
| 1166 | elt = Fcar (tail); | 1166 | elt = Fcar (tail); |
| 1167 | if (!CONSP (elt)) continue; | 1167 | if (!CONSP (elt)) continue; |
| 1168 | thiscar = Fcar (elt); | 1168 | thiscar = Fcar (elt); |
| 1169 | if (XTYPE (thiscar) != Lisp_String) | 1169 | if (!STRINGP (thiscar)) |
| 1170 | continue; | 1170 | continue; |
| 1171 | if (completion_ignore_case) | 1171 | if (completion_ignore_case) |
| 1172 | thiscar = Fupcase (thiscar); | 1172 | thiscar = Fupcase (thiscar); |
| @@ -1366,7 +1366,7 @@ Return nil if there is no valid completion, else t.") | |||
| 1366 | Vminibuffer_completion_predicate); | 1366 | Vminibuffer_completion_predicate); |
| 1367 | UNGCPRO; | 1367 | UNGCPRO; |
| 1368 | 1368 | ||
| 1369 | if (XTYPE (tem) == Lisp_String) | 1369 | if (STRINGP (tem)) |
| 1370 | completion = tem; | 1370 | completion = tem; |
| 1371 | else | 1371 | else |
| 1372 | { | 1372 | { |
| @@ -1377,7 +1377,7 @@ Return nil if there is no valid completion, else t.") | |||
| 1377 | Vminibuffer_completion_predicate); | 1377 | Vminibuffer_completion_predicate); |
| 1378 | UNGCPRO; | 1378 | UNGCPRO; |
| 1379 | 1379 | ||
| 1380 | if (XTYPE (tem) == Lisp_String) | 1380 | if (STRINGP (tem)) |
| 1381 | completion = tem; | 1381 | completion = tem; |
| 1382 | } | 1382 | } |
| 1383 | } | 1383 | } |
| @@ -1429,7 +1429,7 @@ It can find the completion buffer in `standard-output'.") | |||
| 1429 | points to a non-string that is pointed to by COMPLETIONS. */ | 1429 | points to a non-string that is pointed to by COMPLETIONS. */ |
| 1430 | GCPRO1 (completions); | 1430 | GCPRO1 (completions); |
| 1431 | 1431 | ||
| 1432 | if (XTYPE (Vstandard_output) == Lisp_Buffer) | 1432 | if (BUFFERP (Vstandard_output)) |
| 1433 | set_buffer_internal (XBUFFER (Vstandard_output)); | 1433 | set_buffer_internal (XBUFFER (Vstandard_output)); |
| 1434 | 1434 | ||
| 1435 | if (NILP (completions)) | 1435 | if (NILP (completions)) |
| @@ -1446,7 +1446,7 @@ It can find the completion buffer in `standard-output'.") | |||
| 1446 | until after the text has been made. */ | 1446 | until after the text has been made. */ |
| 1447 | if (i & 1) | 1447 | if (i & 1) |
| 1448 | { | 1448 | { |
| 1449 | if (XTYPE (Vstandard_output) == Lisp_Buffer) | 1449 | if (BUFFERP (Vstandard_output)) |
| 1450 | Findent_to (make_number (35), make_number (2)); | 1450 | Findent_to (make_number (35), make_number (2)); |
| 1451 | else | 1451 | else |
| 1452 | { | 1452 | { |
| @@ -1466,7 +1466,7 @@ It can find the completion buffer in `standard-output'.") | |||
| 1466 | elt = Fcar (tail); | 1466 | elt = Fcar (tail); |
| 1467 | if (CONSP (elt)) | 1467 | if (CONSP (elt)) |
| 1468 | { | 1468 | { |
| 1469 | if (XTYPE (Vstandard_output) != Lisp_Buffer) | 1469 | if (!BUFFERP (Vstandard_output)) |
| 1470 | { | 1470 | { |
| 1471 | Lisp_Object tem; | 1471 | Lisp_Object tem; |
| 1472 | tem = Flength (Fcar (elt)); | 1472 | tem = Flength (Fcar (elt)); |
| @@ -1479,7 +1479,7 @@ It can find the completion buffer in `standard-output'.") | |||
| 1479 | } | 1479 | } |
| 1480 | else | 1480 | else |
| 1481 | { | 1481 | { |
| 1482 | if (XTYPE (Vstandard_output) != Lisp_Buffer) | 1482 | if (!BUFFERP (Vstandard_output)) |
| 1483 | { | 1483 | { |
| 1484 | Lisp_Object tem; | 1484 | Lisp_Object tem; |
| 1485 | tem = Flength (elt); | 1485 | tem = Flength (elt); |
| @@ -1492,7 +1492,7 @@ It can find the completion buffer in `standard-output'.") | |||
| 1492 | 1492 | ||
| 1493 | UNGCPRO; | 1493 | UNGCPRO; |
| 1494 | 1494 | ||
| 1495 | if (XTYPE (Vstandard_output) == Lisp_Buffer) | 1495 | if (BUFFERP (Vstandard_output)) |
| 1496 | set_buffer_internal (old); | 1496 | set_buffer_internal (old); |
| 1497 | 1497 | ||
| 1498 | if (!NILP (Vrun_hooks)) | 1498 | if (!NILP (Vrun_hooks)) |
| @@ -1530,7 +1530,7 @@ DEFUN ("self-insert-and-exit", Fself_insert_and_exit, Sself_insert_and_exit, 0, | |||
| 1530 | "Terminate minibuffer input.") | 1530 | "Terminate minibuffer input.") |
| 1531 | () | 1531 | () |
| 1532 | { | 1532 | { |
| 1533 | if (XTYPE (last_command_char) == Lisp_Int) | 1533 | if (INTEGERP (last_command_char)) |
| 1534 | internal_self_insert (last_command_char, 0); | 1534 | internal_self_insert (last_command_char, 0); |
| 1535 | else | 1535 | else |
| 1536 | bitch_at_user (); | 1536 | bitch_at_user (); |