Mercurial > hg > xemacs-beta
comparison src/minibuf.c @ 4704:44c9d1005ce2
Bring `try-completion''s interface closer to GNU Emacs.
2009-09-29 Mike Sperber <mike@xemacs.org>
* minibuf.c (Ftry_completion): If the collection is a list, allow
plain elements instead of cons cells. (As in GNU Emacs.)
author | Mike Sperber <sperber@deinprogramm.de> |
---|---|
date | Wed, 30 Sep 2009 21:15:04 +0200 |
parents | ecf1ebac70d8 |
children | 6ef8256a020a 19a72041c5ed |
comparison
equal
deleted
inserted
replaced
4703:6dfca4f26f53 | 4704:44c9d1005ce2 |
---|---|
308 Each string in COLLECTION is tested to see if it begins with STRING. | 308 Each string in COLLECTION is tested to see if it begins with STRING. |
309 All that match are compared together; the longest initial sequence | 309 All that match are compared together; the longest initial sequence |
310 common to all matches is returned as a string. If there is no match | 310 common to all matches is returned as a string. If there is no match |
311 at all, nil is returned. For an exact match, t is returned. | 311 at all, nil is returned. For an exact match, t is returned. |
312 | 312 |
313 If COLLECTION is an alist, the cars of the elements of the alist | 313 If COLLECTION is list, the elements of the list that are not cons |
314 \(which must be strings) form the set of possible completions. | 314 cells and the cars of the elements of the list that are cons cells |
315 (which must be strings) form the set of possible completions. | |
315 | 316 |
316 If COLLECTION is an obarray, the names of all symbols in the obarray | 317 If COLLECTION is an obarray, the names of all symbols in the obarray |
317 are the possible completions. | 318 are the possible completions. |
318 | 319 |
319 If COLLECTION is a function, it is called with three arguments: the | 320 If COLLECTION is a function, it is called with three arguments: the |
383 if (list) | 384 if (list) |
384 { | 385 { |
385 if (NILP (tail)) | 386 if (NILP (tail)) |
386 break; | 387 break; |
387 elt = Fcar (tail); | 388 elt = Fcar (tail); |
388 eltstring = Fcar (elt); | 389 if (CONSP (elt)) |
390 eltstring = Fcar (elt); | |
391 else | |
392 eltstring = elt; | |
389 tail = Fcdr (tail); | 393 tail = Fcdr (tail); |
390 } | 394 } |
391 else | 395 else |
392 { | 396 { |
393 if (!ZEROP (bucket)) | 397 if (!ZEROP (bucket)) |