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

Re: User installation script for new completion



On May 2,  4:03pm, Peter Stephenson wrote:
} Subject: User installation script for new completion
}
} +# To do:
} +#  - Maybe this should be sourced, then it can check the user's current
} +#    setup better.  But then there is a potentially horrendous option
} +#    setting/resetting problem.  (Maybe we need another way of doing that.)

You don't mean this, do you?

	typeset -A options
	options=($(setopt kshoptionprint;setopt))
	[[ -o kshoptionprint ]] || options[kshoptionprint]=off
	[[ -o monitor ]] && options[monitor]=on
	[[ -o zle ]] && options[zle]=on

	for i in ${(k)options}
	do case $options[$i] in
	on) setopt $i;;
	off) unsetopt $i;;
	esac done

If you do mean that, then why not have the whole install script be a shell
function with "emulate -LR zsh" at the top?  The file that you source can
define the function and then call it.

} +"How would you like the numeric prefix to be treated:
} +  0:  Not used by correction
} +  U:  Used to given the number of errors
} +  I:  If present, and not 1, do not perform correction?

"Used to given the number of errors"??  "give"?  "govern"?  And what does
it do with "the number of errors" once given it?  (I know, but presumably
a person running this script probably doesn't.)

If I were to run compinstall, it would have no effect at all on most of
my shells, because my .zshrc exits early by calling 'return' if certain
settings are already present in the environment when it runs.  I don't
have any good suggestions for what to do about this, but I thought I'd
mention it anyway.

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



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