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

Closed
dreadworks opened this Issue Mar 28, 2013 · 3 comments

Comments

Projects
None yet
3 participants
@dreadworks

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

This comment has been minimized.

Show comment
Hide comment
@ridiculousfish

ridiculousfish Mar 29, 2013

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

Member

ridiculousfish commented Mar 29, 2013

__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

This comment has been minimized.

Show comment
Hide comment
@lledey

lledey Apr 6, 2013

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@ridiculousfish

ridiculousfish Apr 28, 2013

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)!

Member

ridiculousfish commented Apr 28, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment