Mercurial > emacs
comparison lisp/files.el @ 71848:067fc0d0be7e
(locate-file-completion): Avoid duplicates in result.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 12 Jul 2006 15:57:07 +0000 |
parents | 5a4a7b32f980 |
children | 873f1ea95cc4 b19aaf4ab0ee |
comparison
equal
deleted
inserted
replaced
71847:61f3d6be1e92 | 71848:067fc0d0be7e |
---|---|
689 (setq dir default-directory)) | 689 (setq dir default-directory)) |
690 (if string-dir (setq dir (expand-file-name string-dir dir))) | 690 (if string-dir (setq dir (expand-file-name string-dir dir))) |
691 (when (file-directory-p dir) | 691 (when (file-directory-p dir) |
692 (dolist (file (file-name-all-completions | 692 (dolist (file (file-name-all-completions |
693 (file-name-nondirectory string) dir)) | 693 (file-name-nondirectory string) dir)) |
694 (push (if string-dir (concat string-dir file) file) names) | 694 (add-to-list 'names (if string-dir (concat string-dir file) file)) |
695 (when (string-match suffix file) | 695 (when (string-match suffix file) |
696 (setq file (substring file 0 (match-beginning 0))) | 696 (setq file (substring file 0 (match-beginning 0))) |
697 (push (if string-dir (concat string-dir file) file) names))))) | 697 (push (if string-dir (concat string-dir file) file) names))))) |
698 (cond | 698 (cond |
699 ((eq action t) (all-completions string names)) | 699 ((eq action t) (all-completions string names)) |