changeset 10173:6a4f5fc9d3f9

(Fall_completions): New arg hide_spaces. (Fminibuffer_completion_help): Pass new arg.
author Richard M. Stallman <rms@gnu.org>
date Thu, 15 Dec 1994 14:00:55 +0000
parents 9a91efe65b85
children e48de3882616
files src/minibuf.c
diffstat 1 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/minibuf.c	Thu Dec 15 13:56:57 1994 +0000
+++ b/src/minibuf.c	Thu Dec 15 14:00:55 1994 +0000
@@ -603,7 +603,8 @@
 If optional third argument PREDICATE is non-nil,\n\
 it is used to test each possible match.\n\
 The match is a candidate only if PREDICATE returns non-nil.\n\
-The argument given to PREDICATE is the alist element or the symbol from the obarray.")
+The argument given to PREDICATE is the alist element\n\
+or the symbol from the obarray.")
   (string, alist, pred)
      Lisp_Object string, alist, pred;
 {
@@ -796,10 +797,11 @@
     return len - l;
 }
 
-DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 3, 0,
+DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 4, 0,
   "Search for partial matches to STRING in ALIST.\n\
 Each car of each element of ALIST is tested to see if it begins with STRING.\n\
 The value is a list of all the strings from ALIST that match.\n\
+\n\
 ALIST can be an obarray instead of an alist.\n\
 Then the print names of all symbols in the obarray are the possible matches.\n\
 \n\
@@ -810,9 +812,14 @@
 If optional third argument PREDICATE is non-nil,\n\
 it is used to test each possible match.\n\
 The match is a candidate only if PREDICATE returns non-nil.\n\
-The argument given to PREDICATE is the alist element or the symbol from the obarray.")
-  (string, alist, pred)
-     Lisp_Object string, alist, pred;
+The argument given to PREDICATE is the alist element\n\
+or the symbol from the obarray.\n\
+\n\
+If the optional fourth argument HIDE-SPACES is non-nil,\n\
+strings in ALIST that start with a space\n\
+are ignored unless STRING itself starts with a space.")
+  (string, alist, pred, hide_spaces)
+     Lisp_Object string, alist, pred, hide_spaces;
 {
   Lisp_Object tail, elt, eltstring;
   Lisp_Object allmatches;
@@ -876,10 +883,11 @@
 
       if (STRINGP (eltstring)
 	  && XSTRING (string)->size <= XSTRING (eltstring)->size
-	  /* Reject alternatives that start with space
+	  /* If HIDE_SPACES, reject alternatives that start with space
 	     unless the input starts with space.  */
 	  && ((XSTRING (string)->size > 0 && XSTRING (string)->data[0] == ' ')
-	      || XSTRING (eltstring)->data[0] != ' ')
+	      || XSTRING (eltstring)->data[0] != ' '
+	      || NILP (hide_spaces))
 	  && 0 > scmp (XSTRING (eltstring)->data, XSTRING (string)->data,
 		       XSTRING (string)->size))
 	{
@@ -1572,7 +1580,8 @@
   message ("Making completion list...");
   completions = Fall_completions (Fbuffer_string (),
 				  Vminibuffer_completion_table,
-				  Vminibuffer_completion_predicate);
+				  Vminibuffer_completion_predicate,
+				  Qt);
   echo_area_glyphs = 0;
 
   if (NILP (completions))