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

Re: Mailpath notification message



On Nov 5,  3:13pm, Nate Johnston wrote:
} Subject: Re: Mailpath notification message
}
} Quite a while ago, there was a person asking how to string long lines into
} his MAILPATH.  This is (approximately) what was written as an answer,
} perhaps by Mr. Stephenson (if I remember truly).

Nope, it was me.

} setopt magic_equal_subst                # for `export foo=~/bar`
} function export() { EXPORT=${1%%\=*} ; typeset -Ux $* }
} function +() { eval builtin export ${EXPORT}=\$\{$EXPORT\}:\$1 }
} # some stuff snipped
} export MAILPATH=        "~/mail/in/inbox?Mail in folder 1"
}                 +       "~/.samizdat/in/inbox?Mail in filder 2"
} # more snipped 
} unfunction export +
} 
} This used to work for me.  Now however, I get the message that the second
} one (~/.samizdat..etc) is not an identifier.

The first export has to look like a real variable assignment:

export MAILPATH="~/mail/in/inbox?Mail in folder 1"
	+	"~/.samizdat/in/inbox?Mail in filder 2"

It was never supposed to work with spaces after the `=' sign; that it ever
did was because of poor parsing in eariler versions of zsh.

Also, putting quotes around the leading `~' protects that from expansion
even with magic_equal_subst set, so the eventual value of the variable is:

    ~/mail/in/inbox?Mail in folder 1:~/.samizdat/in/inbox?Mail in filder 2

Which I *think* works for $MAILPATH but would not work for $PATH etc.  It
would be better to say (note position of the quotes):

export MAILPATH=~/mail/in/inbox"?Mail in folder 1"
	+	~/.samizdat/in/inbox"?Mail in filder 2"

Finally, what's a filder? ;->

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern



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