diff options
author | Leo Liu <sdl.web@gmail.com> | 2013-05-17 10:43:41 +0800 |
---|---|---|
committer | Leo Liu <sdl.web@gmail.com> | 2013-05-17 10:43:41 +0800 |
commit | c7a8fcacf99548e19b4efcf6900abc66c1de3a9d (patch) | |
tree | 64b94a2652784a8e938b7e8013df6d72d3a4a3cf /lisp/ido.el | |
parent | f678b18a19e3c8050acfde90523b1542e4537053 (diff) | |
download | emacs-c7a8fcacf99548e19b4efcf6900abc66c1de3a9d.tar.gz emacs-c7a8fcacf99548e19b4efcf6900abc66c1de3a9d.tar.bz2 emacs-c7a8fcacf99548e19b4efcf6900abc66c1de3a9d.zip |
* subr.el (delete-consecutive-dups): New function.
* ido.el (ido-set-matches-1): Use it.
* progmodes/octave.el (inferior-octave-completion-table): Use it.
* ido.el (ido-remove-consecutive-dups): Remove.
Diffstat (limited to 'lisp/ido.el')
-rw-r--r-- | lisp/ido.el | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index 297e3258338..8087124765c 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -3785,7 +3785,7 @@ This is to make them appear as if they were \"virtual buffers\"." (if (string-match re name) (setq matches (cons item matches))))) items)) - matches)) + (delete-consecutive-dups matches t))) (defun ido-set-matches () @@ -4676,21 +4676,6 @@ For details of keybindings, see `ido-find-file'." ido-temp-list)))) (ido-to-end summaries))) -(defun ido-remove-consecutive-dups (list) - "Remove consecutive duplicates in LIST. -Use `equal' for comparison. First and last elements are -considered consecutive." - (let ((tail list) - (last (make-symbol "")) - (result nil)) - (while (consp tail) - (unless (equal (car tail) last) - (push (setq last (car tail)) result)) - (setq tail (cdr tail))) - (nreverse (or (and (equal last (car list)) - (cdr result)) - result)))) - ;;; Helper functions for other programs (put 'dired-do-rename 'ido 'ignore) @@ -4808,7 +4793,7 @@ DEF, if non-nil, is the default value." (ido-directory-nonreadable nil) (ido-directory-too-big nil) (ido-context-switch-command 'ignore) - (ido-choice-list (ido-remove-consecutive-dups choices))) + (ido-choice-list choices)) ;; Initialize ido before invoking ido-read-internal (ido-common-initialization) (ido-read-internal 'list prompt hist def require-match initial-input))) |