diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2005-12-29 04:41:02 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2005-12-29 04:41:02 +0000 |
commit | e583523a108624f7fd0c28294010b19daae5ab97 (patch) | |
tree | 6bbb60c1f603809ca8980a459e0c4ed6d2c02378 /src/minibuf.c | |
parent | da8e8fc14f3166ec596e34f43fbfea866d1176df (diff) | |
parent | d52c26e925297a2d1663e2293d46ce95e91c4689 (diff) | |
download | emacs-e583523a108624f7fd0c28294010b19daae5ab97.tar.gz |
Merged from miles@gnu.org--gnu-2005 (patch 678-680)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-678
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-679
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-680
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-468
Diffstat (limited to 'src/minibuf.c')
-rw-r--r-- | src/minibuf.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index 8cc014f84ee..af7fa60aba4 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -2410,7 +2410,7 @@ during running `completion-setup-hook'. */) else { write_string ("Possible completions are:", -1); - for (tail = completions, i = 0; !NILP (tail); tail = Fcdr (tail), i++) + for (tail = completions, i = 0; CONSP (tail); tail = XCDR (tail), i++) { Lisp_Object tem, string; int length; @@ -2418,7 +2418,7 @@ during running `completion-setup-hook'. */) startpos = Qnil; - elt = Fcar (tail); + elt = XCAR (tail); if (SYMBOLP (elt)) elt = SYMBOL_NAME (elt); /* Compute the length of this element. */ @@ -2594,9 +2594,21 @@ DEFUN ("minibuffer-completion-help", Fminibuffer_completion_help, Sminibuffer_co temp_echo_area_glyphs (build_string (" [No completions]")); } else - internal_with_output_to_temp_buffer ("*Completions*", - display_completion_list_1, - Fsort (completions, Qstring_lessp)); + { + /* Sort and remove duplicates. */ + Lisp_Object tmp = completions = Fsort (completions, Qstring_lessp); + while (CONSP (tmp)) + { + if (CONSP (XCDR (tmp)) + && !NILP (Fequal (XCAR (tmp), XCAR (XCDR (tmp))))) + XSETCDR (tmp, XCDR (XCDR (tmp))); + else + tmp = XCDR (tmp); + } + internal_with_output_to_temp_buffer ("*Completions*", + display_completion_list_1, + completions); + } return Qnil; } |