aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-12-15 14:00:55 +0000
committerRichard M. Stallman1994-12-15 14:00:55 +0000
commit89a255dc29fc9e8d907ba16e91d8453a469f36b8 (patch)
treee4fcf729490cc46cd2484883b0cc0c20eeddc829 /src
parent1702afef39488e54d8f7fba0ad009095bfc703d2 (diff)
downloademacs-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.c25
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\
603If optional third argument PREDICATE is non-nil,\n\ 603If optional third argument PREDICATE is non-nil,\n\
604it is used to test each possible match.\n\ 604it is used to test each possible match.\n\
605The match is a candidate only if PREDICATE returns non-nil.\n\ 605The match is a candidate only if PREDICATE returns non-nil.\n\
606The argument given to PREDICATE is the alist element or the symbol from the obarray.") 606The argument given to PREDICATE is the alist element\n\
607or 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
799DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 3, 0, 800DEFUN ("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\
801Each car of each element of ALIST is tested to see if it begins with STRING.\n\ 802Each car of each element of ALIST is tested to see if it begins with STRING.\n\
802The value is a list of all the strings from ALIST that match.\n\ 803The value is a list of all the strings from ALIST that match.\n\
804\n\
803ALIST can be an obarray instead of an alist.\n\ 805ALIST can be an obarray instead of an alist.\n\
804Then the print names of all symbols in the obarray are the possible matches.\n\ 806Then 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\
810If optional third argument PREDICATE is non-nil,\n\ 812If optional third argument PREDICATE is non-nil,\n\
811it is used to test each possible match.\n\ 813it is used to test each possible match.\n\
812The match is a candidate only if PREDICATE returns non-nil.\n\ 814The match is a candidate only if PREDICATE returns non-nil.\n\
813The argument given to PREDICATE is the alist element or the symbol from the obarray.") 815The argument given to PREDICATE is the alist element\n\
814 (string, alist, pred) 816or the symbol from the obarray.\n\
815 Lisp_Object string, alist, pred; 817\n\
818If the optional fourth argument HIDE-SPACES is non-nil,\n\
819strings in ALIST that start with a space\n\
820are 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))