Files
plan9port/man/man1/label.1
Dmitri Vereshchagin 10564b1175 tmac/tmac.an: define .MR in a groff compatible way
groff 1.23.0 added .MR to its -man macro package.  The NEWS file states
that the inclusion of the macro "was prompted by its introduction to
Plan 9 from User Space's troff in August 2020."  From d32deab it seems
that the name for Plan 9 from User Space's implementation was suggested
by groff maintainer G. Brandon Robinson.

Not sure if the intention was to make these definitions compatible, but
it would be nice if they were.

Currently, Plan 9 from User Space's .MR expects its second argument to
be parenthesized.  groff's .MR does not.  This results in extra
parentheses appearing in manual references when viewing Plan 9 from User
Space's manual pages on a system using groff.
2025-07-27 09:58:50 -04:00

81 lines
1.2 KiB
Groff

.TH LABEL 1
.SH NAME
label, awd \- set window label
.SH SYNOPSIS
.B label
.I string
.br
.B awd
[
.I sysname
]
.SH DESCRIPTION
.I Label
sets the label of the current
.I win
(see
.MR acme 1 )
or X terminal window
.RI ( e.g.,
.MR 9term 1
or
.MR xterm 1 )
by echoing a special control sequence to standard output.
.PP
.I Acme
and
.I 9term
windows assume the label is a directory name.
When unrooted file names are plumbed in the window,
they are evaluated relative to the directory named in the label.
.PP
The label may have a suffix
.BI /- sysname \fR,
which is not interpreted as part of the directory during plumbing.
.I Awd
sets the window name to the current directory with a
.BI /- sysname
suffix, using the name of the current system by default.
.SH EXAMPLE
One can use the following
.MR sh 1
function to keep the label up-to-date in response to
.I cd
commands:
.IP
.EX
_cd () {
\ecd "$@" &&
case $- in
*i*)
awd
esac
}
alias cd=_cd
cd .
.EE
.PP
.MR Rc 1
installs a similar
.B fn
.B cd
at startup if there is not already a function named
.BR cd :
.IP
.EX
fn cd {
if(builtin cd $1){
if(flag i) $PLAN9/bin/9 awd || status=''
status=''
}
}
.EE
.SH SOURCE
.B \*9/bin/label
.br
.B \*9/bin/awd
.SH BUGS
.I Awd
is also documented in
.MR acme 1 .