commit - 86c0006867f07c7474f5cd66e575a35b0c7f7321
commit + 4e4d25bd4ffbdde10cef65924455817d922230b6
blob - 80f325c3f15e09358d80738187331d4fd72f4861
blob + 69927b082fc54ccfd1924745cf7224accf5be48e
--- rmc.1
+++ rmc.1
-.Dd February 19, 2023
+.Dd February 23, 2023
.Dt RMC 1
.Os
.Sh NAME
.Nm rmc
-.Nd view, edit, compose or print files, directories and URLs.
+.Nd view, edit, compose or print files, directories and URLs
.Sh SYNOPSIS
.Nm
.Op Fl ecp
.Sh DESCRIPTION
The
.Nm
-command views, edits, composes or prints a local file, directory or URL.
+utility views, edits, composes or prints a local file, directory or URL.
In this manual page simply
.Dq file
to denote either of the three, while specifically
.Dq local file
-means a file actually present in the local file hierarchy. Commands to
-execute are chosen from the first matching entry in the mailcap file
-(see
+means a file actually present in the local file hierarchy.
+Commands to execute are chosen from the first matching entry in the
+mailcap file (see
.Sx the mailcap file ) ,
-based on the local file/directory's MIME type or the URL's scheme. The
-view-command of a matching mailcap entry is executed by default. File
-extensions and URI schemes can be mapped via the mime.types file (see
+based on the local file/directory's MIME type or the URL's scheme.
+The view-command of a matching mailcap entry is executed by default.
+File extensions and URI schemes can be mapped via the mime.types file
+(see
.Sx the mime.types file ) .
If no such mapping is found, directories are automatically recognised to
have the pseudo-MIME type
Use the compose-command istead of the view-command.
.It Fl p
Use the print-command istead of the view-command.
-.Be
.El
.Ss The mailcap file
The mailcap file describes commands to execute depending on the file's
-MIME type. Empty lines and lines, whose first non-whitespace character
-is a number sign (#) are ignored. Other lines consist of fields,
-separated by semicolons (;), optionally continued on the next line if
-the last character is a backslash (\\). Backslashes may also be used for
-quoting characters: if a character (including another backslash) is
-preceeded by a backslash, it is stripped of its special meaning, and is
-used literally. Semicolon following the last field is optional.
+MIME type.
+Empty lines and lines, whose first non-whitespace character is a number
+sign (#) are ignored.
+Other lines consist of fields, separated by semicolons (;), optionally
+continued on the next line if the last character is a backslash (\\).
+Backslashes may also be used for quoting characters: if a character
+(including another backslash) is preceeded by a backslash, it is
+stripped of its special meaning, and is used literally.
+Semicolon following the last field is optional.
.Pp
There are two types of variables: single-letter variables, and named
-variables. Named variables begin with
+variables.
+Named variables begin with
.Dq %{
and end with
.Dq } .
.Nm
recognises two single-letter variables:
.Bl -tag -width Ds
-.Pp
.It %t
Is replaced with the file's MIME type.
.It %s
Is replaced with the file's name.
.El
.Pp
-The first field always contains the MIME type to match against. Subtype
-may be ommited by either only specifying the type, or writing an
+The first field always contains the MIME type to match against.
+Subtype may be ommited by either only specifying the type, or writing an
asterisk (*) in subtype's place, in which case the subtype is
-disregarded when matching. For example, consider these fields:
+disregarded when matching.
+For example, consider these fields:
.Bd -literal -offset indent
text/*
text
whose MIME type is
.Dq text/plain .
.Pp
-The second field is always the view-command. The others are either
-flags or named fields.
+The second field is always the view-command.
+The others are either flags or named fields.
.Pp
Flag fields are as follows:
.Bl -tag -width needsterminalx
.It needsterminal
If both the standard input and standard output are associated with a
-terminal, the command is unchanged. Otherwise if
+terminal, the command is unchanged.
+Otherwise if
.Nm
is running under X11, the command is executed in a new terminal.
-Finally, if neither is true, the match fails. Not used when executing
-the print-command.
+Finally, if neither is true, the match fails.
+Not used when executing the print-command.
.It copiousoutput
If the view-command is being executed, the output is piped into a
-pager. Only used when needsterminal is specified as well.
+pager.
+Only used when needsterminal is specified as well.
.El
.Pp
Named fields contain the name of the field, followed by the equality
.It nametemplate
If nametemplate is set, before executing the command,
.Nm
-will create a symlink to file, named as the value of nametemplate. It
-can be useful with programs that expect files to be named in a certain
-way. Only used with local files.
+will create a symlink to file, named as the value of nametemplate.
+It can be useful with programs that expect files to be named in a
+certain way.
+Only used with local files.
.It test
The value of test is a command to be executed before the main command.
If this commands returns >0, the entry doesn't match.
.El
.Pp
If there is no named field for the requested command, the mailcap entry
-doesn't match. Unrecognised fields are ignored.
+doesn't match.
+Unrecognised fields are ignored.
.Ss The mime.types file
The mime.types file contains mappings of file extensions and URL schemes
-to MIME types. Empty lines, and lines whose first non-whitespace
-character is the number sign (#) are ignored. Other lines are divided
-into a number of whitespace separated fields. The first field always
-denotes a MIME type. If the type is
+to MIME types.
+Empty lines, and lines whose first non-whitespace character is the
+number sign (#) are ignored.
+Other lines are divided into a number of whitespace separated fields.
+The first field always denotes a MIME type.
+If the type is
.Dq scheme ,
the other fields correspond URL schemes; otherwise they denote
filename extensions.
.Sh ENVIRONMENT
.Bl -tag -width TERMINALX
.It Ev TERMINAL
-Terminal command to use. Default is
+Terminal command to use.
+Default is
.Dq xterm .
.It Ev PAGER
-Pager command to use. Default is
+Pager command to use.
+Default is
.Dq less .
.El
.Sh FILES
.It Pa ~/.mailcap
The mailcap file.
.It Pa /etc/mime.types
-System-wide MIME type mappings. Unused if
+System-wide MIME type mappings.
+Unused if
.Pa ~/.mime.types
is present.
.It Pa ~/.mime.types
User-specific MIME types mappings.
.El
+.Sh EXIT STATUS
+.Ex -std
.Sh EXAMPLES
With the following
.Pa ~/.mime.types :
.Xr vi 1
with the argument
.Dq ./mailto:user@site.org .
-.Sh EXIT STATUS
-.Ex -std
.Sh SEE ALSO
.Xr file 1
.Sh STANDARDS
.%R RFC 1524
.%T A User Agent Configuration Mechanism For Multimedia Mail Format Information
.Re
+.Sh AUTHORS
+.An Alexander Arkhipov Aq Mt aa_src@manpager.net .
.Sh CAVEATS
According to RFC 1524 all files in the
.Ev MAILCAPS
or
.Pa ~/.mailcap : Ns Pa /etc/mailcap : Ns Pa /usr/etc/mailcap : Ns Pa /usr/local/etc/mailcap
-path should be searched until a match is found. This behaviour is not
-considered to be useful, intuitive, or secure, so only the
+path should be searched until a match is found.
+This behaviour is not considered to be useful, intuitive, or secure, so
+only the
.Pa ~/.mailcap
file is searched.
-.Sh AUTHORS
-.An Alexander Arkhipov Aq Mt aa_src@manpager.net .