[PATCH 06/31] docs: use `EX`/`EE` calls for monospaced examples
"G. Branden Robinson" <[email protected]> Thu, 23 Apr 2026 17:58:00 -0500
| Newsgroups | gmane.editors.nano.devel |
|---|---|
| Message-ID | <20260423225800.w67keh7i3nifyc73@illithid> |
Employing these macros has two advantages.
1. There's no need to manually specify line breaks with the `br`
request.
2. They use a monospaced typeface on devices that support changing the
font family.
Also remove boldfacing from displayed examples; it's unnecessary in my
opinion, since the examples are already distinguished by being
displayed, due to their indentation and surrounding vertical space.
Also drop unnecessary `P` macro call immediately preceding a sectioning
macro call in nanorc(5).
Also since an example line no longer uses a macro call, we don't need to
specify three double quotes """ in a row to get just one.
groff_man(7):
Document structure macros
...
.EX
.EE Begin and end example. After EX, filling is disabled (and,
on typesetters, a monospaced font family is selected).
Calling EE enables filling (and restores the previous
family).
Ninth Edition Unix introduced the EX and EE extensions.
Documenter’s Workbench (DWB), Heirloom Doctools, and Plan 9
troffs, and mandoc (since 1.12.2) support them. Solaris
troff does not.
If nano supports deployment on System V Unix hosts, there is a remedy,
but even Solaris, as of version 11, uses groff for man page rendering.
Other System V Unices seem to be end-of-lifed and/or have had groff
ported to them (specifically, HP-UX and AIX).
groff_man_style(7):
Use of extensions
To ensure that your man page formats reliably on a wide variety of
viewers, write it solely with the macros described in this page
(except for the ones identified as deprecated, which you should
avoid). Macros described as extensions might be unsupported by a
formatter that is important to your audience. Nevertheless,
groff’s extensions are present because they perform tasks that are
otherwise difficult or tedious to achieve portably. If you require
an extension but expect your man page to be rendered on a system
that doesn’t support it, write a configuration test to measure a
property of the system, and use m4(1), sed(1), or a similar tool to
generate a .man file from a .man.in file, defining page‐local
versions of extension macros only where necessary. You can copy
extension macro definitions from groff; see an-ext.tmac in section
“Files” below.
...
/usr/local/share/groff/1.24.1/tmac/an-ext.tmac
Definitions of macros described above as extensions (and not
deprecated) are contained in this file; in some cases, they
are simpler versions of definitions appearing in an.tmac,
and are ignored if the formatter is GNU troff. They are
written to be compatible with AT&T troff and permissively
licensed——not copylefted. To reduce the risk of name space
collisions, string and register names begin only with “m”.
We encourage man page authors who are concerned about
portability to legacy Unix systems to copy these definitions
into their pages, and maintainers of troff implementations
or work‐alike systems that format man pages to re‐use them.
To ensure reliable rendering, define them after your page
calls TH; see the discussion of andoc.tmac above. Further,
it is wise to define such page‐local macros (if at all)
after the “Name” section to accommodate timid makewhatis(8)
or mandb(8) implementations that easily give up scanning for
indexing material.
---
doc/nano.1 | 25 ++++++++++++++-----------
doc/nanorc.5 | 30 ++++++++++++++++--------------
2 files changed, 30 insertions(+), 25 deletions(-)
diff --git a/doc/nano.1 b/doc/nano.1
index 18acf61f..cfdff8af 100644
--- a/doc/nano.1
+++ b/doc/nano.1
@@ -42,9 +42,10 @@ .SH NOTICES
add these two lines at the end of your \fInanorc\fR file:
.P
.RS 4
-.B bind M\-< prevbuf main
-.br
-.B bind M\-> nextbuf main
+.EX
+bind M\-< prevbuf main
+bind M\-> nextbuf main
+.EE
.RE
.P
Since version 8.0, to be newcomer friendly, \fB^F\fR starts a forward search,
@@ -54,13 +55,12 @@ .SH NOTICES
four lines at the end of your \fInanorc\fR file:
.P
.RS 4
-.B bind ^F forward main
-.br
-.B bind ^B back main
-.br
-.B bind M\-F formatter main
-.br
-.B bind M\-B linter main
+.EX
+bind ^F forward main
+bind ^B back main
+bind M\-F formatter main
+bind M\-B linter main
+.EE
.RE
.P
.
@@ -85,7 +85,10 @@ .SH DESCRIPTION
the first occurrence of the word "Foo", you would do:
.P
.RS 4
-.BI "nano +c/Foo " file
+.EX
+nano +c/Foo \c
+.I file
+.EE
.RE
.P
As a special case: if instead of a filename a dash (\fB\-\fR) is given,
diff --git a/doc/nanorc.5 b/doc/nanorc.5
index 4afa99d4..eef5bced 100644
--- a/doc/nanorc.5
+++ b/doc/nanorc.5
@@ -46,9 +46,10 @@ .SH NOTICES
add these two lines at the end of your \fInanorc\fR file:
.P
.RS 4
-.B bind M\-< prevbuf main
-.br
-.B bind M\-> nextbuf main
+.EX
+bind M\-< prevbuf main
+bind M\-> nextbuf main
+.EE
.RE
.P
Since version 8.0, to be newcomer friendly, \fB^F\fR starts a forward search,
@@ -58,15 +59,13 @@ .SH NOTICES
four lines at the end of your \fInanorc\fR file:
.P
.RS 4
-.B bind ^F forward main
-.br
-.B bind ^B back main
-.br
-.B bind M\-F formatter main
-.br
-.B bind M\-B linter main
+.EX
+bind ^F forward main
+bind ^B back main
+bind M\-F formatter main
+bind M\-B linter main
+.EE
.RE
-.P
.
.SH OPTIONS
The configuration file accepts a series of \fBset\fR and \fBunset\fR
@@ -1117,15 +1116,18 @@ .SH EXAMPLES
To make \fBCtrl+Z\fR suspend nano:
.P
.RS
-.B bind ^Z suspend main
+.EX
+bind ^Z suspend main
+.EE
.RE
.P
To make \fBShift+Alt+C\fR copy the marked region to the system's clipboard:
.P
.RS
-.B bind Sh\-M\-C """{execute}| xsel \-ib {enter}{undo}""" main
+.EX
+bind Sh\-M\-C "{execute}| xsel \-ib {enter}{undo}" main
+.EE
.RE
-.P
.
.SH FILES
.TP
--
2.30.2
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmnqo/gACgkQ0Z6cfXEm bc6e+g//aGej3WE9m1kfNXEuiSztGhGxZhshwjtRXiiVkaIB4xENOEBxGT1TNfJA goNO/jV1MjPq43sb7qxbhyPXl2J620uvsfIawWzaBrfcvEzHCX/hYt0p69XixCIH h8LphYTV6YxJl+DXP5dldHZNc0gWKSoRI8vuLiHZJ3l+tciT4Mj+9H9yHUwJJNQU NjxwNPsU6NJ/AE9hG499NfJmKVmgwACZHlICzcZZP+CwAWyULCQOLuEQmJ4KX/eq 2IXcbJ08lPK8Bo6TsvmH5nvdf7jYY7hyxyPUALZpsenEJ7yR3q+fIHe2KIJhygFr Gzt0bc3UrLxhlBi3B3geABj6Mgi0KMU7D1MRtqd0mIie6g1KXs05KWmQ4DEIgUZ4 BBaB8GL+SAY8JdIp6/ZDvuLg0yDc6tyb6+jV1ab4AHhxLyrbP6AjFa8l8lxTdFAR RI44Fv8XTZtzXVf3BrDcFl4SrsVXu53yZucs3DXoXVYuCROtJVonNbDP6kVLbInt lvecNcrC7cvg+9FOxTaBLLq3WFz8ySGz//2EFXmeVSyywgByVl7d4YO37xFv/EJn RFkMRGFCwKLsTo3MYGYAl2rX77xIil5dU99dyvhfG5ZBBPM0HqJqPtF5LaA+f5gc 7rMh5e24wuFYFSVX3KQ4x8+DSuG25Az3uIyg+XbEVL0N16C9A/Y= =AXjR -----END PGP SIGNATURE-----