;; Stores the current ido item type ('file, 'dir, 'buffer, or 'list).
(defvar ido-cur-item)
+;;; Stores the current default item
+(defvar ido-default-item)
+
;; Stores the current list of items that will be searched through.
;; The list is ordered, so that the most interesting item comes first,
;; although by default, the files visible in the current frame are put
(string-match re name))
(cond
((and (eq ido-cur-item 'buffer)
+ (or (not (stringp ido-default-item))
+ (not (string= name ido-default-item)))
(string= name (buffer-name ido-entry-buffer)))
(setq matches (cons item matches)))
((and full-re (string-match full-re name))