Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: expansion (was: Re: PATCH: Re: blah*[TAB] (difference between 3.1.6 and 3.1.9))



On Jun 7,  8:46am, Sven Wischnowsky wrote:
} Subject: PATCH: expansion (was: Re: PATCH: Re: blah*[TAB] (difference betw
}
} 
} Bart Schaefer wrote:
} 
} > It was 11777.  Confusion about a double-negative, or something like that.

I'm going to stop responding to articles with numbers ending in three 7s.

} > Sven changed a test to be:
} > 
} > 	if ! zstyle -T ":completion:${curcontext}:" add-space; then
} 
} I know all that.

Of course YOU know all that.  Wayne might not.

} And I still insist, that the current behaviour is
} correct; from the docs:
} 
}   This style is used by the tt(_expand) completer.  If it is `true' (the
}   default), a space will be inserted after all words resulting from the 
}   expansion (except for directory names which get a slash).
} 
} So, it appends a space to the generated expansion.
} 
} What you folks really want is a more sophisticated add-space

Actually what I want is some way to know without looking at the docs
whether a style defaults to `true' when not set or to `false' when not
set.  Back in the mists of time we used to have options whose names
started with `no' so that you'd know that setting it turned something
off, rather than on, and there was no non-`no' (I sound like a backup
singer for a '50s rock group) option to unset instead, so looking at
the output of `setopt' was enough to tell you what the heck was going
on:  The default behavior changed only when something became true, and
"not set" always meant false.

Pardon me, I just go off on that from time to time.  I'm not really
suggesting that we redo it all again at this point.

Anyway, I assumed without looking that add-space was supposed to default
to false when not set, since that had been the previous behavior.

} namely (I'm guessing ;-): if add-space if false, never add
} a space; if it is true, add a space if the generated word is the name
} of an existing file.

I just speculated exactly this in my reply to the expand-or-complete
thread, but I don't think it makes as much sense as does appending a
space only when multiple words result.

} But then I would insist, that we change add-space to:
} 
}   - true: always add a space (after all, one might want to use it to
}            generate names of non-existing files)
}   - false: never add a space
}   - exisiting: add a space only if the word is the name of an
}            exisiting file
} 
} Ok?

Whether that is "ok" depends more on what the behavior is when it is not
set at all than on what the possible settings are.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author