*** lisp/ido.el.~1.110.~ 2006-10-16 14:42:24.000000000 +0200 --- lisp/ido.el 2006-11-27 17:54:36.000000000 +0100 *************** *** 1142,1147 **** --- 1142,1152 ---- (pop-to-buffer b t t) (setq truncate-lines t))))) + (defun ido-local-file-exists-p (file) + "Tell if FILE exists locally." + (let (file-name-handler-alist) + (file-exists-p file))) + (defun ido-unc-hosts (&optional query) "Return list of UNC host names." (let ((hosts *************** *** 2068,2074 **** (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1)))) (setq ido-set-default-item t)) ! ((and (string-match (if ido-enable-tramp-completion "..[:@]\\'" "..:\\'") ido-selected) (ido-is-root-directory)) ;; Ange-ftp or Tramp (ido-set-current-directory ido-current-directory ido-selected) (ido-trace "tramp prefix" ido-selected) --- 2073,2080 ---- (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1)))) (setq ido-set-default-item t)) ! ((and (not (ido-local-file-exists-p ido-selected)) ! (string-match (if ido-enable-tramp-completion ".[:@]\\'" ".:\\'") ido-selected) (ido-is-root-directory)) ;; Ange-ftp or Tramp (ido-set-current-directory ido-current-directory ido-selected) (ido-trace "tramp prefix" ido-selected) *************** *** 2426,2432 **** ((and (= 1 (length ido-matches)) (not (and ido-enable-tramp-completion (string-equal ido-current-directory "/") ! (string-match "..[@:]\\'" (ido-name (car ido-matches)))))) ;; only one choice, so select it. (if (not ido-confirm-unique-completion) (exit-minibuffer) --- 2432,2439 ---- ((and (= 1 (length ido-matches)) (not (and ido-enable-tramp-completion (string-equal ido-current-directory "/") ! (not (ido-local-file-exists-p (ido-name (car ido-matches)))) ! (string-match ".[@:]\\'" (ido-name (car ido-matches)))))) ;; only one choice, so select it. (if (not ido-confirm-unique-completion) (exit-minibuffer) *************** *** 3433,3441 **** (let ((default-directory ido-current-directory)) (ido-to-end ;; move ftp hosts and visited files to end (delq nil (mapcar ! (lambda (x) (if (or (string-match "..:\\'" x) (and (not (ido-final-slash x)) ! (get-file-buffer x))) x)) ido-temp-list))))) (ido-to-end ;; move . files to end (delq nil (mapcar --- 3440,3450 ---- (let ((default-directory ido-current-directory)) (ido-to-end ;; move ftp hosts and visited files to end (delq nil (mapcar ! (lambda (x) (if (or (and (not (ido-local-file-exists-p x)) ! (string-match ".:\\'" x)) (and (not (ido-final-slash x)) ! (let (file-name-handler-alist) ! (get-file-buffer x)))) x)) ido-temp-list))))) (ido-to-end ;; move . files to end (delq nil (mapcar *************** *** 4149,4155 **** (setq refresh t)) )) ! ((and (string-match (if ido-enable-tramp-completion "..[:@]\\'" "..:\\'") contents) (ido-is-root-directory)) ;; Ange-ftp or tramp (ido-set-current-directory ido-current-directory contents) (when (ido-is-slow-ftp-host) --- 4158,4165 ---- (setq refresh t)) )) ! ((and (not (ido-local-file-exists-p contents)) ! (string-match (if ido-enable-tramp-completion ".[:@]\\'" ".:\\'") contents) (ido-is-root-directory)) ;; Ange-ftp or tramp (ido-set-current-directory ido-current-directory contents) (when (ido-is-slow-ftp-host) *** lisp/ChangeLog.~1.10261.~ 2006-11-06 15:42:02.000000000 +0100 --- lisp/ChangeLog 2006-11-27 17:58:48.000000000 +0100 *************** *** 0 **** --- 1,8 ---- + 2006-11-27 Michaƫl Cadilhac + + * ido.el (ido-local-file-exists-p): New. Tell if a file exists + locally, i.e. without using file name handlers. + (ido-read-internal): Allow mono letter host names, avoiding the + `c:' problem by testing if the file exists locally. + (ido-complete, ido-make-file-list, ido-exhibit): Ditto. +