comparison src/minibuf.c @ 272:c5d627a313b1 r21-0b34

Import from CVS: tag r21-0b34
author cvs
date Mon, 13 Aug 2007 10:28:48 +0200
parents 966663fcf606
children 8626e4521993
comparison
equal deleted inserted replaced
271:c7b7086b0a39 272:c5d627a313b1
349 else 349 else
350 return call3 (alist, string, pred, Qnil); 350 return call3 (alist, string, pred, Qnil);
351 351
352 bestmatch = Qnil; 352 bestmatch = Qnil;
353 blength = 0; 353 blength = 0;
354 slength = string_char_length (XSTRING (string)); 354 slength = XSTRING_CHAR_LENGTH (string);
355 355
356 /* If ALIST is not a list, set TAIL just for gc pro. */ 356 /* If ALIST is not a list, set TAIL just for gc pro. */
357 tail = alist; 357 tail = alist;
358 if (!list) 358 if (!list)
359 { 359 {
412 412
413 /* Is this element a possible completion? */ 413 /* Is this element a possible completion? */
414 414
415 if (STRINGP (eltstring)) 415 if (STRINGP (eltstring))
416 { 416 {
417 Charcount eltlength = string_char_length (XSTRING (eltstring)); 417 Charcount eltlength = XSTRING_CHAR_LENGTH (eltstring);
418 if (slength <= eltlength 418 if (slength <= eltlength
419 && (0 > scmp (XSTRING_DATA (eltstring), 419 && (0 > scmp (XSTRING_DATA (eltstring),
420 XSTRING_DATA (string), 420 XSTRING_DATA (string),
421 slength))) 421 slength)))
422 { 422 {
552 list = 1; 552 list = 1;
553 else 553 else
554 return call3 (alist, string, pred, Qt); 554 return call3 (alist, string, pred, Qt);
555 555
556 allmatches = Qnil; 556 allmatches = Qnil;
557 slength = string_char_length (XSTRING (string)); 557 slength = XSTRING_CHAR_LENGTH (string);
558 558
559 /* If ALIST is not a list, set TAIL just for gc pro. */ 559 /* If ALIST is not a list, set TAIL just for gc pro. */
560 tail = alist; 560 tail = alist;
561 if (!list) 561 if (!list)
562 { 562 {
608 } 608 }
609 609
610 /* Is this element a possible completion? */ 610 /* Is this element a possible completion? */
611 611
612 if (STRINGP (eltstring) 612 if (STRINGP (eltstring)
613 && (slength <= string_char_length (XSTRING (eltstring))) 613 && (slength <= XSTRING_CHAR_LENGTH (eltstring))
614 /* Reject alternatives that start with space 614 /* Reject alternatives that start with space
615 unless the input starts with space. */ 615 unless the input starts with space. */
616 && ((string_char_length (XSTRING (string)) > 0 && 616 && ((XSTRING_CHAR_LENGTH (string) > 0 &&
617 string_char (XSTRING (string), 0) == ' ') 617 string_char (XSTRING (string), 0) == ' ')
618 || string_char (XSTRING (eltstring), 0) != ' ') 618 || string_char (XSTRING (eltstring), 0) != ' ')
619 && (0 > scmp (XSTRING_DATA (eltstring), 619 && (0 > scmp (XSTRING_DATA (eltstring),
620 XSTRING_DATA (string), 620 XSTRING_DATA (string),
621 slength))) 621 slength)))