Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocompletition fails when calling emacs with a non-existent file #628

Closed
kantholtz opened this issue Mar 28, 2013 · 3 comments
Closed
Milestone

Comments

@kantholtz
Copy link

When I try to open a file with emacs and that file does not exist a rather long error message gets printed when I try to do autocompletition by pressing TAB:

$ fish -v
fish, version 2.0.0
$ mkdir foo; cd foo; du
0    .
$ emacs x

...or any other character and then I press TAB for autocompletition

switch: Expected exactly one argument, got 0
/usr/local/Cellar/fishfish/OpenBeta_r2/share/fish/functions/__fish_filter_mime.fish (line 17):      switch $mime[$i]
                                                                                                               ^
in function '__fish_filter_mime',
    called on line 3 of file '/usr/local/Cellar/fishfish/OpenBeta_r2/share/fish/functions/__fish_complete_mime.fish',
    with parameter list 'text/*'

in command substitution
    called on line 11 of file '/usr/local/Cellar/fishfish/OpenBeta_r2/share/fish/functions/__fish_complete_mime.fish',

in function '__fish_complete_mime',
    called on standard input,
    with parameter list 'text/*'

in command substitution
    called on standard input,


       switch − switch ‐ conditionally execute a block of commands

switch ‐ conditionally execute a block of commands
   Synopsis
       switch VALUE; [case [WILDCARD...]; [COMMANDS...]; ...] end

switch: Type 'help switch' for related documentation

switch: Expected exactly one argument, got 0
/usr/local/Cellar/fishfish/OpenBeta_r2/share/fish/functions/__fish_filter_mime.fish (line 17):      switch $mime[$i]
                                                                                                               ^
in function '__fish_filter_mime',
    called on line 3 of file '/usr/local/Cellar/fishfish/OpenBeta_r2/share/fish/functions/__fish_complete_mime.fish',
    with parameter list 'text/*'

in command substitution
    called on line 11 of file '/usr/local/Cellar/fishfish/OpenBeta_r2/share/fish/functions/__fish_complete_mime.fish',

in function '__fish_complete_mime',
    called on standard input,
    with parameter list 'text/*'

in command substitution
    called on standard input,


       switch − switch ‐ conditionally execute a block of commands

switch ‐ conditionally execute a block of commands
   Synopsis
       switch VALUE; [case [WILDCARD...]; [COMMANDS...]; ...] end

switch: Type 'help switch' for related documentation

If the file exists, no error gets printed. If I use any other program (like "touch" for example) no error occurs. I have only observed this with emacs. I'm using version 24.2.1. As you can see in the error messages I'm on OS X and using the latest fishfish formula from brew.

@ridiculousfish
Copy link
Member

__fish_filter_mime doesn't do anything good if there's no results. This should fix it. Thanks for reporting this.

To git@github.com:fish-shell/fish-shell.git
37140d5..7d480ff master -> master

@lledey
Copy link
Contributor

lledey commented Apr 6, 2013

I still have this issue on OSX 10.7.5 and emacs 24.3.1.

This error happens when completing absolutely anything :

  • When completing an empty argument, a space is added at the end of the command, and the directory content is not printed.
  • When completing a valid or an invalid file, the behavior is ok.

Other fact, the behavior described above also happens on Debian wheezy, but __fish_filter_mime does not print all these error messages.

@ridiculousfish ridiculousfish reopened this Apr 7, 2013
@ridiculousfish
Copy link
Member

Another case of OS X's seq doing the wrong thing when passed 0
Should be fixed as 79f8d5c
Thanks for reporting this (again)!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants