-
Notifications
You must be signed in to change notification settings - Fork 3
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
savannah: tab completion vs. spaces and escaping #55
Comments
|
|
|
Created branch 55_filename_complete (parent: master)
Review, please. |
|
|
in lib/widget/input_complete.c, the tab char should also be treated like that. you can insert a tab with ctrl-q tab easily, even if this is not really useful in the normal case.
INPUT_COMPLETE_FILES_ESC sounds like a misnomer to me. at the level of the input api it doesn't relate to files at all (or at least it shouldn't - i can't see from the patch alone whether that's actually the case). INPUT_COMPLETE_SPACE_ESC sounds like a better name. |
Ossi, your wishes have been realized in temporary changesets dac8b78fb [dac8b78fb53c76ce6d018f41cc679c97c83aef28] and b530609cb [b530609cb335d13c04bd9169cf2a21d06c29f7d2]. Thanks. |
actually, the logic in lib/widget/input_complete.c is broken. i think it should be more or less like this:
|
|
rebased to latest master and have respected ossi's thoughts.
Review, please. |
a recommendation for the commit message: use the past tense for the broken things that your commit fixes. it makes no sense to describe *some* state in the present tense, because it is not clear whether that's the new or the old state.
your re-definition of INPUT_COMPLETE_DEFAULT makes it a misnomer - it's more like INPUT_COMPLETE_NONE now.
anyway, the more i look into this code, the less i understand. what exactly is the above fragment supposed to do? the "stop chars" in the strchr are applied irrespective of mode, which makes no sense to me at all. what is INPUT_COMPLETE_SPACE_ESC meant to actually do? as far as i can see, there are only two modes: plain (regular line inputs) and shell-like (command prompt. fwiw, the built-in cd should just pretend to be a regular cd command (i.e., follow the normal shell splitting and quoting rules), then there would be no ambiguity). i can't find the code which is supposed to quote completions for the command prompt - am i or the code missing something?
try_complete() contains a lot of fuzzy logic, in particular with backslash escaping being handled rather arbitrarily or not at all. strutils_is_char_escaped() should be consistently applied, with regard to the mode.
INPUT_COMPLETE_DIRNAMES needs to be split out from INPUT_COMPLETE_CD, otherwise the "cd" detection magic is activated outside command prompt context as well.
generally, i'd suggest that you *precisely* describe the intended semantics of the INPUT_COMPLETE_* enum values next to their declarations, and then match these descriptions against both the implementation and the usages.
wow. two hours gone. |
Thank for explanation, my English isn't good, and I accept all lessons and criticism.
Yep, you right, INPUT_COMPLETE_NONE have more sense now. I changed the name of constant.
All your other notes I have to take a closer look in the evening with a relaxing cup of tea. So, ticket going to 'rework' stage.
But I hope, you got a fun in this two hours, because a fun it an engine of OpenSource (in most cases) :) |
|
|
Branch was recreated. See 55_filename_complete [5b3bddeb2c1fe52180c36d0a133d77508a26af9c] for details. Review & vote, please. |
|
|
merged to master:
|
|
|
|
Important
This issue was migrated from Trac:
egmont
(@egmontkob)ossi
(@ossilator),egmont@….com
(@egmontkob)Original: http://savannah.gnu.org/bugs/?18695
Original submission:
Comment 1 by Pavel Tsekov <ptsekov> at Fri 05 Jan 2007 01:53:04 PM UTC:
The text was updated successfully, but these errors were encountered: