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: simon254
Subject: bug#48782: 28.0.50; fido-mode: shell variables distort find-file behaviour
Date: Sun, 6 Jun 2021 09:01:27 +0100 (BST)

Thank you very much for looking at this! 

Now, if I type $HOM I get candidate $HOME, then I have to M-Tab to insert the 
candidate and type "/" to continue find-file in the directory, and then 
everything works as expected. This makes it now definitely usable for me! 

It might still be a bit confusing that in case of an environment variable which 
value is a directory, Enter does open dired instead of transversing into the 
directory with find-file (typing $HOM followed by Enter opens dired in home). 
But I don't know if changing this would be better or worse than the current 
behaviour after your fix - or possible at all.

Simon

> On 05/06/2021 21:51 João Távora <joaotavora@gmail.com> wrote:
> 
>  
> João Távora <joaotavora@gmail.com> writes:
> 
> > tag 48782 important
> > thanks
> >
> > simon254--- via "Bug reports for GNU Emacs, the Swiss army knife of text
> > editors" <bug-gnu-emacs@gnu.org> writes:
> >
> >> 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
> >
> > Thanks, I reproduced this and will try to fix it.  Doesn't seem very
> > hard, but we'll see.
> 
> I pushed a commit to master that should fix it. It's
> 45d711a356b4c5e75d0b6e4391313ca34f57b4bb, a very simple patch:
> 
> diff --git a/lisp/icomplete.el b/lisp/icomplete.el
> index 03a191cb0b..08b4ef2030 100644
> --- a/lisp/icomplete.el
> +++ b/lisp/icomplete.el
> @@ -331,7 +331,8 @@ icomplete-fido-ret
>                     (file-name-directory (icomplete--field-string))))
>           (current (car completion-all-sorted-completions))
>           (probe (and dir current
> -                     (expand-file-name (directory-file-name current) dir))))
> +                     (expand-file-name (directory-file-name current)
> +                                       (substitute-env-vars dir)))))
>      (cond ((and probe (file-directory-p probe) (not (string= current "./")))
>             (icomplete-force-complete))
>            (t
> 
> 
> Closing this bug, but I'll reopen if it ends up not doing what you
> wanted.
> 
> João





reply via email to

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