Mercurial > emacs
comparison src/minibuf.c @ 53827:44d25617bd98
(Fminibufferp, Fread_from_minibuffer)
(Fread_minibuffer, Feval_minibuffer)
(Fread_string, Fread_no_blanks_input)
(Fcompleting_read): Doc fixes.
(syms_of_minibuf): Doc fixes for minibuffer-completion-table and
completion-regexp-list. Define Qcase_fold_search and staticpro it.
(read_minibuf): Fix initial comment.
(Ftry_completion, Fall_completions, Ftest_completion): Bind
case-fold-serach to the value of completion-ignore-case when
checking completion-regexp-list.
(Fdisplay_completion_list): Make it handle arguments that are
symbols. Doc fix.
author | Luc Teirlinck <teirllm@auburn.edu> |
---|---|
date | Fri, 06 Feb 2004 04:49:55 +0000 |
parents | d4539e5181a1 |
children | 1e94f291a19c 03a73693678e |
comparison
equal
deleted
inserted
replaced
53826:3b1ebffbffa9 | 53827:44d25617bd98 |
---|---|
128 Lisp_Object Quser_variable_p; | 128 Lisp_Object Quser_variable_p; |
129 | 129 |
130 Lisp_Object Qminibuffer_default; | 130 Lisp_Object Qminibuffer_default; |
131 | 131 |
132 Lisp_Object Qcurrent_input_method, Qactivate_input_method; | 132 Lisp_Object Qcurrent_input_method, Qactivate_input_method; |
133 | |
134 Lisp_Object Qcase_fold_search; | |
133 | 135 |
134 extern Lisp_Object Qmouse_face; | 136 extern Lisp_Object Qmouse_face; |
135 | 137 |
136 extern Lisp_Object Qfield; | 138 extern Lisp_Object Qfield; |
137 | 139 |
319 } | 321 } |
320 | 322 |
321 DEFUN ("minibufferp", Fminibufferp, | 323 DEFUN ("minibufferp", Fminibufferp, |
322 Sminibufferp, 0, 1, 0, | 324 Sminibufferp, 0, 1, 0, |
323 doc: /* Return t if BUFFER is a minibuffer. | 325 doc: /* Return t if BUFFER is a minibuffer. |
324 No argument or nil as argument means use current buffer as BUFFER.*/) | 326 No argument or nil as argument means use current buffer as BUFFER. |
327 BUFFER can be a buffer or a buffer name. */) | |
325 (buffer) | 328 (buffer) |
326 Lisp_Object buffer; | 329 Lisp_Object buffer; |
327 { | 330 { |
328 Lisp_Object tem; | 331 Lisp_Object tem; |
329 | 332 |
408 putting point minus BACKUP_N bytes from the end of INITIAL, | 411 putting point minus BACKUP_N bytes from the end of INITIAL, |
409 prompting with PROMPT (a string), using history list HISTVAR | 412 prompting with PROMPT (a string), using history list HISTVAR |
410 with initial position HISTPOS. INITIAL should be a string or a | 413 with initial position HISTPOS. INITIAL should be a string or a |
411 cons of a string and an integer. BACKUP_N should be <= 0, or | 414 cons of a string and an integer. BACKUP_N should be <= 0, or |
412 Qnil, which is equivalent to 0. If INITIAL is a cons, BACKUP_N is | 415 Qnil, which is equivalent to 0. If INITIAL is a cons, BACKUP_N is |
413 ignored and replaced with an integer that puts point N characters | 416 ignored and replaced with an integer that puts point at one-indexed |
414 from the beginning of INITIAL, where N is the CDR of INITIAL, or at | 417 position N in INITIAL, where N is the CDR of INITIAL, or at the |
415 the beginning of INITIAL if N <= 0. | 418 beginning of INITIAL if N <= 0. |
416 | 419 |
417 Normally return the result as a string (the text that was read), | 420 Normally return the result as a string (the text that was read), |
418 but if EXPFLAG is nonzero, read it and return the object read. | 421 but if EXPFLAG is nonzero, read it and return the object read. |
419 If HISTVAR is given, save the value read on that history only if it doesn't | 422 If HISTVAR is given, save the value read on that history only if it doesn't |
420 match the front of that history list exactly. The value is pushed onto | 423 match the front of that history list exactly. The value is pushed onto |
891 } | 894 } |
892 | 895 |
893 | 896 |
894 DEFUN ("read-from-minibuffer", Fread_from_minibuffer, Sread_from_minibuffer, 1, 7, 0, | 897 DEFUN ("read-from-minibuffer", Fread_from_minibuffer, Sread_from_minibuffer, 1, 7, 0, |
895 doc: /* Read a string from the minibuffer, prompting with string PROMPT. | 898 doc: /* Read a string from the minibuffer, prompting with string PROMPT. |
896 If optional second arg INITIAL-CONTENTS is non-nil, it is a string | 899 The optional second arg INITIAL-CONTENTS is an obsolete alternative to |
897 to be inserted into the minibuffer before reading input. | 900 DEFAULT-VALUE. It normally should be nil in new code, except when |
898 If INITIAL-CONTENTS is (STRING . POSITION), the initial input | 901 HIST is a cons. It is discussed in more detail below. |
899 is STRING, but point is placed at position POSITION in the minibuffer. | |
900 Third arg KEYMAP is a keymap to use whilst reading; | 902 Third arg KEYMAP is a keymap to use whilst reading; |
901 if omitted or nil, the default is `minibuffer-local-map'. | 903 if omitted or nil, the default is `minibuffer-local-map'. |
902 If fourth arg READ is non-nil, then interpret the result as a Lisp object | 904 If fourth arg READ is non-nil, then interpret the result as a Lisp object |
903 and return that object: | 905 and return that object: |
904 in other words, do `(car (read-from-string INPUT-STRING))' | 906 in other words, do `(car (read-from-string INPUT-STRING))' |
905 Fifth arg HIST, if non-nil, specifies a history list | 907 Fifth arg HIST, if non-nil, specifies a history list and optionally |
906 and optionally the initial position in the list. | 908 the initial position in the list. It can be a symbol, which is the |
907 It can be a symbol, which is the history list variable to use, | 909 history list variable to use, or it can be a cons cell |
908 or it can be a cons cell (HISTVAR . HISTPOS). | 910 (HISTVAR . HISTPOS). In that case, HISTVAR is the history list variable |
909 In that case, HISTVAR is the history list variable to use, | 911 to use, and HISTPOS is the initial position for use by the minibuffer |
910 and HISTPOS is the initial position (the position in the list | 912 history commands. For consistency, you should also specify that |
911 which INITIAL-CONTENTS corresponds to). | 913 element of the history as the value of INITIAL-CONTENTS. Positions |
912 Positions are counted starting from 1 at the beginning of the list. | 914 are counted starting from 1 at the beginning of the list. |
913 Sixth arg DEFAULT-VALUE is the default value. If non-nil, it is available | 915 Sixth arg DEFAULT-VALUE is the default value. If non-nil, it is available |
914 for history commands; but, unless READ is non-nil, `read-from-minibuffer' | 916 for history commands; but, unless READ is non-nil, `read-from-minibuffer' |
915 does NOT return DEFAULT-VALUE if the user enters empty input! It returns | 917 does NOT return DEFAULT-VALUE if the user enters empty input! It returns |
916 the empty string. | 918 the empty string. |
917 Seventh arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits | 919 Seventh arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits |
918 the current input method and the setting of `enable-multibyte-characters'. | 920 the current input method and the setting of `enable-multibyte-characters'. |
919 If the variable `minibuffer-allow-text-properties' is non-nil, | 921 If the variable `minibuffer-allow-text-properties' is non-nil, |
920 then the string which is returned includes whatever text properties | 922 then the string which is returned includes whatever text properties |
921 were present in the minibuffer. Otherwise the value has no text properties. */) | 923 were present in the minibuffer. Otherwise the value has no text properties. |
924 | |
925 The remainder of this documentation string describes the | |
926 INITIAL-CONTENTS argument in more detail. It is only relevant when | |
927 studying existing code, or when HIST is a cons. If non-nil, | |
928 INITIAL-CONTENTS is a string to be inserted into the minibuffer before | |
929 reading input. Normally, point is put at the end of that string. | |
930 However, if INITIAL-CONTENTS is \(STRING . POSITION), the initial | |
931 input is STRING, but point is placed at _one-indexed_ position | |
932 POSITION in the minibuffer. Any integer value less than or equal to | |
933 one puts point at the beginning of the string. *Note* that this | |
934 behavior differs from the way such arguments are used in `completing-read' | |
935 and some related functions, which use zero-indexing for POSITION. */) | |
922 (prompt, initial_contents, keymap, read, hist, default_value, inherit_input_method) | 936 (prompt, initial_contents, keymap, read, hist, default_value, inherit_input_method) |
923 Lisp_Object prompt, initial_contents, keymap, read, hist, default_value; | 937 Lisp_Object prompt, initial_contents, keymap, read, hist, default_value; |
924 Lisp_Object inherit_input_method; | 938 Lisp_Object inherit_input_method; |
925 { | 939 { |
926 Lisp_Object histvar, histpos, val; | 940 Lisp_Object histvar, histpos, val; |
956 UNGCPRO; | 970 UNGCPRO; |
957 return val; | 971 return val; |
958 } | 972 } |
959 | 973 |
960 DEFUN ("read-minibuffer", Fread_minibuffer, Sread_minibuffer, 1, 2, 0, | 974 DEFUN ("read-minibuffer", Fread_minibuffer, Sread_minibuffer, 1, 2, 0, |
961 doc: /* Return a Lisp object read using the minibuffer. | 975 doc: /* Return a Lisp object read using the minibuffer, unevaluated. |
962 Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS | 976 Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS |
963 is a string to insert in the minibuffer before reading. */) | 977 is a string to insert in the minibuffer before reading. |
978 \(INITIAL-CONTENTS can also be a cons of a string and an integer. Such | |
979 arguments are used as in `read-from-minibuffer') */) | |
964 (prompt, initial_contents) | 980 (prompt, initial_contents) |
965 Lisp_Object prompt, initial_contents; | 981 Lisp_Object prompt, initial_contents; |
966 { | 982 { |
967 CHECK_STRING (prompt); | 983 CHECK_STRING (prompt); |
968 return read_minibuf (Vminibuffer_local_map, initial_contents, | 984 return read_minibuf (Vminibuffer_local_map, initial_contents, |
971 } | 987 } |
972 | 988 |
973 DEFUN ("eval-minibuffer", Feval_minibuffer, Seval_minibuffer, 1, 2, 0, | 989 DEFUN ("eval-minibuffer", Feval_minibuffer, Seval_minibuffer, 1, 2, 0, |
974 doc: /* Return value of Lisp expression read using the minibuffer. | 990 doc: /* Return value of Lisp expression read using the minibuffer. |
975 Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS | 991 Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS |
976 is a string to insert in the minibuffer before reading. */) | 992 is a string to insert in the minibuffer before reading. |
993 \(INITIAL-CONTENTS can also be a cons of a string and an integer. Such | |
994 arguments are used as in `read-from-minibuffer') */) | |
977 (prompt, initial_contents) | 995 (prompt, initial_contents) |
978 Lisp_Object prompt, initial_contents; | 996 Lisp_Object prompt, initial_contents; |
979 { | 997 { |
980 return Feval (Fread_minibuffer (prompt, initial_contents)); | 998 return Feval (Fread_minibuffer (prompt, initial_contents)); |
981 } | 999 } |
983 /* Functions that use the minibuffer to read various things. */ | 1001 /* Functions that use the minibuffer to read various things. */ |
984 | 1002 |
985 DEFUN ("read-string", Fread_string, Sread_string, 1, 5, 0, | 1003 DEFUN ("read-string", Fread_string, Sread_string, 1, 5, 0, |
986 doc: /* Read a string from the minibuffer, prompting with string PROMPT. | 1004 doc: /* Read a string from the minibuffer, prompting with string PROMPT. |
987 If non-nil, second arg INITIAL-INPUT is a string to insert before reading. | 1005 If non-nil, second arg INITIAL-INPUT is a string to insert before reading. |
1006 This argument has been superseded by DEFAULT-VALUE and should normally | |
1007 be nil in new code. It behaves as in `read-from-minibuffer'. See the | |
1008 documentation string of that function for details. | |
988 The third arg HISTORY, if non-nil, specifies a history list | 1009 The third arg HISTORY, if non-nil, specifies a history list |
989 and optionally the initial position in the list. | 1010 and optionally the initial position in the list. |
990 See `read-from-minibuffer' for details of HISTORY argument. | 1011 See `read-from-minibuffer' for details of HISTORY argument. |
991 Fourth arg DEFAULT-VALUE is the default value. If non-nil, it is used | 1012 Fourth arg DEFAULT-VALUE is the default value. If non-nil, it is used |
992 for history commands, and as the value to return if the user enters | 1013 for history commands, and as the value to return if the user enters |
1006 return val; | 1027 return val; |
1007 } | 1028 } |
1008 | 1029 |
1009 DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 1, 3, 0, | 1030 DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 1, 3, 0, |
1010 doc: /* Read a string from the terminal, not allowing blanks. | 1031 doc: /* Read a string from the terminal, not allowing blanks. |
1011 Prompt with PROMPT, and provide INITIAL as an initial value of the input string. | 1032 Prompt with PROMPT. Whitespace terminates the input. If INITIAL is |
1033 non-nil, it should be a string, which is used as initial input, with | |
1034 point positioned at the end, so that SPACE will accept the input. | |
1035 \(Actually, INITIAL can also be a cons of a string and an integer. | |
1036 Such values are treated as in `read-from-minibuffer', but are normally | |
1037 not useful in this function.) | |
1012 Third arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits | 1038 Third arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits |
1013 the current input method and the setting of `enable-multibyte-characters'. */) | 1039 the current input method and the setting of`enable-multibyte-characters'. */) |
1014 (prompt, initial, inherit_input_method) | 1040 (prompt, initial, inherit_input_method) |
1015 Lisp_Object prompt, initial, inherit_input_method; | 1041 Lisp_Object prompt, initial, inherit_input_method; |
1016 { | 1042 { |
1017 CHECK_STRING (prompt); | 1043 CHECK_STRING (prompt); |
1018 return read_minibuf (Vminibuffer_local_ns_map, initial, prompt, Qnil, | 1044 return read_minibuf (Vminibuffer_local_ns_map, initial, prompt, Qnil, |
1236 if (STRINGP (eltstring) | 1262 if (STRINGP (eltstring) |
1237 && SCHARS (string) <= SCHARS (eltstring) | 1263 && SCHARS (string) <= SCHARS (eltstring) |
1238 && (tem = Fcompare_strings (eltstring, make_number (0), | 1264 && (tem = Fcompare_strings (eltstring, make_number (0), |
1239 make_number (SCHARS (string)), | 1265 make_number (SCHARS (string)), |
1240 string, make_number (0), Qnil, | 1266 string, make_number (0), Qnil, |
1241 completion_ignore_case ?Qt : Qnil), | 1267 completion_ignore_case ? Qt : Qnil), |
1242 EQ (Qt, tem))) | 1268 EQ (Qt, tem))) |
1243 { | 1269 { |
1244 /* Yes. */ | 1270 /* Yes. */ |
1245 Lisp_Object regexps; | 1271 Lisp_Object regexps; |
1246 Lisp_Object zero; | 1272 Lisp_Object zero; |
1247 XSETFASTINT (zero, 0); | 1273 XSETFASTINT (zero, 0); |
1248 | 1274 |
1249 /* Ignore this element if it fails to match all the regexps. */ | 1275 /* Ignore this element if it fails to match all the regexps. */ |
1250 for (regexps = Vcompletion_regexp_list; CONSP (regexps); | 1276 { |
1251 regexps = XCDR (regexps)) | 1277 int count = SPECPDL_INDEX (); |
1252 { | 1278 specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil); |
1253 tem = Fstring_match (XCAR (regexps), eltstring, zero); | 1279 for (regexps = Vcompletion_regexp_list; CONSP (regexps); |
1254 if (NILP (tem)) | 1280 regexps = XCDR (regexps)) |
1255 break; | 1281 { |
1256 } | 1282 tem = Fstring_match (XCAR (regexps), eltstring, zero); |
1257 if (CONSP (regexps)) | 1283 if (NILP (tem)) |
1258 continue; | 1284 break; |
1285 } | |
1286 unbind_to (count, Qnil); | |
1287 if (CONSP (regexps)) | |
1288 continue; | |
1289 } | |
1259 | 1290 |
1260 /* Ignore this element if there is a predicate | 1291 /* Ignore this element if there is a predicate |
1261 and the predicate doesn't like it. */ | 1292 and the predicate doesn't like it. */ |
1262 | 1293 |
1263 if (!NILP (predicate)) | 1294 if (!NILP (predicate)) |
1491 Lisp_Object regexps; | 1522 Lisp_Object regexps; |
1492 Lisp_Object zero; | 1523 Lisp_Object zero; |
1493 XSETFASTINT (zero, 0); | 1524 XSETFASTINT (zero, 0); |
1494 | 1525 |
1495 /* Ignore this element if it fails to match all the regexps. */ | 1526 /* Ignore this element if it fails to match all the regexps. */ |
1496 for (regexps = Vcompletion_regexp_list; CONSP (regexps); | 1527 { |
1497 regexps = XCDR (regexps)) | 1528 int count = SPECPDL_INDEX (); |
1498 { | 1529 specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil); |
1499 tem = Fstring_match (XCAR (regexps), eltstring, zero); | 1530 for (regexps = Vcompletion_regexp_list; CONSP (regexps); |
1500 if (NILP (tem)) | 1531 regexps = XCDR (regexps)) |
1501 break; | 1532 { |
1502 } | 1533 tem = Fstring_match (XCAR (regexps), eltstring, zero); |
1503 if (CONSP (regexps)) | 1534 if (NILP (tem)) |
1504 continue; | 1535 break; |
1536 } | |
1537 unbind_to (count, Qnil); | |
1538 if (CONSP (regexps)) | |
1539 continue; | |
1540 } | |
1505 | 1541 |
1506 /* Ignore this element if there is a predicate | 1542 /* Ignore this element if there is a predicate |
1507 and the predicate doesn't like it. */ | 1543 and the predicate doesn't like it. */ |
1508 | 1544 |
1509 if (!NILP (predicate)) | 1545 if (!NILP (predicate)) |
1535 Lisp_Object Vminibuffer_completing_file_name; | 1571 Lisp_Object Vminibuffer_completing_file_name; |
1536 | 1572 |
1537 DEFUN ("completing-read", Fcompleting_read, Scompleting_read, 2, 8, 0, | 1573 DEFUN ("completing-read", Fcompleting_read, Scompleting_read, 2, 8, 0, |
1538 doc: /* Read a string in the minibuffer, with completion. | 1574 doc: /* Read a string in the minibuffer, with completion. |
1539 PROMPT is a string to prompt with; normally it ends in a colon and a space. | 1575 PROMPT is a string to prompt with; normally it ends in a colon and a space. |
1540 TABLE is an alist whose elements' cars are strings, or an obarray. | 1576 TABLE can be an list of strings, an alist, an obarray or a hash table. |
1541 TABLE can also be a function to do the completion itself. | 1577 TABLE can also be a function to do the completion itself. |
1542 PREDICATE limits completion to a subset of TABLE. | 1578 PREDICATE limits completion to a subset of TABLE. |
1543 See `try-completion' and `all-completions' for more details | 1579 See `try-completion' and `all-completions' for more details |
1544 on completion, TABLE, and PREDICATE. | 1580 on completion, TABLE, and PREDICATE. |
1545 | 1581 |
1546 If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless | 1582 If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless |
1547 the input is (or completes to) an element of TABLE or is null. | 1583 the input is (or completes to) an element of TABLE or is null. |
1548 If it is also not t, typing RET does not exit if it does non-null completion. | 1584 If it is also not t, typing RET does not exit if it does non-null completion. |
1549 If the input is null, `completing-read' returns an empty string, | 1585 If the input is null, `completing-read' returns DEF, or an empty string |
1550 regardless of the value of REQUIRE-MATCH. | 1586 if DEF is nil, regardless of the value of REQUIRE-MATCH. |
1551 | 1587 |
1552 If INITIAL-INPUT is non-nil, insert it in the minibuffer initially. | 1588 If INITIAL-INPUT is non-nil, insert it in the minibuffer initially, |
1553 If it is (STRING . POSITION), the initial input | 1589 with point positioned at the end. |
1554 is STRING, but point is placed POSITION characters into the string. | 1590 If it is (STRING . POSITION), the initial input is STRING, but point |
1555 This feature is deprecated--it is best to pass nil for INITIAL-INPUT | 1591 is placed at _zero-indexed_ position POSITION in STRING. (*Note* |
1556 and supply the default value DEF instead. The user can yank the | 1592 that this is different from `read-from-minibuffer' and related |
1557 default value into the minibuffer easily using \\[next-history-element]. | 1593 functions, which use one-indexing for POSITION.) This feature is |
1558 | 1594 deprecated--it is best to pass nil for INITIAL-INPUT and supply the |
1559 HIST, if non-nil, specifies a history list | 1595 default value DEF instead. The user can yank the default value into |
1560 and optionally the initial position in the list. | 1596 the minibuffer easily using \\[next-history-element]. |
1561 It can be a symbol, which is the history list variable to use, | 1597 |
1562 or it can be a cons cell (HISTVAR . HISTPOS). | 1598 HIST, if non-nil, specifies a history list and optionally the initial |
1563 In that case, HISTVAR is the history list variable to use, | 1599 position in the list. It can be a symbol, which is the history list |
1564 and HISTPOS is the initial position (the position in the list | 1600 variable to use, or it can be a cons cell (HISTVAR . HISTPOS). In |
1565 which INITIAL-INPUT corresponds to). | 1601 that case, HISTVAR is the history list variable to use, and HISTPOS |
1566 Positions are counted starting from 1 at the beginning of the list. | 1602 is the initial position (the position in the list used by the |
1567 The variable `history-length' controls the maximum length of a | 1603 minibuffer history commands). For consistency, you should also |
1568 history list. | 1604 specify that element of the history as the value of |
1605 INITIAL-CONTENTS. (This is the only case in which you should use | |
1606 INITIAL-INPUT instead of DEF.) Positions are counted starting from | |
1607 1 at the beginning of the list. The variable `history-length' | |
1608 controls the maximum length of a history list. | |
1569 | 1609 |
1570 DEF, if non-nil, is the default value. | 1610 DEF, if non-nil, is the default value. |
1571 | 1611 |
1572 If INHERIT-INPUT-METHOD is non-nil, the minibuffer inherits | 1612 If INHERIT-INPUT-METHOD is non-nil, the minibuffer inherits |
1573 the current input method and the setting of `enable-multibyte-characters'. | 1613 the current input method and the setting of `enable-multibyte-characters'. |
1730 } | 1770 } |
1731 else | 1771 else |
1732 return call3 (alist, string, predicate, Qlambda); | 1772 return call3 (alist, string, predicate, Qlambda); |
1733 | 1773 |
1734 /* Reject this element if it fails to match all the regexps. */ | 1774 /* Reject this element if it fails to match all the regexps. */ |
1735 for (regexps = Vcompletion_regexp_list; CONSP (regexps); | 1775 { |
1736 regexps = XCDR (regexps)) | 1776 int count = SPECPDL_INDEX (); |
1737 { | 1777 specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil); |
1738 if (NILP (Fstring_match (XCAR (regexps), | 1778 for (regexps = Vcompletion_regexp_list; CONSP (regexps); |
1739 SYMBOLP (tem) ? string : tem, | 1779 regexps = XCDR (regexps)) |
1740 Qnil))) | 1780 { |
1741 return Qnil; | 1781 if (NILP (Fstring_match (XCAR (regexps), |
1742 } | 1782 SYMBOLP (tem) ? string : tem, |
1783 Qnil))) | |
1784 return unbind_to (count, Qnil); | |
1785 } | |
1786 unbind_to (count, Qnil); | |
1787 } | |
1743 | 1788 |
1744 /* Finally, check the predicate. */ | 1789 /* Finally, check the predicate. */ |
1745 if (!NILP (predicate)) | 1790 if (!NILP (predicate)) |
1746 return HASH_TABLE_P (alist) | 1791 { |
1747 ? call2 (predicate, tem, HASH_VALUE (XHASH_TABLE (alist), i)) | 1792 return HASH_TABLE_P (alist) |
1748 : call1 (predicate, tem); | 1793 ? call2 (predicate, tem, HASH_VALUE (XHASH_TABLE (alist), i)) |
1794 : call1 (predicate, tem); | |
1795 } | |
1749 else | 1796 else |
1750 return Qt; | 1797 return Qt; |
1751 } | 1798 } |
1752 | 1799 |
1753 /* returns: | 1800 /* returns: |
2205 DEFUN ("display-completion-list", Fdisplay_completion_list, Sdisplay_completion_list, | 2252 DEFUN ("display-completion-list", Fdisplay_completion_list, Sdisplay_completion_list, |
2206 1, 1, 0, | 2253 1, 1, 0, |
2207 doc: /* Display the list of completions, COMPLETIONS, using `standard-output'. | 2254 doc: /* Display the list of completions, COMPLETIONS, using `standard-output'. |
2208 Each element may be just a symbol or string | 2255 Each element may be just a symbol or string |
2209 or may be a list of two strings to be printed as if concatenated. | 2256 or may be a list of two strings to be printed as if concatenated. |
2257 If it is a list of two strings, the first is the actual completion | |
2258 alternative, the second serves as annotation. | |
2210 `standard-output' must be a buffer. | 2259 `standard-output' must be a buffer. |
2211 The actual completion alternatives, as inserted, are given `mouse-face' | 2260 The actual completion alternatives, as inserted, are given `mouse-face' |
2212 properties of `highlight'. | 2261 properties of `highlight'. |
2213 At the end, this runs the normal hook `completion-setup-hook'. | 2262 At the end, this runs the normal hook `completion-setup-hook'. |
2214 It can find the completion buffer in `standard-output'. */) | 2263 It can find the completion buffer in `standard-output'. */) |
2245 Lisp_Object startpos, endpos; | 2294 Lisp_Object startpos, endpos; |
2246 | 2295 |
2247 startpos = Qnil; | 2296 startpos = Qnil; |
2248 | 2297 |
2249 elt = Fcar (tail); | 2298 elt = Fcar (tail); |
2299 if (SYMBOLP (elt)) | |
2300 elt = SYMBOL_NAME (elt); | |
2250 /* Compute the length of this element. */ | 2301 /* Compute the length of this element. */ |
2251 if (CONSP (elt)) | 2302 if (CONSP (elt)) |
2252 { | 2303 { |
2253 tem = XCAR (elt); | 2304 tem = XCAR (elt); |
2254 CHECK_STRING (tem); | 2305 CHECK_STRING (tem); |
2556 staticpro (&Qcurrent_input_method); | 2607 staticpro (&Qcurrent_input_method); |
2557 | 2608 |
2558 Qactivate_input_method = intern ("activate-input-method"); | 2609 Qactivate_input_method = intern ("activate-input-method"); |
2559 staticpro (&Qactivate_input_method); | 2610 staticpro (&Qactivate_input_method); |
2560 | 2611 |
2612 Qcase_fold_search = intern ("case-fold-search"); | |
2613 staticpro (&Qcase_fold_search); | |
2614 | |
2561 DEFVAR_LISP ("read-buffer-function", &Vread_buffer_function, | 2615 DEFVAR_LISP ("read-buffer-function", &Vread_buffer_function, |
2562 doc: /* If this is non-nil, `read-buffer' does its work by calling this function. */); | 2616 doc: /* If this is non-nil, `read-buffer' does its work by calling this function. */); |
2563 Vread_buffer_function = Qnil; | 2617 Vread_buffer_function = Qnil; |
2564 | 2618 |
2565 DEFVAR_LISP ("minibuffer-setup-hook", &Vminibuffer_setup_hook, | 2619 DEFVAR_LISP ("minibuffer-setup-hook", &Vminibuffer_setup_hook, |
2590 This variable makes a difference whenever the minibuffer window is active. */); | 2644 This variable makes a difference whenever the minibuffer window is active. */); |
2591 enable_recursive_minibuffers = 0; | 2645 enable_recursive_minibuffers = 0; |
2592 | 2646 |
2593 DEFVAR_LISP ("minibuffer-completion-table", &Vminibuffer_completion_table, | 2647 DEFVAR_LISP ("minibuffer-completion-table", &Vminibuffer_completion_table, |
2594 doc: /* Alist or obarray used for completion in the minibuffer. | 2648 doc: /* Alist or obarray used for completion in the minibuffer. |
2595 This becomes the ALIST argument to `try-completion' and `all-completion'. | 2649 This becomes the ALIST argument to `try-completion' and `all-completions'. |
2650 The value can also be a list of strings or a hash table. | |
2596 | 2651 |
2597 The value may alternatively be a function, which is given three arguments: | 2652 The value may alternatively be a function, which is given three arguments: |
2598 STRING, the current buffer contents; | 2653 STRING, the current buffer contents; |
2599 PREDICATE, the predicate for filtering possible matches; | 2654 PREDICATE, the predicate for filtering possible matches; |
2600 CODE, which says what kind of things to do. | 2655 CODE, which says what kind of things to do. |
2637 doc: /* *Non-nil means entering the minibuffer raises the minibuffer's frame. | 2692 doc: /* *Non-nil means entering the minibuffer raises the minibuffer's frame. |
2638 Some uses of the echo area also raise that frame (since they use it too). */); | 2693 Some uses of the echo area also raise that frame (since they use it too). */); |
2639 minibuffer_auto_raise = 0; | 2694 minibuffer_auto_raise = 0; |
2640 | 2695 |
2641 DEFVAR_LISP ("completion-regexp-list", &Vcompletion_regexp_list, | 2696 DEFVAR_LISP ("completion-regexp-list", &Vcompletion_regexp_list, |
2642 doc: /* List of regexps that should restrict possible completions. */); | 2697 doc: /* List of regexps that should restrict possible completions. |
2698 The basic completion functions only consider a completion acceptable | |
2699 if it matches all regular expressions in this list, with | |
2700 `case-fold-search' bound to the value of `completion-ignore-case'. | |
2701 See Info node `(elisp)Basic Completion', for a description of these | |
2702 functions. */); | |
2643 Vcompletion_regexp_list = Qnil; | 2703 Vcompletion_regexp_list = Qnil; |
2644 | 2704 |
2645 DEFVAR_BOOL ("minibuffer-allow-text-properties", | 2705 DEFVAR_BOOL ("minibuffer-allow-text-properties", |
2646 &minibuffer_allow_text_properties, | 2706 &minibuffer_allow_text_properties, |
2647 doc: /* Non-nil means `read-from-minibuffer' should not discard text properties. | 2707 doc: /* Non-nil means `read-from-minibuffer' should not discard text properties. |