[PATCH 12/31] docs: favor `\[ha]` special character over `^`
"G. Branden Robinson" <[email protected]> Thu, 23 Apr 2026 17:58:54 -0500
| Newsgroups | gmane.editors.nano.devel |
|---|---|
| Message-ID | <20260423225854.3k7vr4qpwf4o4c2f@illithid> |
groff_man_style(7):
Portability
...
Exercise restraint with escape sequences as with requests. Some
escape sequences are however required for correct typesetting even
in man pages and usually do not cause portability problems.
Several of these render glyphs corresponding to punctuation code
points in the Unicode basic Latin range (U+0020–U+007F) that are
handled specially in roff input; the escape sequences below must be
used to render them correctly and portably when documenting
material that uses them as literals——namely, any of the set ' - \ ^
` ~ (apostrophe, dash or hyphen‐minus, backslash, caret, grave
accent, tilde).
...
Several special characters are also widely portable. Except for
\-, \[em], and \[ga], AT&T troff did not consistently define the
characters listed below, but its descendants, like DWB, Plan 9, or
Solaris troff, can be made to support them by defining them in font
description files, making them aliases of existing glyphs if
necessary; see groff_font(5). groff’s extended notation for
special characters, \[xx], is also supported by mandoc(1), Heirloom
Doctools troff, and neatroff, but not DWB, Plan 9, or Solaris
troffs.
...
\[ha] Basic Latin circumflex accent (“hat”). Some output devices
format “^” as U+02C6 (modifier letter circumflex accent).
This change was scripted.
$ sed -i -e 's/\^/\\[ha]/g' doc/*.[15]
---
doc/nano.1 | 70 ++++++++++++++++++++++++++--------------------------
doc/nanorc.5 | 36 +++++++++++++--------------
2 files changed, 53 insertions(+), 53 deletions(-)
diff --git a/doc/nano.1 b/doc/nano.1
index 22402b63..d275c746 100644
--- a/doc/nano.1
+++ b/doc/nano.1
@@ -48,16 +48,16 @@ .SH NOTICES
.EE
.RE
.P
-Since version 8.0, to be newcomer friendly, \fB^F\fR starts a forward search,
-\fB^B\fR starts a backward search, \fBM\-F\fR searches the next occurrence
+Since version 8.0, to be newcomer friendly, \fB\[ha]F\fR starts a forward search,
+\fB\[ha]B\fR starts a backward search, \fBM\-F\fR searches the next occurrence
forward, and \fBM\-B\fR searches the next occurrence backward. If you want
those keystrokes to do what they did before version 8.0, add the following
four lines at the end of your \fInanorc\fR file:
.P
.RS 4
.EX
-bind ^F forward main
-bind ^B back main
+bind \[ha]F forward main
+bind \[ha]B back main
bind M\-F formatter main
bind M\-B linter main
.EE
@@ -97,18 +97,18 @@ .SH DESCRIPTION
.SH EDITING
Entering text and moving around in a file is straightforward: typing the
letters and using the normal cursor movement keys. Commands are entered
-by using the Control (^) and the Alt or Meta (M\-) keys.
-Typing \fB^K\fR deletes the current line and puts it in the cutbuffer.
-Consecutive \fB^K\fRs put all deleted lines together in the cutbuffer.
+by using the Control (\[ha]) and the Alt or Meta (M\-) keys.
+Typing \fB\[ha]K\fR deletes the current line and puts it in the cutbuffer.
+Consecutive \fB\[ha]K\fRs put all deleted lines together in the cutbuffer.
Any cursor movement or executing any other command causes the next
-\fB^K\fR to overwrite the cutbuffer. A \fB^U\fR pastes the current
+\fB\[ha]K\fR to overwrite the cutbuffer. A \fB\[ha]U\fR pastes the current
contents of the cutbuffer at the current cursor position.
.P
When a more precise piece of text needs to be cut or copied, you can mark
-its start with \fB^6\fR, move the cursor to its end (the marked text is
-highlighted), and then use \fB^K\fR to cut it, or \fBM\-6\fR to copy it to
-the cutbuffer. You can also save the marked text to a file with \fB^O\fR,
-or spell check it with \fB^T^T\fR.
+its start with \fB\[ha]6\fR, move the cursor to its end (the marked text is
+highlighted), and then use \fB\[ha]K\fR to cut it, or \fBM\-6\fR to copy it to
+the cutbuffer. You can also save the marked text to a file with \fB\[ha]O\fR,
+or spell check it with \fB\[ha]T\[ha]T\fR.
.P
On some terminals, text can be selected also by holding down Shift while
using the arrow keys. Holding down the Ctrl or Alt key too increases
@@ -118,11 +118,11 @@ .SH EDITING
Any valid Unicode code point can be inserted into the buffer by typing
\fBM\-V\fR followed by the hexadecimal digits of the code point (concluded
with \fB<Space>\fR or \fB<Enter>\fR when it are fewer than six digits).
-A literal control code (except \fB^J\fR) can be inserted by typing
+A literal control code (except \fB\[ha]J\fR) can be inserted by typing
\fBM\-V\fR followed by the pertinent keystroke.
.P
The two lines at the bottom of the screen show some important commands;
-the built-in help (\fB^G\fR) lists all the available ones.
+the built-in help (\fB\[ha]G\fR) lists all the available ones.
The default key bindings can be changed via a \fInanorc\fR file \[em] see
.BR nanorc (5).
.
@@ -203,7 +203,7 @@ .SH OPTIONS
.TP
.BI "\-Q \[dq]" regex "\[dq]\fR, \fB\-\-quotestr=\[dq]" regex \[dq]
Set the regular expression for matching the quoting part of a line.
-The default value is "\fB^([\ \\t]*([!#%:;>|}]|//))+\fR".
+The default value is "\fB\[ha]([\ \\t]*([!#%:;>|}]|//))+\fR".
(Note that \fB\\t\fR stands for an actual Tab.)
This makes it possible to rejustify blocks of quoted text when composing
email, and to rewrap blocks of line comments when writing source code.
@@ -299,7 +299,7 @@ .SH OPTIONS
Scroll the buffer contents per half-screen instead of per line.
.TP
.BR \-k ", " \-\-cutfromcursor
-Make the 'Cut Text' command (normally \fB^K\fR) cut from the current cursor
+Make the 'Cut Text' command (normally \fB\[ha]K\fR) cut from the current cursor
position to the end of the line, instead of cutting the entire line.
.TP
.BR \-l ", " \-\-linenumbers
@@ -325,7 +325,7 @@ .SH OPTIONS
files only in this directory and its subdirectories.
.TP
.BR \-p ", " \-\-preserve
-Preserve the XOFF and XON sequences (\fB^S\fR and \fB^Q\fR) so that
+Preserve the XOFF and XON sequences (\fB\[ha]S\fR and \fB\[ha]Q\fR) so that
they are caught by the terminal (stopping and resuming the output).
Note that option \fB\-/\fR (\fB\-\-modernbindings\fR) overrides this.
.TP
@@ -347,7 +347,7 @@ .SH OPTIONS
using the built-in corrector that calls \fBhunspell\fR(1) or \fBspell\fR(1).
.TP
.BR \-t ", " \-\-saveonexit
-Save a changed buffer without prompting (when exiting with \fB^X\fR).
+Save a changed buffer without prompting (when exiting with \fB\[ha]X\fR).
.TP
.BR \-u ", " \-\-unix
Save a file by default in Unix format. This overrides nano's
@@ -430,15 +430,15 @@ .SH OPTIONS
.TP
.BR \-/ ", " \-\-modernbindings
Use key bindings similar to the ones that most modern programs use:
-\fB^X\fR cuts, \fB^C\fR copies, \fB^V\fR pastes,
-\fB^Z\fR undoes, \fB^Y\fR redoes,
-\fB^F\fR searches forward, \fB^G\fR searches next,
-\fB^S\fR saves, \fB^O\fR opens a file, \fB^Q\fR quits,
-and (when the terminal permits) \fB^H\fR shows help.
-Furthermore, \fB^A\fR sets the mark, \fB^B\fR searches backward,
-\fB^D\fR searches previous, \fB^R\fR makes replacements,
-\fB^P\fR shows the position, \fB^T\fR goes to a line,
-\fB^W\fR writes out a file, and \fB^E\fR executes a command.
+\fB\[ha]X\fR cuts, \fB\[ha]C\fR copies, \fB\[ha]V\fR pastes,
+\fB\[ha]Z\fR undoes, \fB\[ha]Y\fR redoes,
+\fB\[ha]F\fR searches forward, \fB\[ha]G\fR searches next,
+\fB\[ha]S\fR saves, \fB\[ha]O\fR opens a file, \fB\[ha]Q\fR quits,
+and (when the terminal permits) \fB\[ha]H\fR shows help.
+Furthermore, \fB\[ha]A\fR sets the mark, \fB\[ha]B\fR searches backward,
+\fB\[ha]D\fR searches previous, \fB\[ha]R\fR makes replacements,
+\fB\[ha]P\fR shows the position, \fB\[ha]T\fR goes to a line,
+\fB\[ha]W\fR writes out a file, and \fB\[ha]E\fR executes a command.
Note that this option overrides option \fB\-p\fR \%(\fB\-\-preserve\fR).
.
.SH TOGGLES
@@ -447,7 +447,7 @@ .SH TOGGLES
hard-wrapping of long lines, \fBM\-S\fR toggles soft-wrapping,
\fBM\-N\fR toggles line numbers, \fBM\-M\fR toggles the mouse,
\fBM\-I\fR auto-indentation, and \fBM\-X\fR the help lines.
-See at the end of the \fB^G\fR help text for a complete list.
+See at the end of the \fB\[ha]G\fR help text for a complete list.
.P
The \fBM\-X\fR toggle is special: it works in all menus except
the help viewer and the linter. All other toggles work in
@@ -475,16 +475,16 @@ .SH EXIT STATUS
An invalid option or option argument was given.
.TP
.B 2
-The last open buffer was discarded (with \fB^O^Q\fR or \fB^X^Q\fR).
+The last open buffer was discarded (with \fB\[ha]O\[ha]Q\fR or \fB\[ha]X\[ha]Q\fR).
.
.SH NOTES
-Suspension is enabled by default, reachable via \fB^T^Z\fR.
-(If you want a plain \fB^Z\fR to suspend nano, add
-\fBbind ^Z suspend main\fR to your nanorc.)
+Suspension is enabled by default, reachable via \fB\[ha]T\[ha]Z\fR.
+(If you want a plain \fB\[ha]Z\fR to suspend nano, add
+\fBbind \[ha]Z suspend main\fR to your nanorc.)
.P
-At a Yes-No prompt, \fB^Y\fR can be used for "Yes", \fB^N\fR for "No",
-and \fB^A\fR for "All".
-(And when exiting, \fB^Q\fR can be used for "Quit with error".)
+At a Yes-No prompt, \fB\[ha]Y\fR can be used for "Yes", \fB\[ha]N\fR for "No",
+and \fB\[ha]A\fR for "All".
+(And when exiting, \fB\[ha]Q\fR can be used for "Quit with error".)
These unlisted bindings work in any locale.
.P
When you want to copy marked text from \fBnano\fR to the system's clipboard,
diff --git a/doc/nanorc.5 b/doc/nanorc.5
index 979d310a..485787bf 100644
--- a/doc/nanorc.5
+++ b/doc/nanorc.5
@@ -52,8 +52,8 @@ .SH NOTICES
.EE
.RE
.P
-Since version 8.0, to be newcomer friendly, \fB^F\fR starts a forward search,
-\fB^B\fR starts a backward search, \fBM\-F\fR searches the next occurrence
+Since version 8.0, to be newcomer friendly, \fB\[ha]F\fR starts a forward search,
+\fB\[ha]B\fR starts a backward search, \fBM\-F\fR searches the next occurrence
forward, and \fBM\-B\fR searches the next occurrence backward. If you want
those keystrokes to do what they did before version 8.0, add the following
four lines at the end of your \fInanorc\fR file:
@@ -246,7 +246,7 @@ .SH OPTIONS
selected through dragging by holding down the Shift key.
.TP
.B set multibuffer
-When reading in a file with \fB^R\fR, insert it into a new buffer by default.
+When reading in a file with \fB\[ha]R\fR, insert it into a new buffer by default.
.TP
.B set noconvert
Don't convert files from DOS format.
@@ -275,7 +275,7 @@ .SH OPTIONS
These positions are remembered for the 200 most-recently edited files.
.TP
.B set preserve
-Preserve the XOFF and XON sequences (\fB^S\fR and \fB^Q\fR) so that
+Preserve the XOFF and XON sequences (\fB\[ha]S\fR and \fB\[ha]Q\fR) so that
they are caught by the terminal (stopping and resuming the output).
.TP
.B set promptcolor \fR[\fBbold,\fR][\fBitalic,\fR]\fIfgcolor\fB,\fIbgcolor\fR
@@ -298,7 +298,7 @@ .SH OPTIONS
.TP
.BI "set quotestr \[dq]" regex \[dq]
Set the regular expression for matching the quoting part of a line.
-The default value is "\fB^([\ \et]*([!#%:;>|}]|//))+\fR".
+The default value is "\fB\[ha]([\ \et]*([!#%:;>|}]|//))+\fR".
(Note that \fB\et\fR stands for an actual Tab character.)
This makes it possible to rejustify blocks of quoted text when composing
email, and to rewrap blocks of line comments when writing source code.
@@ -321,7 +321,7 @@ .SH OPTIONS
Regular expressions in \fBnano\fR are of the extended type (ERE).
.TP
.B set saveonexit
-Save a changed buffer automatically on exit (\fB^X\fR); don't prompt.
+Save a changed buffer automatically on exit (\fB\[ha]X\fR); don't prompt.
.TP
.B set scrollercolor \fIfgcolor\fB,\fIbgcolor\fR
Use this color combination for the indicator alias "scrollbar".
@@ -462,13 +462,13 @@ .SH SYNTAX HIGHLIGHTING
good fit for a small editor like \fBnano\fR.
.P
All regular expressions in \fBnano\fR are POSIX extended regular expressions.
-This means that \fB.\fR, \fB?\fR, \fB*\fR, \fB+\fR, \fB^\fR, \fB$\fR, and
+This means that \fB.\fR, \fB?\fR, \fB*\fR, \fB+\fR, \fB\[ha]\fR, \fB$\fR, and
several other characters are special.
The period \fB.\fR matches any single character,
\fB?\fR means the preceding item is optional,
\fB*\fR means the preceding item may be matched zero or more times,
\fB+\fR means the preceding item must be matched one or more times,
-\fB^\fR matches the beginning of a line, and \fB$\fR the end,
+\fB\[ha]\fR matches the beginning of a line, and \fB$\fR the end,
\fB\e<\fR matches the start of a word, and \fB\e>\fR the end,
and \fB\es\fR matches a blank.
It also means that lookahead and lookbehind are not possible.
@@ -633,10 +633,10 @@ .SH REBINDING KEYS
The format of \fIkey\fR should be one of:
.RS 3
.TP 7
-.BI ^ X
+.BI \[ha] X
where \fIX\fR is a Latin letter, or one of several ASCII characters
-(@, ], \e, ^, _), or the word "Space".
-Example: ^C.
+(@, ], \e, \[ha], _), or the word "Space".
+Example: \[ha]C.
.TP
.BI M\- X
where \fIX\fR is any ASCII character (except [),
@@ -658,12 +658,12 @@ .SH REBINDING KEYS
.BR Ins " or " Del .
.RE
.P
-Rebinding \fB^M\fR (Enter) or \fB^I\fR (Tab) is probably not a good idea.
-Rebinding \fB^[\fR (Esc) is not possible, because its keycode
+Rebinding \fB\[ha]M\fR (Enter) or \fB\[ha]I\fR (Tab) is probably not a good idea.
+Rebinding \fB\[ha][\fR (Esc) is not possible, because its keycode
is the starter byte of Meta keystrokes and escape sequences.
Rebinding any of the dedicated cursor-moving keys (the arrows,
Home, End, PageUp and PageDown) is not possible.
-On some terminals it's not possible to rebind \fB^H\fR (unless \fB\-\-raw\fR
+On some terminals it's not possible to rebind \fB\[ha]H\fR (unless \fB\-\-raw\fR
is used) because its keycode is identical to that of the Backspace key.
.
.TP
@@ -723,8 +723,8 @@ .SH REBINDING KEYS
.B chopwordleft
Deletes from the cursor position to the beginning of the preceding word.
(This function is bound by default to <Shift+Ctrl+Delete>. If your terminal
-produces \fB^H\fR for <Ctrl+Backspace>, you can make <Ctrl+Backspace> delete
-the word to the left of the cursor by rebinding \fB^H\fR to this function.)
+produces \fB\[ha]H\fR for <Ctrl+Backspace>, you can make <Ctrl+Backspace> delete
+the word to the left of the cursor by rebinding \fB\[ha]H\fR to this function.)
.TP
.B chopwordright
Deletes from the cursor position to the beginning of the next word.
@@ -768,7 +768,7 @@ .SH REBINDING KEYS
some message", then the cursor is put at the indicated position
in the mentioned file while showing "some message" on the status bar.
You can move from message to message with <PgUp> and <PgDn>,
-and leave linting mode with \fB^C\fR or <Enter>.
+and leave linting mode with \fB\[ha]C\fR or <Enter>.
.TP
.B justify
Justifies the current paragraph (or the marked region).
@@ -1117,7 +1117,7 @@ .SH EXAMPLES
.P
.RS
.EX
-bind ^Z suspend main
+bind \[ha]Z suspend main
.EE
.RE
.P
--
2.30.2
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmnqpC4ACgkQ0Z6cfXEm bc6cyQ/+MopbXelgSX7R00Ehci0Yt2U+Q2MzxLHaezRrj7u7aSwSKGBHylA+FIB2 jLDfCM/scF0L3592lOK76dq6YOGXOk3b+5Lh2HMS2+Dl90As0sLX+2/ERhueOIXF 7sRXZhj8zPAlab/NkOEEkwpN6x+pvH/hopgR+HaQf4oZ4nq8QjWOt58usp3Y3WzX kRArz50oooCTRxPKv+zT+lfRayssMAZbashh25mlgnIO61zF5u6QTUvHO6fDGSdB 5FLw0A5z9gFnlcTfQTIXtkfwuWP2b0C7JteykVUMfI+6oOJDzYDzeotFaGRN+wUg wDoQ08ZGz+llza/dllIWtvnNjJ3A79Lq6b2XYLPskOdzu6L8LCtxitv+G5HcKU/O 8CCbTbXrZtUWmYMHTG6e3kCMAT59jaQmPiBOjLCNREojGbGEz6frriIqQkSvfKSc J9onlz34pAZgD0X58ycb/o0CSVXxvypDamZsxhuOkmKg46nc7yuAUtdM7YBaG4VD G+KBZ/sHt2NovbaAX1NS0xPleh4w/8LHBiv+VQs+bmZ5i0Q+dPkhQ7yRgUg8Ikfs bErTHs0WJ9rBI68xRW96gd/IBgrboA7spZHkDQmNe5wGe9EBwfWT6MhtOdyOHNsS OWngYluP/ONDGbiJzn2rhoJhFzU6KjeJ0lJM0MzvpbQN+b4efjo= =vXC7 -----END PGP SIGNATURE-----