diff options
| author | Richard M. Stallman | 1994-12-15 14:00:55 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-12-15 14:00:55 +0000 |
| commit | 89a255dc29fc9e8d907ba16e91d8453a469f36b8 (patch) | |
| tree | e4fcf729490cc46cd2484883b0cc0c20eeddc829 /src | |
| parent | 1702afef39488e54d8f7fba0ad009095bfc703d2 (diff) | |
| download | emacs-89a255dc29fc9e8d907ba16e91d8453a469f36b8.tar.gz emacs-89a255dc29fc9e8d907ba16e91d8453a469f36b8.zip | |
(Fall_completions): New arg hide_spaces.
(Fminibuffer_completion_help): Pass new arg.
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index b9b7407987c..fe6686525ce 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -603,7 +603,8 @@ Whatever it returns becomes the value of `try-completion'.\n\ | |||
| 603 | If optional third argument PREDICATE is non-nil,\n\ | 603 | If optional third argument PREDICATE is non-nil,\n\ |
| 604 | it is used to test each possible match.\n\ | 604 | it is used to test each possible match.\n\ |
| 605 | The match is a candidate only if PREDICATE returns non-nil.\n\ | 605 | The match is a candidate only if PREDICATE returns non-nil.\n\ |
| 606 | The argument given to PREDICATE is the alist element or the symbol from the obarray.") | 606 | The argument given to PREDICATE is the alist element\n\ |
| 607 | or the symbol from the obarray.") | ||
| 607 | (string, alist, pred) | 608 | (string, alist, pred) |
| 608 | Lisp_Object string, alist, pred; | 609 | Lisp_Object string, alist, pred; |
| 609 | { | 610 | { |
| @@ -796,10 +797,11 @@ scmp (s1, s2, len) | |||
| 796 | return len - l; | 797 | return len - l; |
| 797 | } | 798 | } |
| 798 | 799 | ||
| 799 | DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 3, 0, | 800 | DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 4, 0, |
| 800 | "Search for partial matches to STRING in ALIST.\n\ | 801 | "Search for partial matches to STRING in ALIST.\n\ |
| 801 | Each car of each element of ALIST is tested to see if it begins with STRING.\n\ | 802 | Each car of each element of ALIST is tested to see if it begins with STRING.\n\ |
| 802 | The value is a list of all the strings from ALIST that match.\n\ | 803 | The value is a list of all the strings from ALIST that match.\n\ |
| 804 | \n\ | ||
| 803 | ALIST can be an obarray instead of an alist.\n\ | 805 | ALIST can be an obarray instead of an alist.\n\ |
| 804 | Then the print names of all symbols in the obarray are the possible matches.\n\ | 806 | Then the print names of all symbols in the obarray are the possible matches.\n\ |
| 805 | \n\ | 807 | \n\ |
| @@ -810,9 +812,14 @@ Whatever it returns becomes the value of `all-completion'.\n\ | |||
| 810 | If optional third argument PREDICATE is non-nil,\n\ | 812 | If optional third argument PREDICATE is non-nil,\n\ |
| 811 | it is used to test each possible match.\n\ | 813 | it is used to test each possible match.\n\ |
| 812 | The match is a candidate only if PREDICATE returns non-nil.\n\ | 814 | The match is a candidate only if PREDICATE returns non-nil.\n\ |
| 813 | The argument given to PREDICATE is the alist element or the symbol from the obarray.") | 815 | The argument given to PREDICATE is the alist element\n\ |
| 814 | (string, alist, pred) | 816 | or the symbol from the obarray.\n\ |
| 815 | Lisp_Object string, alist, pred; | 817 | \n\ |
| 818 | If the optional fourth argument HIDE-SPACES is non-nil,\n\ | ||
| 819 | strings in ALIST that start with a space\n\ | ||
| 820 | are ignored unless STRING itself starts with a space.") | ||
| 821 | (string, alist, pred, hide_spaces) | ||
| 822 | Lisp_Object string, alist, pred, hide_spaces; | ||
| 816 | { | 823 | { |
| 817 | Lisp_Object tail, elt, eltstring; | 824 | Lisp_Object tail, elt, eltstring; |
| 818 | Lisp_Object allmatches; | 825 | Lisp_Object allmatches; |
| @@ -876,10 +883,11 @@ The argument given to PREDICATE is the alist element or the symbol from the obar | |||
| 876 | 883 | ||
| 877 | if (STRINGP (eltstring) | 884 | if (STRINGP (eltstring) |
| 878 | && XSTRING (string)->size <= XSTRING (eltstring)->size | 885 | && XSTRING (string)->size <= XSTRING (eltstring)->size |
| 879 | /* Reject alternatives that start with space | 886 | /* If HIDE_SPACES, reject alternatives that start with space |
| 880 | unless the input starts with space. */ | 887 | unless the input starts with space. */ |
| 881 | && ((XSTRING (string)->size > 0 && XSTRING (string)->data[0] == ' ') | 888 | && ((XSTRING (string)->size > 0 && XSTRING (string)->data[0] == ' ') |
| 882 | || XSTRING (eltstring)->data[0] != ' ') | 889 | || XSTRING (eltstring)->data[0] != ' ' |
| 890 | || NILP (hide_spaces)) | ||
| 883 | && 0 > scmp (XSTRING (eltstring)->data, XSTRING (string)->data, | 891 | && 0 > scmp (XSTRING (eltstring)->data, XSTRING (string)->data, |
| 884 | XSTRING (string)->size)) | 892 | XSTRING (string)->size)) |
| 885 | { | 893 | { |
| @@ -1572,7 +1580,8 @@ DEFUN ("minibuffer-completion-help", Fminibuffer_completion_help, Sminibuffer_co | |||
| 1572 | message ("Making completion list..."); | 1580 | message ("Making completion list..."); |
| 1573 | completions = Fall_completions (Fbuffer_string (), | 1581 | completions = Fall_completions (Fbuffer_string (), |
| 1574 | Vminibuffer_completion_table, | 1582 | Vminibuffer_completion_table, |
| 1575 | Vminibuffer_completion_predicate); | 1583 | Vminibuffer_completion_predicate, |
| 1584 | Qt); | ||
| 1576 | echo_area_glyphs = 0; | 1585 | echo_area_glyphs = 0; |
| 1577 | 1586 | ||
| 1578 | if (NILP (completions)) | 1587 | if (NILP (completions)) |