On 1/28/07, Velko Hristov <[EMAIL PROTECTED]> wrote:
> Hi,
>
> here are the completion files for totem 2.16.4 and xterm 222. This time
> not everything went smooth though.
Great job! Let's see if we cant fix your issues as well.
> Apparently xterm allows the user to prefix most switches either by "-"
> (short or old style switches) or by "+" which means "the reverse
> action". fish does not have notion for this switch usage. I haven't
> seen may programs that (mis)use the switches that way but there are
> some. luit being one of them.
I have thought about the '+switch' issue as well. I've come to the
conclusion that the number of commands using this syntax is small
enough that I don't think fish should support this natively. The same
behavior can be had using a bit of clever scripting.
The first step is to simply add the +-style switch as a possible
argument like this:
complete -c xterm -a +ah --description "Never highlight the text cursor"
This will work just fine, but there is a slight inconsistency - normal
switches are only used as possible completions if the first character
is a hyphen. This helps avoid cluttering the screen with a million
completions if you complete the empty string. We'd like the same
behaviour with +-style completions. This can be had by using the -n
switch for complete to only complete if the current argument begins
with a '+':
function __fish_test_plus_switch --description "Test if the token
under the cursor begins with a '+'"
switch (commandline -ct)
case '+*'
return 0
end
return 1
end
complete -c xterm -n '__fish_test_plus_switch' -a +ah --description
"Never highlight the text cursor"
The only remaining issue is that the syntax highlighting code won't
flag misspelled +-style siwtches in red. But I think it's close
enough.
> And this leads me to the second problem: I tried to extract the list of
> encodings for xterm using luit but failed. Could some scripting wizard
> please look at the function __fish_complete_xterm_encoding in xterm.fish
> and actually complete it? There are a couple more switches that take
> certain parameters (like colors or numbers) which may be deduced also.
> So if anyone is interested in doing it there is an opportunity.
Ugh. The luit output isn't very scripting friendly... I strongly
suspect that luit uses the libc conversions and the completions whould
be the same as for e.g. iconv. Therefore "iconv --list|sed -e
's|//||'" should work fine. Only trouble is that there may be some
systems that have xterm installed but not iconv. I can live with that.
> While testing if all strings fit on standard 80 character screen I
> switched back and forth between a virtual console and the X session.
> It was strange that fish complained on the virtual console about the
> function writembs being called with null value for argument str by the
> fish_pager but not on the much larger xterm window. It says it is a bug
> and should be reported if it reproducible and indeed it is. It does not
> bother me because fish does not crash or misbehave but I do report it
> anyway. HTH.
Thanks. The issue is that fish is trying to use some terminfo magic to
perform nice screen redrawing, but your virtual console lacks one of
the terminfo strings that fish wants to use. I plan on writing some
kind of 'limited mode' to handle such anemic consoles.
>
> Regards - Velko
> --
> When asked if I am ignorant or apathetic I answer
> "I don't know and I really don't care."
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> _______________________________________________
> Fish-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fish-users
--
Axel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users