$isalias(aliasname).fname works well for global aliases in remote- and "aliases" files; the code above was an approach to find local aliases and respective line numbers.
The "spaces issue" should be fixed by adding a $qt arround %file in the line "filter -gfwcn %file ..."
