Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15341
| From | Chet Ramey <chet.ramey@case.edu> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: Idea: *.p<TAB> completion |
| Date | 2019-09-01 14:27 -0400 |
| Organization | ITS, Case Western Reserve University |
| Message-ID | <mailman.278.1567362456.2075.bug-bash@gnu.org> (permalink) |
| References | <878sr88336.5.fsf@jidanni.org> <9e4e91b3-34a1-72b3-ba8d-bd9d0e31e4a7@case.edu> <87woer7v8e.5.fsf@jidanni.org> <35b9428b-2eb7-036f-9c17-83dd71a8e0f3@case.edu> |
On 9/1/19 2:00 PM, 積丹尼 Dan Jacobson wrote: >>>>>> "CR" == Chet Ramey <chet.ramey@case.edu> writes: > CR> On 9/1/19 11:10 AM, 積丹尼 Dan Jacobson wrote: >>> $ ls *.pdf >>> a.pdf b.pdf >>> $ diff *.p<TAB> >>> >>> At this point <TAB> should complete "*.pdf". > > CR> It does (well, the default completion does, maybe programmable completion > CR> for diff does too). But the two possible completions differ immediately -- > CR> in the first character -- so what are you going to do? Rather than remove > CR> the word, as normal completion would do, the default bash completion leaves > CR> it alone. > > I'm saying I want a real "* . p d f" as the result, I.e., genuine * 0x2A > asterisk left sitting upon the screen. I'm saying that's what the default bash completion code does. The default bash completion code leaves the word unchanged. > (Yes I wish to disable /usr/share/bash-completion effects while testing, > though it is on by default in Debian.) Maybe you should. > >>> Or maybe as a bonus it could complete "a.pdf b.pdf" via a different key. > > CR> You want it to insert the possible completions? Use C-x* in emacs mode: > > CR> glob-expand-word (C-x *) > CR> The word before point is treated as a pattern for pathname > CR> expansion, and the list of matching filenames is inserted, > CR> replacing the word. If a numeric argument is supplied, an > CR> asterisk is appended before pathname expansion. > > Well that can deal with "*" but not "*.p". That's neither completion nor globbing. If you want something like that to be completed, you're going to have to write a hybrid operation. Or just append a `*' to the word. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread
Re: Idea: *.p<TAB> completion Chet Ramey <chet.ramey@case.edu> - 2019-09-01 14:27 -0400
csiph-web