bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48782: 28.0.50; fido-mode: shell variables distort find-file behavio


From: Dmitry Gutov
Subject: bug#48782: 28.0.50; fido-mode: shell variables distort find-file behaviour
Date: Fri, 4 Jun 2021 20:54:40 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

Joao, could you take a look?

On 01.06.2021 20:29, simon254--- via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote:
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))))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]