unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: simon254@mailbox.org, 48782@debbugs.gnu.org,
	"João Távora" <joaotavora@gmail.com>
Subject: bug#48782: 28.0.50; fido-mode: shell variables distort find-file behaviour
Date: Fri, 4 Jun 2021 20:54:40 +0300	[thread overview]
Message-ID: <c011398e-d588-b346-3713-7daad67e94a8@yandex.ru> (raw)
In-Reply-To: <855373175.142584.1622568557185@office.mailbox.org>

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	other threads:[~2021-06-04 17:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01 17:29 bug#48782: 28.0.50; fido-mode: shell variables distort find-file behaviour simon254--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-04 17:54 ` Dmitry Gutov [this message]
2021-06-05 18:39 ` João Távora
2021-06-05 20:51   ` João Távora
2021-06-06  8:01     ` simon254--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-06 16:16       ` João Távora
2021-06-07 18:23         ` simon254--- via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c011398e-d588-b346-3713-7daad67e94a8@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=48782@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=simon254@mailbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).