From: Richard M. Stallman Date: Thu, 30 Dec 1993 07:23:51 +0000 (+0000) Subject: (Fall_completions): Allow completions that start with space X-Git-Tag: emacs-19.34~10482 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2cbaf88681b857aac11af4a654eb256b52a2a285;p=emacs.git (Fall_completions): Allow completions that start with space if the input starts with space. --- diff --git a/src/minibuf.c b/src/minibuf.c index cbf6970bdbd..82d48a47015 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -824,11 +824,14 @@ The argument given to PREDICATE is the alist element or the symbol from the obar /* Is this element a possible completion? */ - if (XTYPE (eltstring) == Lisp_String && - XSTRING (string)->size <= XSTRING (eltstring)->size && - XSTRING (eltstring)->data[0] != ' ' && - 0 > scmp (XSTRING (eltstring)->data, XSTRING (string)->data, - XSTRING (string)->size)) + if (XTYPE (eltstring) == Lisp_String + && XSTRING (string)->size <= XSTRING (eltstring)->size + /* Reject alternatives that start with space + unless the input starts with space. */ + && ((XSTRING (string)->size > 0 && XSTRING (string)->data[0] == ' ') + || XSTRING (eltstring)->data[0] != ' ') + && 0 > scmp (XSTRING (eltstring)->data, XSTRING (string)->data, + XSTRING (string)->size)) { /* Yes. */ /* Ignore this element if there is a predicate