with emacs -Q
1)
M-x -> fido-mode
C-x C-f -> type "$HOME" -> enter opens dired buffer in $HOME directory
instead of continuing find-file $HOME to select a file to open
2)
similar thing happens if:
M-x -> fido-mode
C-x C-f -> type "$HOME/.emacs.d" -> enter opens dired buffer in $HOME/emacs.d
directory
instead of continuing find-file $HOME/emacs.d to select a file to open
in pure icomplete-mode find-file seems to work as expected after typing "$HOME/"
-> descent into directories via C-M-i?
ido-mode will not match environment variables but when typing
M-x -> ido-mode
C-x C-f -> type "$HOME/" -> ido expands $HOME to the actuall path and
find-file continues as expected
ido.el has
(defun ido-complete ()
"Try and complete the current pattern amongst the file names."
(interactive)
(let (res)
(cond
(ido-incomplete-regexp
;; Do nothing
)
((and (memq ido-cur-item '(file dir))
(string-match "[$]" ido-text))
(let ((evar (substitute-in-file-name (concat ido-current-directory
ido-text))))
(if (not (file-exists-p (file-name-directory evar)))
(message "Expansion generates non-existing directory name")
(if (file-directory-p evar)
(ido-set-current-directory evar)
(let ((d (or (file-name-directory evar) "/"))
(f (file-name-nondirectory evar)))
(when (file-directory-p d)
(ido-set-current-directory d)
(setq ido-text-init f))))
(setq ido-exit 'refresh)
(exit-minibuffer))))