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

Re: [PATCH] add cdtohome setting



On Sat, Jun 8, 2024, at 1:51 AM, Martin Tournoij wrote:
> A small patch to add a tcsh setting I miss.

I don't have a strong initial opinion on whether this should be
accepted or not, but...


> -Change the current directory.  In the first form, change the
> -current directory to var(arg), or to the value of tt($HOME) if
> -var(arg) is not specified.  If var(arg) is `tt(-)', change to the
> -previous directory.
> +Change the current directory.  In the first form, change the current
> +directory to var(arg), or to the value of tt($HOME) if var(arg) is not
> +specified unless the tt(CD_TO_HOME) option is not set, in which case
> +var(arg) is required. If var(arg) is `tt(-)', change to the previous
> +directory.

I don't love how many negatives and chained clauses are jammed into
this one sentence.  I think something like this would be clearer:

	In the first form, change the current directory to var(arg)
	or to the value of tt($HOME) if var(arg) is omitted and the
	tt(CD_TO_HOME) option is set; if tt(CD_TO_HOME) is unset,
	var(arg) is required.


> +pindex(CD_TO_HOME)
> +pindex(NO_CD_TO_HOME)
> +pindex(CDTOHOME)
> +pindex(NOCDTOHOME)
> +item(tt(CD_TO_HOME))(
> +Don't go to home when using tt(cd) without any arguments.

Isn't it the other way around?  The option *enables* operand-less
cd to go $HOME.  (Not argument-less, because options are arguments.)
Maybe:

	If set, a tt(cd) command without operands changes the
	current directory to the value of tt($HOME).  If unset,
	tt(cd) requires at least one operand.


-- 
vq




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