{
    "content": [
        {
            "type": "text",
            "text": "# MHL(1mh) (man)\n\n**Summary:** mhl - produce formatted listings of nmh messages\n\n**Synopsis:** /usr/lib/mh/mhl [-help] [-version] [-bell | -nobell] [-clear | -noclear] [-folder +folder]\n[-form formfile] [-length lines] [-width columns] [-moreproc program] [-nomoreproc]\n[-fmtproc program] [-nofmtproc] [files ...]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | — | — | ter each message). Both of these switches (and their inverse counterparts) take effect only if the profile entry morepro |\n\n## See Also\n\n- show(1)\n- ap(8)\n- dp(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (4 lines)\n- **DESCRIPTION** (11 lines) — 1 subsections\n  - -clear (189 lines)\n- **FILES** (4 lines)\n- **PROFILE COMPONENTS** (4 lines)\n- **SEE ALSO** (2 lines)\n- **DEFAULTS** (5 lines)\n- **CONTEXT** (2 lines)\n- **BUGS** (9 lines)\n\n## Full Content\n\n### NAME\n\nmhl - produce formatted listings of nmh messages\n\n### SYNOPSIS\n\n/usr/lib/mh/mhl [-help] [-version] [-bell | -nobell] [-clear | -noclear] [-folder +folder]\n[-form formfile] [-length lines] [-width columns] [-moreproc program] [-nomoreproc]\n[-fmtproc program] [-nofmtproc] [files ...]\n\n### DESCRIPTION\n\nmhl  is  an  nmh  command  for  filtering and/or displaying text messages.  It is the default\nmethod of displaying text messages for nmh (it is the default showproc).\n\nAs with more, each of the messages specified as arguments (or the  standard  input)  will  be\noutput.   If more than one message file is specified, the user will be prompted prior to each\none, and a <RETURN> or <EOT> will begin the output, with <RETURN> clearing the screen (if ap‐\npropriate), and <EOT> (usually CTRL-D) suppressing the screen clear.  An <INTERRUPT> (usually\nCTRL-C) will abort the current message output, prompting for the next message  (if  there  is\none), and a <QUIT> (usually CTRL- will terminate the program (without core dump).\n\nThe  -bell  option  tells  mhl to ring the terminal's bell at the end of each page, while the\n\n#### -clear\n\nter  each message).  Both of these switches (and their inverse counterparts) take effect only\nif the profile entry moreproc is defined but empty, and mhl is outputting to a terminal.   If\nthe  moreproc  entry  is defined and non-empty, and mhl is outputting to a terminal, then mhl\nwill cause the moreproc to be placed between the terminal and mhl and the  switches  are  ig‐\nnored.  Furthermore, if the -clear switch is used and mhl's output is directed to a terminal,\nthen mhl will consult the TERM and TERMCAP environment variables to determine the user's ter‐\nminal  type  in order to find out how to clear the screen.  If the -clear switch is given and\nmhl's output is not directed to a terminal (e.g., a pipe or a file), then  mhl  will  send  a\nformfeed after each message.\n\nTo  override  the  default  moreproc and the profile entry, use the -moreproc program switch.\nNote that mhl will never start a moreproc if invoked on a hardcopy terminal.\n\nThe -length length and -width width switches set the screen length and  width,  respectively.\nThese  default  to the values indicated by TERMCAP, if appropriate, otherwise they default to\n40 and 80, respectively.\n\nThe default format file used by mhl is called “mhl.format”.  mhl will first search  for  this\nfile  in  the user's nmh directory, and will then search in the directory /etc/nmh.  This de‐\nfault can be changed by using the -form formatfile switch.\n\nFinally, the -folder +folder switch sets the nmh folder name, which is used for the “message‐\nname:”  field  described  below.  The environment variable $mhfolder is consulted for the de‐\nfault value, which next, show, and prev initialize appropriately.\n\nmhl operates in two phases: 1) read and parse the format file, and 2)  process  each  message\n(file).   During  phase  1, an internal description of the format is produced as a structured\nlist.  In phase 2, this list is walked for each message, outputting message information under\nthe format constraints from the format file.\n\nThe format file can contain information controlling screen clearing, screen size, wrap-around\ncontrol, transparent text, component ordering, and component formatting.   Also,  a  list  of\ncomponents  to  ignore  may be specified, and a couple of “special” components are defined to\nprovide added functionality.  Message output will be in the order specified by the  order  in\nthe format file.\n\nEach line of a format file has one of the following forms:\n\n;comment\n:cleartext\nvariable[,variable...]\ncomponent:[variable,...]\n\n•   A line beginning with a `;' is a comment, and is ignored.\n\n•   A line beginning with a `:' is clear text, and is output exactly as is.\n\n•   A line containing only a `:' produces a blank line in the output.\n\n•   A line beginning with “component:” defines the format for the specified component,\n\n•   Remaining lines define the global environment.\n\nFor example, the line:\n\nwidth=80,length=40,clearscreen,overflowtext=\"*\",overflowoffset=5\n\ndefines  the  screen  size  to  be 80 columns by 40 rows, specifies that the screen should be\ncleared prior to each page, that the overflow indentation is 5, and that overflow text should\nbe flagged with “*”.\n\nFollowing  are all of the current variables and their arguments.  If they follow a component,\nthey apply only to that component, otherwise, their affect is global.  Since the whole format\nis parsed before any output processing, the last global switch setting for a variable applies\nto the whole message if that variable is used in a global context (i.e.,  bell,  clearscreen,\nwidth, length).\n\nvariable       type       semantics\nwidth          integer    screen width or component width\nlength         integer    screen length or component length\noffset         integer    positions to indent “component: ”\noverflowtext   string     text to use at the beginning of an\noverflow line\noverflowoffset integer    positions to indent overflow lines\ncompwidth      integer    positions to indent component text\nafter the first line is output\nuppercase      flag       output text of this component in all\nupper case\nnouppercase    flag       don't uppercase\nclearscreen    flag/G     clear the screen prior to each page\nnoclearscreen  flag/G     don't clearscreen\nbell           flag/G     ring the bell at the end of each page\nnobell         flag/G     don't bell\ncomponent      string/L   name to use instead of “component” for\nthis component\nnocomponent    flag       don't output “component: ” for this\ncomponent\ncenter         flag       center component on line (works for\none-line components only)\nnocenter       flag       don't center\nleftadjust     flag       strip off leading whitespace on each\nline of text\nnoleftadjust   flag       don't leftadjust\nrtrim          flag       trim whitespace at end of text lines\nnortrim        flag       retain whitespace at end of text\nlines (default)\ncompress       flag       change newlines in text to spaces\nnocompress     flag       don't compress\nwrap           flag       Wrap lines that exceed width (default)\nnowrap         flag       Do not perform line wrapping\nsplit          flag       don't combine multiple fields into\na single field\nnosplit        flag       combine multiple fields into\na single field\nnewline        flag       print newline at end of components\n(this is the default)\nnonewline      flag       don't print newline at end of components\nformatfield    string     format string for this component\n(see below)\ndecode         flag       decode text as RFC 2047 encoded\nheader field\naddrfield      flag       field contains addresses\ndatefield      flag       field contains dates\nformat         flag       Run component through formatproc filter\n(body only)\nnoformat       flag       Do not run component through\nformatproc filter (default)\nformatarg      string     Argument to format filter\n\nTo specify the value of integer-valued and string-valued variables, follow their name with an\nequals-sign and the value.  Integer-valued variables are given decimal values, while  string-\nvalued variables are given arbitrary text bracketed by double-quotes.  If a value is suffixed\nby “/G” or “/L”, then its value is useful in a global-only  or  local-only  context  (respec‐\ntively).\n\nA line of the form:\n\nignores=component,...\n\nspecifies a list of components which are never output.\n\nThe  component  “MessageName”  (case-insensitive)  will  output the actual message name (file\nname) preceded by the folder name if one is specified or found in the environment.  The  for‐\nmat is identical to that produced by the -header option to show.\n\nThe  component  “Extras”  will  output  all  of  the components of the message which were not\nmatched by explicit components, or included in the ignore list.  If  this  component  is  not\nspecified, an ignore list is not needed since all non-specified components will be ignored.\n\nIf  “nocomponent”  is  not specified, then the component name will be output as it appears in\nthe format file.\n\nThe default format file is:\n\n; mhl.format\n;\n; default message filter for `show'\n;\n:\noverflowtext=\"*\",overflowoffset=5\nleftadjust,compwidth=9\nignores=msgid,message-id,received,content-type,content-transfer-encoding,content-id\nDate:formatfield=\"%<(nodate{text})%{text}%|%(pretty{text})%>\"\nTo:\ncc:\nFrom:formatfield=\"%(unquote(decode{text}))\"\nSubject:decode\n:\nextras:nocomponent\n:\nbody:nocomponent,overflowtext=,overflowoffset=0,noleftadjust\n\nThe variable “formatfield” specifies a format string (see mh-format(5)).  The flag  variables\n“addrfield” and “datefield” (which are mutually exclusive), tell mhl to interpret the escapes\nin the format string as either addresses or dates, respectively.\n\nBy default, mhl does not apply any formatting string to fields containing  address  or  dates\n(see  mh-mail(5)  for  a  list  of these fields).  Note that this results in faster operation\nsince mhl must parse both addresses and dates in order to apply a format string to them.   If\ndesired,  mhl can be given a default format string for either address or date fields (but not\nboth).  To do this, on a global line specify: either the flag addrfield or  datefield,  along\nwith the appropriate formatfield variable string.\n\nThe “format” flag specifies that this component will be run through the filter program speci‐\nfied by the formatproc profile entry.  This filter program is expected to read data on  stan‐\ndard input and output data on standard output.  Currently the “format” flag is only supported\nfor the “body” component.  The component name will be prefixed to the output after the filter\nhas  been  run.  The expected use of this is to filter a message body to create more pleasing\ntext to use in a reply message.  A suggested filter to use for repl(1) is as follows:\n\nbody:component=\">\",overflowtext=\">\",overflowoffset=0,format,nowrap\n\nThe -fmtproc and -nofmtproc switches can be used to override the formatproc profile entry.\n\nThe formatarg option specifies a string that is used as an argument  to  the  format  filter.\nThis  string is processed by mh-format(5) and all of the message components are available for\nuse.  Multiple formatarg options can be used to build up multiple  arguments  to  the  format\nfilter.\n\n### FILES\n\n/etc/nmh/mhl.format        The message template\nor <mh-dir>/mhl.format     Rather than the standard template\n$HOME/.mhprofile          The user profile\n\n### PROFILE COMPONENTS\n\nmoreproc:            Program to use as interactive front-end\nformatproc:          Program to use as a filter for components that\nhave the “format” flag set.\n\n### SEE ALSO\n\nshow(1), ap(8), dp(8)\n\n### DEFAULTS\n\n`-bell'\n`-noclear'\n`-length 40'\n`-width 80'\n\n### CONTEXT\n\nNone\n\n### BUGS\n\nThere should be some way to pass `bell' and `clear' information to the front-end.\n\nThe “nonewline” option interacts badly with “compress” and “split”.\n\nThe “format” option really should work on something other than the body component.\n\n\n\nnmh-1.7.1                                    2014-09-15                                     MHL(1mh)\n\n"
        }
    ],
    "structuredContent": {
        "command": "MHL",
        "section": "1mh",
        "mode": "man",
        "summary": "mhl - produce formatted listings of nmh messages",
        "synopsis": "/usr/lib/mh/mhl [-help] [-version] [-bell | -nobell] [-clear | -noclear] [-folder +folder]\n[-form formfile] [-length lines] [-width columns] [-moreproc program] [-nomoreproc]\n[-fmtproc program] [-nofmtproc] [files ...]",
        "flags": [
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "ter each message). Both of these switches (and their inverse counterparts) take effect only if the profile entry moreproc is defined but empty, and mhl is outputting to a terminal. If the moreproc entry is defined and non-empty, and mhl is outputting to a terminal, then mhl will cause the moreproc to be placed between the terminal and mhl and the switches are ig‐ nored. Furthermore, if the -clear switch is used and mhl's output is directed to a terminal, then mhl will consult the TERM and TERMCAP environment variables to determine the user's ter‐ minal type in order to find out how to clear the screen. If the -clear switch is given and mhl's output is not directed to a terminal (e.g., a pipe or a file), then mhl will send a formfeed after each message. To override the default moreproc and the profile entry, use the -moreproc program switch. Note that mhl will never start a moreproc if invoked on a hardcopy terminal. The -length length and -width width switches set the screen length and width, respectively. These default to the values indicated by TERMCAP, if appropriate, otherwise they default to 40 and 80, respectively. The default format file used by mhl is called “mhl.format”. mhl will first search for this file in the user's nmh directory, and will then search in the directory /etc/nmh. This de‐ fault can be changed by using the -form formatfile switch. Finally, the -folder +folder switch sets the nmh folder name, which is used for the “message‐ name:” field described below. The environment variable $mhfolder is consulted for the de‐ fault value, which next, show, and prev initialize appropriately. mhl operates in two phases: 1) read and parse the format file, and 2) process each message (file). During phase 1, an internal description of the format is produced as a structured list. In phase 2, this list is walked for each message, outputting message information under the format constraints from the format file. The format file can contain information controlling screen clearing, screen size, wrap-around control, transparent text, component ordering, and component formatting. Also, a list of components to ignore may be specified, and a couple of “special” components are defined to provide added functionality. Message output will be in the order specified by the order in the format file. Each line of a format file has one of the following forms: ;comment :cleartext variable[,variable...] component:[variable,...] • A line beginning with a `;' is a comment, and is ignored. • A line beginning with a `:' is clear text, and is output exactly as is. • A line containing only a `:' produces a blank line in the output. • A line beginning with “component:” defines the format for the specified component, • Remaining lines define the global environment. For example, the line: width=80,length=40,clearscreen,overflowtext=\"*\",overflowoffset=5 defines the screen size to be 80 columns by 40 rows, specifies that the screen should be cleared prior to each page, that the overflow indentation is 5, and that overflow text should be flagged with “*”. Following are all of the current variables and their arguments. If they follow a component, they apply only to that component, otherwise, their affect is global. Since the whole format is parsed before any output processing, the last global switch setting for a variable applies to the whole message if that variable is used in a global context (i.e., bell, clearscreen, width, length). variable type semantics width integer screen width or component width length integer screen length or component length offset integer positions to indent “component: ” overflowtext string text to use at the beginning of an overflow line overflowoffset integer positions to indent overflow lines compwidth integer positions to indent component text after the first line is output uppercase flag output text of this component in all upper case nouppercase flag don't uppercase clearscreen flag/G clear the screen prior to each page noclearscreen flag/G don't clearscreen bell flag/G ring the bell at the end of each page nobell flag/G don't bell component string/L name to use instead of “component” for this component nocomponent flag don't output “component: ” for this component center flag center component on line (works for one-line components only) nocenter flag don't center leftadjust flag strip off leading whitespace on each line of text noleftadjust flag don't leftadjust rtrim flag trim whitespace at end of text lines nortrim flag retain whitespace at end of text lines (default) compress flag change newlines in text to spaces nocompress flag don't compress wrap flag Wrap lines that exceed width (default) nowrap flag Do not perform line wrapping split flag don't combine multiple fields into a single field nosplit flag combine multiple fields into a single field newline flag print newline at end of components (this is the default) nonewline flag don't print newline at end of components formatfield string format string for this component (see below) decode flag decode text as RFC 2047 encoded header field addrfield flag field contains addresses datefield flag field contains dates format flag Run component through formatproc filter (body only) noformat flag Do not run component through formatproc filter (default) formatarg string Argument to format filter To specify the value of integer-valued and string-valued variables, follow their name with an equals-sign and the value. Integer-valued variables are given decimal values, while string- valued variables are given arbitrary text bracketed by double-quotes. If a value is suffixed by “/G” or “/L”, then its value is useful in a global-only or local-only context (respec‐ tively). A line of the form: ignores=component,... specifies a list of components which are never output. The component “MessageName” (case-insensitive) will output the actual message name (file name) preceded by the folder name if one is specified or found in the environment. The for‐ mat is identical to that produced by the -header option to show. The component “Extras” will output all of the components of the message which were not matched by explicit components, or included in the ignore list. If this component is not specified, an ignore list is not needed since all non-specified components will be ignored. If “nocomponent” is not specified, then the component name will be output as it appears in the format file. The default format file is: ; mhl.format ; ; default message filter for `show' ; : overflowtext=\"*\",overflowoffset=5 leftadjust,compwidth=9 ignores=msgid,message-id,received,content-type,content-transfer-encoding,content-id Date:formatfield=\"%<(nodate{text})%{text}%|%(pretty{text})%>\" To: cc: From:formatfield=\"%(unquote(decode{text}))\" Subject:decode : extras:nocomponent : body:nocomponent,overflowtext=,overflowoffset=0,noleftadjust The variable “formatfield” specifies a format string (see mh-format(5)). The flag variables “addrfield” and “datefield” (which are mutually exclusive), tell mhl to interpret the escapes in the format string as either addresses or dates, respectively. By default, mhl does not apply any formatting string to fields containing address or dates (see mh-mail(5) for a list of these fields). Note that this results in faster operation since mhl must parse both addresses and dates in order to apply a format string to them. If desired, mhl can be given a default format string for either address or date fields (but not both). To do this, on a global line specify: either the flag addrfield or datefield, along with the appropriate formatfield variable string. The “format” flag specifies that this component will be run through the filter program speci‐ fied by the formatproc profile entry. This filter program is expected to read data on stan‐ dard input and output data on standard output. Currently the “format” flag is only supported for the “body” component. The component name will be prefixed to the output after the filter has been run. The expected use of this is to filter a message body to create more pleasing text to use in a reply message. A suggested filter to use for repl(1) is as follows: body:component=\">\",overflowtext=\">\",overflowoffset=0,format,nowrap The -fmtproc and -nofmtproc switches can be used to override the formatproc profile entry. The formatarg option specifies a string that is used as an argument to the format filter. This string is processed by mh-format(5) and all of the message components are available for use. Multiple formatarg options can be used to build up multiple arguments to the format filter."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "show",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/show/1/json"
            },
            {
                "name": "ap",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/ap/8/json"
            },
            {
                "name": "dp",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/dp/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 11,
                "subsections": [
                    {
                        "name": "-clear",
                        "lines": 189
                    }
                ]
            },
            {
                "name": "FILES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "PROFILE COMPONENTS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DEFAULTS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "CONTEXT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 9,
                "subsections": []
            }
        ]
    }
}