From 2cbaf88681b857aac11af4a654eb256b52a2a285 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 30 Dec 1993 07:23:51 +0000 Subject: [PATCH] (Fall_completions): Allow completions that start with space if the input starts with space. --- src/minibuf.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 -- 2.39.5