[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] Request For New Feature: Unadorned Plus Sign
From: |
Jon Fairbairn |
Subject: |
Re: [Nmh-workers] Request For New Feature: Unadorned Plus Sign |
Date: |
Sat, 11 Feb 2012 10:31:24 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Ralph Corderoy <address@hidden> writes:
> I did work out the tcsh(1) spell for that in another millenium, these
> days I use bash as it's what to hand. I've had a go at what you
> requested and it seems to work; I don't use it myself and haven't tried
> to define a bash completion before so be warned.
This has been on my list of things to work out how to do for
years; thanks for saving me the trouble!
> comp_nmh_folder()
> {
> local w=${COMP_WORDS[COMP_CWORD]} &&
> [[ $w == +* ]] && w=${w#+} &&
> COMPREPLY=($(
> folders -fast |
If you have the sort of folder structure I do, that wants to be
folders -fast -recurse |
> awk -v "w=$w" -v "l=${#w}" 'substr($0, 1, l) == w'
> ))
> }
> complete -P + -F comp_nmh_folder -D
--
Jón Fairbairn address@hidden