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

Re: PATCH: update prompt themes



On May 17, 11:36pm, Peter Stephenson wrote:
}
} - Overhaul of use of precmd and preexec.  Use the hook functions
}   designed for exactly this purpose so as not to trash any existing
}   use of the functions.

Good plan, but:

} -	functions[precmd]="${functions[precmd]//prompt_bart_precmd}"
} +        precmd_functions[(r)prompt_*_precmd]=
} +	precmd_functions=($precmd_functions)

I'm curious why the second assignment is necessary there.  Remove an
empty element?  Couldn't you just do this?

    precmd_functions[(r)prompt_*_precmd]=()

Or perhaps better

    add-zsh-hook -D precmd 'prompt_*_precmd'

(Or do I misunderstand the -D option you added?)

}  	# Abuse the fg assoc to hold our selected colors ...
} -	fg[%m]=$fg[${1:-red}]

Er, the fg assoc came from Functions/Misc/colors which you're no longer
including, so it's no longer "abuse" to do this to the $fg that you've
declared global in this same function.

All of the above is in prompt_bart_setup ... I skimmed the other diffs
but didn't try as hard to understand what they were doing.



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