[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature request: tab completion on functions

From: L A Walsh
Subject: Re: Feature request: tab completion on functions
Date: Sat, 27 Jan 2018 12:38:46 -0800
User-agent: Thunderbird

Ilkka Virta wrote:
Doesn't Bash/readline already tab-complete file names so that the
completion fixes the case? If I do 'touch ABBA' and 'rm ab<tab>', it will complete the name to 'ABBA'. It also completes 'ab<tab>' to 'ABBA' as the name of a command if it's a binary in PATH, but if it's a function, it seems to require the correct case. Sort of confusing, really.
   Bash has the nocaseglob option, which ignores case on searching for
files via a wildcard.  I don't believe there is an option to search
for functions ignoring case.  So your "ab"<tab> will ignore case of
a file that is looked up.  But functions aren't able to be looked up
that way.

Odne Hellebø wrote:
@Chet why wouldn't I be able to execute the result?
If you are windows-- maybe, but the binary "grep" is different than
the file "Grep".  So if you don't have the case right, it won't match.

@Ilkka Virta you nailed it :)
   See response above.
I may have been slightly unclear on what I want. I have 2 functions
makeFoodSpaghetti and makeFoodLasagne.
* ma<Tab>
* makeFood<Cursor>
* makeFoodl<Tab>                 <- this does nothing
* makeFoodL<Tab>            -> expands to makeFoodLasagne
   Same problem as above -- you have no function "makeFoodl" and
function lookup has no lookup mechanism that can ignore case.

So I want to be able to write the lowercase l after makeFood and tab
complete to get the function that I want.

Did a quick test with scripts and that works.
   Scripts can use case-insensitive file-globbing, as they are being
searched for using a  wild-card search that can ignore case. But when you
list out functions, they are listed "as is", there is no wildcard matching
for all function names -- at least not directly.  So for function matching,
that functionality would have to be written.

   It's not that it couldn't be done, but that it's not something
that already exists in various forms (like case insensitive filename
matching), let alone one.  It could be written, and Chet might accept
a patch to support it, but that would be up to Chet.

   At least that's my analysis of the problem.  Does that make sense?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]