aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2004-12-12 18:15:22 +0000
committerRichard M. Stallman2004-12-12 18:15:22 +0000
commitc8ae863bab35409270842cc464911633c0c9dcfa (patch)
treebba1a40d6145a35c43c4fadeeb6374707fba789d /src
parentd6d31e570aa7a97eb2869922e895f5aedbefe7f3 (diff)
downloademacs-c8ae863bab35409270842cc464911633c0c9dcfa.tar.gz
emacs-c8ae863bab35409270842cc464911633c0c9dcfa.zip
(Fall_completions): Add var `zero' and use it in loop.
(Ftry_completion): Really use outer `zero'; eliminate inner one.
Diffstat (limited to 'src')
-rw-r--r--src/minibuf.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index d9fec427ec4..a6b44ad4c62 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1227,6 +1227,7 @@ is used to further constrain the set of candidates. */)
1227 return call3 (alist, string, predicate, Qnil); 1227 return call3 (alist, string, predicate, Qnil);
1228 1228
1229 bestmatch = bucket = Qnil; 1229 bestmatch = bucket = Qnil;
1230 zero = make_number (0);
1230 1231
1231 /* If ALIST is not a list, set TAIL just for gc pro. */ 1232 /* If ALIST is not a list, set TAIL just for gc pro. */
1232 tail = alist; 1233 tail = alist;
@@ -1253,7 +1254,7 @@ is used to further constrain the set of candidates. */)
1253 } 1254 }
1254 else if (type == 2) 1255 else if (type == 2)
1255 { 1256 {
1256 if (!EQ (bucket, make_number (0))) 1257 if (!EQ (bucket, zero))
1257 { 1258 {
1258 elt = bucket; 1259 elt = bucket;
1259 eltstring = Fsymbol_name (elt); 1260 eltstring = Fsymbol_name (elt);
@@ -1285,16 +1286,14 @@ is used to further constrain the set of candidates. */)
1285 1286
1286 if (STRINGP (eltstring) 1287 if (STRINGP (eltstring)
1287 && SCHARS (string) <= SCHARS (eltstring) 1288 && SCHARS (string) <= SCHARS (eltstring)
1288 && (tem = Fcompare_strings (eltstring, make_number (0), 1289 && (tem = Fcompare_strings (eltstring, zero,
1289 make_number (SCHARS (string)), 1290 make_number (SCHARS (string)),
1290 string, make_number (0), Qnil, 1291 string, zero, Qnil,
1291 completion_ignore_case ? Qt : Qnil), 1292 completion_ignore_case ? Qt : Qnil),
1292 EQ (Qt, tem))) 1293 EQ (Qt, tem)))
1293 { 1294 {
1294 /* Yes. */ 1295 /* Yes. */
1295 Lisp_Object regexps; 1296 Lisp_Object regexps;
1296 Lisp_Object zero;
1297 XSETFASTINT (zero, 0);
1298 1297
1299 /* Ignore this element if it fails to match all the regexps. */ 1298 /* Ignore this element if it fails to match all the regexps. */
1300 { 1299 {
@@ -1348,9 +1347,9 @@ is used to further constrain the set of candidates. */)
1348 else 1347 else
1349 { 1348 {
1350 compare = min (bestmatchsize, SCHARS (eltstring)); 1349 compare = min (bestmatchsize, SCHARS (eltstring));
1351 tem = Fcompare_strings (bestmatch, make_number (0), 1350 tem = Fcompare_strings (bestmatch, zero,
1352 make_number (compare), 1351 make_number (compare),
1353 eltstring, make_number (0), 1352 eltstring, zero,
1354 make_number (compare), 1353 make_number (compare),
1355 completion_ignore_case ? Qt : Qnil); 1354 completion_ignore_case ? Qt : Qnil);
1356 if (EQ (tem, Qt)) 1355 if (EQ (tem, Qt))
@@ -1381,15 +1380,15 @@ is used to further constrain the set of candidates. */)
1381 ((matchsize == SCHARS (eltstring)) 1380 ((matchsize == SCHARS (eltstring))
1382 == 1381 ==
1383 (matchsize == SCHARS (bestmatch)) 1382 (matchsize == SCHARS (bestmatch))
1384 && (tem = Fcompare_strings (eltstring, make_number (0), 1383 && (tem = Fcompare_strings (eltstring, zero,
1385 make_number (SCHARS (string)), 1384 make_number (SCHARS (string)),
1386 string, make_number (0), 1385 string, zero,
1387 Qnil, 1386 Qnil,
1388 Qnil), 1387 Qnil),
1389 EQ (Qt, tem)) 1388 EQ (Qt, tem))
1390 && (tem = Fcompare_strings (bestmatch, make_number (0), 1389 && (tem = Fcompare_strings (bestmatch, zero,
1391 make_number (SCHARS (string)), 1390 make_number (SCHARS (string)),
1392 string, make_number (0), 1391 string, zero,
1393 Qnil, 1392 Qnil,
1394 Qnil), 1393 Qnil),
1395 ! EQ (Qt, tem)))) 1394 ! EQ (Qt, tem))))
@@ -1476,13 +1475,14 @@ are ignored unless STRING itself starts with a space. */)
1476 || NILP (XCAR (alist)))); 1475 || NILP (XCAR (alist))));
1477 int index = 0, obsize = 0; 1476 int index = 0, obsize = 0;
1478 int bindcount = -1; 1477 int bindcount = -1;
1479 Lisp_Object bucket, tem; 1478 Lisp_Object bucket, tem, zero;
1480 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 1479 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
1481 1480
1482 CHECK_STRING (string); 1481 CHECK_STRING (string);
1483 if (type == 0) 1482 if (type == 0)
1484 return call3 (alist, string, predicate, Qt); 1483 return call3 (alist, string, predicate, Qt);
1485 allmatches = bucket = Qnil; 1484 allmatches = bucket = Qnil;
1485 zero = make_number (0);
1486 1486
1487 /* If ALIST is not a list, set TAIL just for gc pro. */ 1487 /* If ALIST is not a list, set TAIL just for gc pro. */
1488 tail = alist; 1488 tail = alist;
@@ -1509,7 +1509,7 @@ are ignored unless STRING itself starts with a space. */)
1509 } 1509 }
1510 else if (type == 2) 1510 else if (type == 2)
1511 { 1511 {
1512 if (!EQ (bucket, make_number (0))) 1512 if (!EQ (bucket, zero))
1513 { 1513 {
1514 elt = bucket; 1514 elt = bucket;
1515 eltstring = Fsymbol_name (elt); 1515 eltstring = Fsymbol_name (elt);
@@ -1547,9 +1547,9 @@ are ignored unless STRING itself starts with a space. */)
1547 && SREF (string, 0) == ' ') 1547 && SREF (string, 0) == ' ')
1548 || SREF (eltstring, 0) != ' ' 1548 || SREF (eltstring, 0) != ' '
1549 || NILP (hide_spaces)) 1549 || NILP (hide_spaces))
1550 && (tem = Fcompare_strings (eltstring, make_number (0), 1550 && (tem = Fcompare_strings (eltstring, zero,
1551 make_number (SCHARS (string)), 1551 make_number (SCHARS (string)),
1552 string, make_number (0), 1552 string, zero,
1553 make_number (SCHARS (string)), 1553 make_number (SCHARS (string)),
1554 completion_ignore_case ? Qt : Qnil), 1554 completion_ignore_case ? Qt : Qnil),
1555 EQ (Qt, tem))) 1555 EQ (Qt, tem)))