From 9b032ff6d86cea9ab4615eb29b781261a6eb561a Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 30 Oct 2008 12:09:18 +0000 Subject: 25958: make it possible to get docs for startup files correct --- Doc/Makefile.in | 8 ++++++++ Doc/Zsh/filelist.yo | 10 +++++----- Doc/Zsh/files.yo | 17 +++++++++-------- Doc/Zsh/options.yo | 12 ++++++------ INSTALL | 7 +++++++ 5 files changed, 35 insertions(+), 19 deletions(-) diff --git a/Doc/Makefile.in b/Doc/Makefile.in index 0368ab3e3..7ca9dd25c 100644 --- a/Doc/Makefile.in +++ b/Doc/Makefile.in @@ -210,11 +210,19 @@ zshzftpsys.1: Zsh/zftpsys.yo zshzle.1: Zsh/zle.yo +# This should depend on config.status to get the /etc files right +# but that would introduce a dependency on Yodl in shipped versions +# of the shell that we want to avoid. version.yo: $(sdir_top)/Config/version.mk ( \ echo 'IFDEF(INCWSLEVEL)(INCWSLEVEL())(STARTDEF())'; \ echo 'def(version)(0)('$(VERSION)')'; \ echo 'def(date)(0)('$(VERSION_DATE)')'; \ + echo 'def(zshenv)(0)(@zshenv@)'; \ + echo 'def(zprofile)(0)(@zprofile@)'; \ + echo 'def(zshrc)(0)(@zshrc@)'; \ + echo 'def(zlogin)(0)(@zlogin@)'; \ + echo 'def(zlogout)(0)(@zlogout@)'; \ echo 'IFDEF(DECWSLEVEL)(DECWSLEVEL())(ENDDEF())#' | tr '#' '\\'; \ ) > $(sdir)/version.yo diff --git a/Doc/Zsh/filelist.yo b/Doc/Zsh/filelist.yo index f6e3d9dda..7a09901a7 100644 --- a/Doc/Zsh/filelist.yo +++ b/Doc/Zsh/filelist.yo @@ -7,9 +7,9 @@ list(tt($ZDOTDIR/.zshrc)) list(tt($ZDOTDIR/.zlogin)) list(tt($ZDOTDIR/.zlogout)) list(tt(${TMPPREFIX}*) (default is /tmp/zsh*)) -list(tt(/etc/zshenv)) -list(tt(/etc/zprofile)) -list(tt(/etc/zshrc)) -list(tt(/etc/zlogin)) -list(tt(/etc/zlogout) (installation-specific - tt(/etc) is the default)) +list(tt(zshenv())) +list(tt(zprofile())) +list(tt(zshrc())) +list(tt(zlogin())) +list(tt(zlogout()) (installation-specific - tt(/etc) is the default)) endlist() diff --git a/Doc/Zsh/files.yo b/Doc/Zsh/files.yo index 658d09e1f..65debe044 100644 --- a/Doc/Zsh/files.yo +++ b/Doc/Zsh/files.yo @@ -11,10 +11,11 @@ pindex(NO_RCS, use of) pindex(NO_GLOBAL_RCS, use of) vindex(ZDOTDIR, use of) cindex(zshenv) -Commands are first read from tt(/etc/zshenv); this cannot be overridden. +Commands are first read from tt(zshenv()); this cannot be overridden. Subsequent behaviour is modified by the tt(RCS) and tt(GLOBAL_RCS) options; the former affects all startup files, while the -second only affects those in the tt(/etc) directory. If one of the options +second only affects global startup files (those shown here with an +path starting with a tt(/)). If one of the options is unset at any point, any subsequent startup file+LPAR()s+RPAR() of the corresponding type will not be read. It is also possible for a file in tt($ZDOTDIR) to @@ -25,17 +26,17 @@ Commands are then read from tt($ZDOTDIR/.zshenv). pindex(LOGIN, use of) cindex(zprofile) If the shell is a login shell, commands -are read from tt(/etc/zprofile) and then tt($ZDOTDIR/.zprofile). +are read from tt(zprofile()) and then tt($ZDOTDIR/.zprofile). cindex(zshrc) Then, if the shell is interactive, -commands are read from tt(/etc/zshrc) and then tt($ZDOTDIR/.zshrc). +commands are read from tt(zshrc()) and then tt($ZDOTDIR/.zshrc). cindex(zlogin) -Finally, if the shell is a login shell, tt(/etc/zlogin) and +Finally, if the shell is a login shell, tt(zlogin()) and tt($ZDOTDIR/.zlogin) are read. cindex(zlogout) When a login shell exits, the files tt($ZDOTDIR/.zlogout) and then -tt(/etc/zlogout) are read. This happens with either an explicit exit +tt(zlogout()) are read. This happens with either an explicit exit via the tt(exit) or tt(logout) commands, or an implicit exit by reading end-of-file from the terminal. However, if the shell terminates due to tt(exec)'ing another process, the logout files are not read. @@ -46,10 +47,10 @@ saved. vindex(HOME, use of) If tt(ZDOTDIR) is unset, tt(HOME) is used instead. -Those files listed above as being in tt(/etc) may be in another +Files listed above as being in tt(/etc) may be in another directory, depending on the installation. -As tt(/etc/zshenv) is run for all instances of zsh, it is important that +As tt(zshenv()) is run for all instances of zsh, it is important that it be kept as small as possible. In particular, it is a good idea to put code that does not need to be run for every single shell behind a test of the form `tt(if [[ -o rcs ]]; then ...)' so that it will not diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index ba535a7de..053697022 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -730,19 +730,19 @@ pindex(GLOBAL_RCS) cindex(startup files, global, inhibiting) cindex(files, global startup, inhibiting) item(tt(GLOBAL_RCS) (tt(-d)) )( -If this option is unset, the startup files tt(/etc/zprofile), -tt(/etc/zshrc), tt(/etc/zlogin) and tt(/etc/zlogout) will not be run. It +If this option is unset, the startup files tt(zprofile()), +tt(zshrc()), tt(zlogin()) and tt(zlogout()) will not be run. It can be disabled and re-enabled at any time, including inside local startup files (tt(.zshrc), etc.). ) pindex(RCS) cindex(startup files, sourcing) item(tt(RCS) (tt(PLUS()f)) )( -After tt(/etc/zshenv) is sourced on startup, source the -tt(.zshenv), tt(/etc/zprofile), tt(.zprofile), -tt(/etc/zshrc), tt(.zshrc), tt(/etc/zlogin), tt(.zlogin), and tt(.zlogout) +After tt(zshenv()) is sourced on startup, source the +tt(.zshenv), tt(zprofile()), tt(.zprofile), +tt(zshrc()), tt(.zshrc), tt(zlogin()), tt(.zlogin), and tt(.zlogout) files, as described in noderef(Files). -If this option is unset, the tt(/etc/zshenv) file is still sourced, but any +If this option is unset, the tt(zshenv()) file is still sourced, but any of the others will not be; it can be set at any time to prevent the remaining startup files after the currently executing one from being sourced. diff --git a/INSTALL b/INSTALL index afbbb76ad..f2b9bd04d 100644 --- a/INSTALL +++ b/INSTALL @@ -407,6 +407,13 @@ Any startup/shutdown script can be disabled by giving the --disable-SCRIPTNAME option to "configure". The --disable-etcdir option disables all startup/shutdown files which are not explicitly enabled. +The precompiled documentation comes with startup files listed +as being in the /etc directory. If yodl is available, running +"touch version.yo" and "make" in the Doc directory should produce +correctly substituted documentation. (This has to be run by hand +to avoid introducing a dependency on yodl on systems where the precompiled +documentation is sufficient.) + Shell functions --------------- -- cgit 1.4.1