summaryrefslogtreecommitdiff
path: root/doc/texinfo
diff options
context:
space:
mode:
Diffstat (limited to 'doc/texinfo')
-rw-r--r--doc/texinfo/Makefile.in237
-rw-r--r--doc/texinfo/nano.html2322
-rw-r--r--doc/texinfo/nano.info1436
-rw-r--r--doc/texinfo/nano.texi1114
-rw-r--r--doc/texinfo/texinfo.tex2370
5 files changed, 5254 insertions, 2225 deletions
diff --git a/doc/texinfo/Makefile.in b/doc/texinfo/Makefile.in
index 386be23..c46889e 100644
--- a/doc/texinfo/Makefile.in
+++ b/doc/texinfo/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,51 @@
@SET_MAKE@
VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -33,11 +77,12 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-target_triplet = @target@
subdir = doc/texinfo
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in texinfo.tex
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/mkinstalldirs texinfo.tex
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
+ $(top_srcdir)/m4/ax_check_compile_flag.m4 \
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glib-2.0.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/isc-posix.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
@@ -49,8 +94,48 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
SOURCES =
DIST_SOURCES =
+AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
+am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
+am__v_DVIPS_0 = @echo " DVIPS " $@;
+am__v_DVIPS_1 =
+AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
+am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
+am__v_MAKEINFO_0 = @echo " MAKEINFO" $@;
+am__v_MAKEINFO_1 =
+AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
+am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
+am__v_INFOHTML_0 = @echo " INFOHTML" $@;
+am__v_INFOHTML_1 =
+AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
+am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
+am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@;
+am__v_TEXI2DVI_1 =
+AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
+am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
+am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@;
+am__v_TEXI2PDF_1 =
+AM_V_texinfo = $(am__v_texinfo_@AM_V@)
+am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
+am__v_texinfo_0 = -q
+am__v_texinfo_1 =
+AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
+am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
+am__v_texidevnull_0 = > /dev/null
+am__v_texidevnull_1 =
INFO_DEPS = $(srcdir)/nano.info
am__TEXINFO_TEX_DIR = $(srcdir)
DVIS = nano.dvi
@@ -63,6 +148,11 @@ TEXI2PDF = $(TEXI2DVI) --pdf --batch
MAKEINFOHTML = $(MAKEINFO) --html
AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
DVIPS = dvips
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
am__installdirs = "$(DESTDIR)$(infodir)"
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
@@ -85,9 +175,17 @@ am__nobase_list = $(am__nobase_strip_setup); \
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -133,6 +231,11 @@ MKDIR_P = @MKDIR_P@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
+NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
+NCURSESW_CONFIG = @NCURSESW_CONFIG@
+NCURSESW_LIBS = @NCURSESW_LIBS@
+NCURSES_CFLAGS = @NCURSES_CFLAGS@
+NCURSES_LIBS = @NCURSES_LIBS@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -144,6 +247,8 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGDATADIR = @PKGDATADIR@
PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POSUB = @POSUB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -173,6 +278,7 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+haveit = @haveit@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
@@ -197,11 +303,7 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
-target = @target@
target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
@@ -245,7 +347,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
.texi.info:
- restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+ $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
am__cwd=`pwd` && $(am__cd) $(srcdir) && \
rm -rf $$backupdir && mkdir $$backupdir && \
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
@@ -267,34 +369,32 @@ $(am__aclocal_m4_deps):
rm -rf $$backupdir; exit $$rc
.texi.dvi:
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2DVI) $<
+ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
+ $<
.texi.pdf:
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2PDF) $<
+ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
+ $<
.texi.html:
- rm -rf $(@:.html=.htp)
- if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+ $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
+ $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-o $(@:.html=.htp) $<; \
then \
- rm -rf $@; \
- if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
- mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
+ rm -rf $@ && mv $(@:.html=.htp) $@; \
else \
- if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
- rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
- exit 1; \
+ rm -rf $(@:.html=.htp); exit 1; \
fi
$(srcdir)/nano.info: nano.texi
nano.dvi: nano.texi
nano.pdf: nano.texi
.dvi.ps:
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- $(DVIPS) -o $@ $<
+ $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ $(DVIPS) $(AM_V_texinfo) -o $@ $<
uninstall-dvi-am:
@$(NORMAL_UNINSTALL)
@@ -316,9 +416,7 @@ uninstall-html-am:
uninstall-info-am:
@$(PRE_UNINSTALL)
- @if test -d '$(DESTDIR)$(infodir)' && \
- (install-info --version && \
- install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+ @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
@@ -375,9 +473,7 @@ dist-info: $(INFO_DEPS)
done
mostlyclean-aminfo:
- -rm -rf nano.aux nano.cp nano.cps nano.fn nano.fns nano.ky nano.kys \
- nano.log nano.pg nano.pgs nano.tmp nano.toc nano.tp nano.tps \
- nano.vr nano.vrs
+ -rm -rf nano.t2d nano.t2p
clean-aminfo:
-test -z "nano.dvi nano.pdf nano.ps nano.html" \
@@ -389,11 +485,11 @@ maintainer-clean-aminfo:
echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
done
-tags: TAGS
-TAGS:
+tags TAGS:
+
+ctags CTAGS:
-ctags: CTAGS
-CTAGS:
+cscope cscopelist:
distdir: $(DISTFILES)
@@ -448,10 +544,15 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
mostlyclean-generic:
clean-generic:
@@ -490,8 +591,11 @@ install-dvi: install-dvi-am
install-dvi-am: $(DVIS)
@$(NORMAL_INSTALL)
- test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)"
@list='$(DVIS)'; test -n "$(dvidir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -506,18 +610,22 @@ install-html: install-html-am
install-html-am: $(HTMLS)
@$(NORMAL_INSTALL)
- test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
@list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
$(am__strip_dir) \
- if test -d "$$d$$p"; then \
+ d2=$$d$$p; \
+ if test -d "$$d2"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
$(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
- echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
+ echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+ $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
else \
- list2="$$list2 $$d$$p"; \
+ list2="$$list2 $$d2"; \
fi; \
done; \
test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
@@ -529,9 +637,12 @@ install-info: install-info-am
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
- test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
+ fi; \
for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
@@ -549,8 +660,7 @@ install-info-am: $(INFO_DEPS)
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
@$(POST_INSTALL)
- @if (install-info --version && \
- install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+ @if $(am__can_run_installinfo); then \
list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
@@ -564,8 +674,11 @@ install-pdf: install-pdf-am
install-pdf-am: $(PDFS)
@$(NORMAL_INSTALL)
- test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
@list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -577,8 +690,11 @@ install-ps: install-ps-am
install-ps-am: $(PSS)
@$(NORMAL_INSTALL)
- test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)"
@list='$(PSS)'; test -n "$(psdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -611,16 +727,17 @@ uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
.MAKE: all check install install-am install-strip
.PHONY: all all-am check check-am clean clean-aminfo clean-generic \
- dist-info distclean distclean-generic distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-aminfo maintainer-clean-generic mostlyclean \
- mostlyclean-aminfo mostlyclean-generic pdf pdf-am ps ps-am \
- uninstall uninstall-am uninstall-dvi-am uninstall-html-am \
+ cscopelist-am ctags-am dist-info distclean distclean-generic \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-aminfo \
+ maintainer-clean-generic mostlyclean mostlyclean-aminfo \
+ mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \
+ uninstall-am uninstall-dvi-am uninstall-html-am \
uninstall-info-am uninstall-pdf-am uninstall-ps-am
diff --git a/doc/texinfo/nano.html b/doc/texinfo/nano.html
index b673557..0568413 100644
--- a/doc/texinfo/nano.html
+++ b/doc/texinfo/nano.html
@@ -1,363 +1,583 @@
-<html lang="en">
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>nano Command Manual</title>
-<meta http-equiv="Content-Type" content="text/html">
+
<meta name="description" content="nano Command Manual">
-<meta name="generator" content="makeinfo 4.13">
-<link title="Top" rel="top" href="#Top">
-<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
-<meta http-equiv="Content-Style-Type" content="text/css">
-<style type="text/css"><!--
- pre.display { font-family:inherit }
- pre.format { font-family:inherit }
- pre.smalldisplay { font-family:inherit; font-size:smaller }
- pre.smallformat { font-family:inherit; font-size:smaller }
- pre.smallexample { font-size:smaller }
- pre.smalllisp { font-size:smaller }
- span.sc { font-variant:small-caps }
- span.roman { font-family:serif; font-weight:normal; }
- span.sansserif { font-family:sans-serif; font-weight:normal; }
---></style>
+<meta name="keywords" content="nano Command Manual">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="Generator" content="makeinfo">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link href="#Top" rel="start" title="Top">
+<link href="#SEC_Contents" rel="contents" title="Table of Contents">
+<link href="dir.html#Top" rel="up" title="(dir)">
+<style type="text/css">
+<!--
+a.summary-letter {text-decoration: none}
+blockquote.smallquotation {font-size: smaller}
+div.display {margin-left: 3.2em}
+div.example {margin-left: 3.2em}
+div.indentedblock {margin-left: 3.2em}
+div.lisp {margin-left: 3.2em}
+div.smalldisplay {margin-left: 3.2em}
+div.smallexample {margin-left: 3.2em}
+div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
+div.smalllisp {margin-left: 3.2em}
+kbd {font-style:oblique}
+pre.display {font-family: inherit}
+pre.format {font-family: inherit}
+pre.menu-comment {font-family: serif}
+pre.menu-preformatted {font-family: serif}
+pre.smalldisplay {font-family: inherit; font-size: smaller}
+pre.smallexample {font-size: smaller}
+pre.smallformat {font-family: inherit; font-size: smaller}
+pre.smalllisp {font-size: smaller}
+span.nocodebreak {white-space:nowrap}
+span.nolinebreak {white-space:nowrap}
+span.roman {font-family:serif; font-weight:normal}
+span.sansserif {font-family:sans-serif; font-weight:normal}
+ul.no-bullet {list-style: none}
+-->
+</style>
+
+
</head>
-<body>
-<h1 class="settitle">nano Command Manual</h1>
-<div class="node">
-<a name="Top"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#Introduction">Introduction</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
-</div>
+<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
+<h1 class="settitle" align="center">nano Command Manual</h1>
- <p>This manual documents GNU <code>nano</code>, a small and friendly text
-editor.
-<ul class="menu">
-<li><a accesskey="1" href="#Introduction">Introduction</a>
-<li><a accesskey="2" href="#Editor-Basics">Editor Basics</a>
-<li><a accesskey="3" href="#Online-Help">Online Help</a>
-<li><a accesskey="4" href="#Feature-Toggles">Feature Toggles</a>
-<li><a accesskey="5" href="#Nanorc-Files">Nanorc Files</a>
-<li><a accesskey="6" href="#The-File-Browser">The File Browser</a>
-<li><a accesskey="7" href="#Pico-Compatibility">Pico Compatibility</a>
-<li><a accesskey="8" href="#Building-and-Configure-Options">Building and Configure Options</a>
-</ul>
-<div class="node">
-<a name="Introduction"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#Editor-Basics">Editor Basics</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+
+
+<a name="Top"></a>
+<div class="header">
+<p>
+Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
+<a name="SEC_Top"></a>
+<p>This manual documents GNU <code>nano</code>, a small and friendly text
+editor.
+</p>
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top">&bull; <a href="#Introduction" accesskey="1">Introduction</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Editor-Basics" accesskey="2">Editor Basics</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Online-Help" accesskey="3">Online Help</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Feature-Toggles" accesskey="4">Feature Toggles</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Nanorc-Files" accesskey="5">Nanorc Files</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#The-File-Browser" accesskey="6">The File Browser</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Pico-Compatibility" accesskey="7">Pico Compatibility</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Building-and-Configure-Options" accesskey="8">Building and Configure Options</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+</table>
+
+
+<hr>
+<a name="Introduction"></a>
+<div class="header">
+<p>
+Next: <a href="#Editor-Basics" accesskey="n" rel="next">Editor Basics</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
+</div>
+<a name="Introduction-1"></a>
<h2 class="chapter">1 Introduction</h2>
<p>GNU <code>nano</code> is a small and friendly text editor. Besides basic text
-editing, <code>nano</code> offers many extra features like an interactive
-search and replace, go to line and column number, auto-indentation,
+editing, <code>nano</code> offers many extra features, like an interactive
+search-and-replace, go-to-line-and-column-number, auto-indentation,
feature toggles, internationalization support, and filename tab
completion.
-
-<ul class="menu">
-<li><a accesskey="1" href="#Overview">Overview</a>
-<li><a accesskey="2" href="#Command-Line-Options">Command Line Options</a>
-</ul>
-
-<div class="node">
+</p>
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top">&bull; <a href="#Overview" accesskey="1">Overview</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Command-Line-Options" accesskey="2">Command Line Options</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+</table>
+
+<hr>
<a name="Overview"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#Command-Line-Options">Command Line Options</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
-
+<div class="header">
+<p>
+Next: <a href="#Command-Line-Options" accesskey="n" rel="next">Command Line Options</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
+<a name="Overview-1"></a>
<h3 class="section">1.1 Overview</h3>
<p>The original goal for <code>nano</code> was a complete bug-for-bug compatible
-emulation of Pico, but <code>nano</code>'s current goal is to be as compatible
-as possible while offering a superset of Pico's functionality. See
+emulation of Pico, but <code>nano</code>&rsquo;s current goal is to be as compatible
+as possible while offering a superset of Pico&rsquo;s functionality. See
See <a href="#Pico-Compatibility">Pico Compatibility</a>, for more info.
-
- <p>The usual way to invoke <code>nano</code> is:
-
- <blockquote>
-<code>nano [OPTION]... [FILE]</code>
-</blockquote>
-
- <p>But it is also possible to edit several files in a row. Additionally,
+</p>
+<p>The usual way to invoke <code>nano</code> is:
+</p>
+<blockquote>
+<p><code>nano [OPTION]&hellip; [FILE]</code>
+</p></blockquote>
+
+<p>But it is also possible to edit several files in a row. Additionally,
the cursor can be put on a desired line number by adding this number
with a plus sign before any filename, and even in a desired column by
adding it with a comma. So the complete synopsis is:
-
- <blockquote>
-<code>nano [OPTION]... [[+LINE] FILE]...</code>
-
- <p><code>nano [OPTION]... [[+,COLUMN] FILE]...</code>
-
- <p><code>nano [OPTION]... [[+LINE,COLUMN] FILE]...</code>
-</blockquote>
-
- <p>Email bug reports to <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a>.
-
-<div class="node">
+</p>
+<blockquote>
+<p><code>nano [OPTION]&hellip; [[+LINE] FILE]&hellip;</code>
+</p>
+<p><code>nano [OPTION]&hellip; [[+,COLUMN] FILE]&hellip;</code>
+</p>
+<p><code>nano [OPTION]&hellip; [[+LINE,COLUMN] FILE]&hellip;</code>
+</p></blockquote>
+
+<p>Email bug reports to <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a>.
+</p>
+<hr>
<a name="Command-Line-Options"></a>
-<p><hr>
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Overview">Overview</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
-
+<div class="header">
+<p>
+Previous: <a href="#Overview" accesskey="p" rel="prev">Overview</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
+<a name="Command-Line-Options-1"></a>
<h3 class="section">1.2 Command Line Options</h3>
<p><code>nano</code> takes the following options from the command line:
-
- <dl>
-<dt><code>+LINE,COLUMN</code><dd>Start at line number LINE and column number COLUMN (at least one of
+</p>
+<dl compact="compact">
+<dt><samp>+<var>line</var>,<var>column</var></samp></dt>
+<dd><p>Start at line number <var>line</var> and column number <var>column</var> (at least one of
which must be specified) instead of the default of line 1, column 1.
-
- <br><dt><code>-?</code><dd>Same as <code>-h, --help</code>.
-
- <br><dt><code>-A, --smarthome</code><dd>Make the Home key smarter. When Home is pressed anywhere but at the
+</p>
+</dd>
+<dt><samp>-A</samp></dt>
+<dt><samp>--smarthome</samp></dt>
+<dd><p>Make the Home key smarter. When Home is pressed anywhere but at the
very beginning of non-whitespace characters on a line, the cursor will
jump to that beginning (either forwards or backwards). If the cursor is
already at that position, it will jump to the true beginning of the
line.
-
- <br><dt><code>-B, --backup</code><dd>When saving a file, back up the previous version of it to the current
-filename suffixed with a ~.
-
- <br><dt><code>-C &lt;dir&gt;, --backupdir=&lt;dir&gt;</code><dd>Set the directory where <code>nano</code> puts unique backup files if file
+</p>
+</dd>
+<dt><samp>-B</samp></dt>
+<dt><samp>--backup</samp></dt>
+<dd><p>When saving a file, back up the previous version of it to the current
+filename suffixed with a &lsquo;<samp>~</samp>&rsquo;.
+</p>
+</dd>
+<dt><samp>-C <var>directory</var></samp></dt>
+<dt><samp>--backupdir=<var>directory</var></samp></dt>
+<dd><p>Set the directory where <code>nano</code> puts unique backup files if file
backups are enabled.
-
- <br><dt><code>-D, --boldtext</code><dd>Use bold text instead of reverse video text.
-
- <br><dt><code>-E, --tabstospaces</code><dd>Convert typed tabs to spaces.
-
- <br><dt><code>-F, --multibuffer</code><dd>Enable multiple file buffers, if available.
-
- <br><dt><code>-H, --historylog</code><dd>Log search and replace strings to ~/.nano_history, so they can be
-retrieved in later sessions, if nanorc support is available.
-
- <br><dt><code>-I, --ignorercfiles</code><dd>Don't look at SYSCONFDIR/nanorc or ~/.nanorc, if nanorc support is
-available.
-
- <br><dt><code>-K, --rebindkeypad</code><dd>Interpret the numeric keypad keys so that they all work properly. You
-should only need to use this option if they don't, as mouse support
-won't work properly with this option enabled.
-
- <br><dt><code>-L, --nonewlines</code><dd>Don't add newlines to the ends of files.
-
- <br><dt><code>-N, --noconvert</code><dd>Don't convert files from DOS/Mac format.
-
- <br><dt><code>-O, --morespace</code><dd>Use the blank line below the titlebar as extra editing space.
-
- <br><dt><code>-Q &lt;str&gt;, --quotestr=&lt;str&gt;</code><dd>Set the quoting string for justifying. The default value is
-
- <blockquote>
-<code>^([ \t]*[|&gt;:}#])+</code>
-</blockquote>
-
- <p>if extended regular expression support is available, or "&gt; " otherwise.
+</p>
+</dd>
+<dt><samp>-D</samp></dt>
+<dt><samp>--boldtext</samp></dt>
+<dd><p>Use bold text instead of reverse video text.
+</p>
+</dd>
+<dt><samp>-E</samp></dt>
+<dt><samp>--tabstospaces</samp></dt>
+<dd><p>Convert typed tabs to spaces.
+</p>
+</dd>
+<dt><samp>-F</samp></dt>
+<dt><samp>--multibuffer</samp></dt>
+<dd><p>Enable multiple file buffers (if support for them has been compiled in).
+</p>
+</dd>
+<dt><samp>-G</samp></dt>
+<dt><samp>--locking</samp></dt>
+<dd><p>Enable vim-style file locking when editing files.
+</p>
+</dd>
+<dt><samp>-H</samp></dt>
+<dt><samp>--historylog</samp></dt>
+<dd><p>Log search and replace strings to <samp>~/.nano/search_history</samp>,
+so they can be retrieved in later sessions.
+</p>
+</dd>
+<dt><samp>-I</samp></dt>
+<dt><samp>--ignorercfiles</samp></dt>
+<dd><p>Don&rsquo;t look at the system&rsquo;s nanorc file nor at the user&rsquo;s <samp>~/.nanorc</samp>.
+</p>
+</dd>
+<dt><samp>-K</samp></dt>
+<dt><samp>--rebindkeypad</samp></dt>
+<dd><p>Interpret the numeric keypad keys so that they all work properly. You
+should only need to use this option if they don&rsquo;t, as mouse support
+won&rsquo;t work properly with this option enabled.
+</p>
+</dd>
+<dt><samp>-L</samp></dt>
+<dt><samp>--nonewlines</samp></dt>
+<dd><p>Don&rsquo;t add newlines to the ends of files.
+</p>
+</dd>
+<dt><samp>-N</samp></dt>
+<dt><samp>--noconvert</samp></dt>
+<dd><p>Disable automatic conversion of files from DOS/Mac format.
+</p>
+</dd>
+<dt><samp>-O</samp></dt>
+<dt><samp>--morespace</samp></dt>
+<dd><p>Use the blank line below the titlebar as extra editing space.
+</p>
+</dd>
+<dt><samp>-P</samp></dt>
+<dt><samp>--poslog</samp></dt>
+<dd><p>Log for each file the last location of the cursor, and read it
+back upon reopening the file and place it there again.
+</p>
+</dd>
+<dt><samp>-Q &quot;<var>characters</var>&quot;</samp></dt>
+<dt><samp>--quotestr=&quot;<var>characters</var>&quot;</samp></dt>
+<dd><p>Set the quoting string for justifying. The default value is
+</p>
+<blockquote>
+<p>&quot;^([ \t]*[|&gt;:}#])+&quot;
+</p></blockquote>
+
+<p>if extended regular expression support is available, or <code>&gt; </code> otherwise.
Note that <code>\t</code> above stands for a literal Tab character.
-
- <br><dt><code>-R, --restricted</code><dd>Restricted mode: don't read or write to any file not specified on the
-command line; read any nanorc files; allow suspending; allow a file to
-be appended to, prepended to, or saved under a different name if it
-already has one; or use backup files or spell checking. Also accessible
-by invoking <code>nano</code> with any name beginning with 'r' (e.g. "rnano").
-
- <br><dt><code>-S, --smooth</code><dd>Enable smooth scrolling. Text will scroll line-by-line, instead of the
+</p>
+</dd>
+<dt><samp>-R</samp></dt>
+<dt><samp>--restricted</samp></dt>
+<dd><p>Restricted mode: don&rsquo;t read or write to any file not specified on the
+command line; don&rsquo;t read any nanorc files nor history files; don&rsquo;t allow
+suspending nor spell checking; don&rsquo;t
+allow a file to be appended to, prepended to, or saved under a different
+name if it already has one; and don&rsquo;t use backup files.
+This restricted mode is also accessible by invoking <code>nano</code> with
+any name beginning with &lsquo;<samp>r</samp>&rsquo; (e.g. <code>rnano</code>).
+</p>
+</dd>
+<dt><samp>-S</samp></dt>
+<dt><samp>--smooth</samp></dt>
+<dd><p>Enable smooth scrolling. Text will scroll line-by-line, instead of the
usual chunk-by-chunk behavior.
-
- <br><dt><code>-T &lt;#cols&gt;, --tabsize=&lt;#cols&gt;</code><dd>Set the displayed tab length to #cols columns. The value of #cols must
-be greater than 0. The default value is 8.
-
- <br><dt><code>-U, --quickblank</code><dd>Do quick statusbar blanking. Statusbar messages will disappear after 1
-keystroke instead of 25. Note that -c overrides this.
-
- <br><dt><code>-V, --version</code><dd>Show the current version number and exit.
-
- <br><dt><code>-W, --wordbounds</code><dd>Detect word boundaries more accurately by treating punctuation
+</p>
+</dd>
+<dt><samp>-T <var>number</var></samp></dt>
+<dt><samp>--tabsize=<var>number</var></samp></dt>
+<dd><p>Set the displayed tab length to <var>number</var> columns. The value of
+<var>number</var> must be greater than 0. The default value is &lsquo;<samp>8</samp>&rsquo;.
+</p>
+</dd>
+<dt><samp>-U</samp></dt>
+<dt><samp>--quickblank</samp></dt>
+<dd><p>Do quick statusbar blanking. Statusbar messages will disappear after 1
+keystroke instead of 25. Note that <samp>-c</samp> overrides this.
+</p>
+</dd>
+<dt><samp>-V</samp></dt>
+<dt><samp>--version</samp></dt>
+<dd><p>Show the current version number and exit.
+</p>
+</dd>
+<dt><samp>-W</samp></dt>
+<dt><samp>--wordbounds</samp></dt>
+<dd><p>Detect word boundaries more accurately by treating punctuation
characters as parts of words.
-
- <br><dt><code>-Y &lt;str&gt;, --syntax=&lt;str&gt;</code><dd>Specify a specific syntax highlighting from the nanorc to use, if
-available. See See <a href="#Nanorc-Files">Nanorc Files</a>, for more info.
-
- <br><dt><code>-c, --const</code><dd>Constantly display the cursor position and line number on the statusbar.
-Note that this overrides -U.
-
- <br><dt><code>-d, --rebinddelete</code><dd>Interpret the Delete key differently so that both Backspace and Delete
+</p>
+</dd>
+<dt><samp>-Y <var>name</var></samp></dt>
+<dt><samp>--syntax=<var>name</var></samp></dt>
+<dd><p>Specify a specific syntax from the nanorc files to use for highlighting.
+See See <a href="#Syntax-Highlighting">Syntax Highlighting</a>, for more info.
+</p>
+</dd>
+<dt><samp>-c</samp></dt>
+<dt><samp>--const</samp></dt>
+<dd><p>Constantly display the cursor position and line number on the statusbar.
+Note that this overrides <samp>-U</samp>.
+</p>
+</dd>
+<dt><samp>-d</samp></dt>
+<dt><samp>--rebinddelete</samp></dt>
+<dd><p>Interpret the Delete key differently so that both Backspace and Delete
work properly. You should only need to use this option if Backspace
acts like Delete on your system.
-
- <br><dt><code>-h, --help</code><dd>Show a summary of command line options and exit.
-
- <br><dt><code>-i, --autoindent</code><dd>Automatically indent new lines to the same number of spaces and tabs as
+</p>
+</dd>
+<dt><samp>-h</samp></dt>
+<dt><samp>--help</samp></dt>
+<dd><p>Show a summary of command-line options and exit.
+</p>
+</dd>
+<dt><samp>-i</samp></dt>
+<dt><samp>--autoindent</samp></dt>
+<dd><p>Automatically indent new lines to the same number of spaces and tabs as
the previous line.
-
- <br><dt><code>-k, --cut</code><dd>Cut from the current cursor position to the end of the current line.
-
- <br><dt><code>-l, --nofollow</code><dd>When writing files, if the given file is a symbolic link, it is removed
+</p>
+</dd>
+<dt><samp>-k</samp></dt>
+<dt><samp>--cut</samp></dt>
+<dd><p>Make the &rsquo;Cut Text&rsquo; command (normally ^K) cut from the current cursor
+position to the end of the line, instead of cutting the entire line.
+</p>
+</dd>
+<dt><samp>-l</samp></dt>
+<dt><samp>--nofollow</samp></dt>
+<dd><p>When writing files, if the given file is a symbolic link, it is removed
and a new file is created.
-
- <br><dt><code>-m, --mouse</code><dd>Enable mouse support, if available for your system. When enabled, mouse
+</p>
+</dd>
+<dt><samp>-m</samp></dt>
+<dt><samp>--mouse</samp></dt>
+<dd><p>Enable mouse support, if available for your system. When enabled, mouse
clicks can be used to place the cursor, set the mark (with a double
click), and execute shortcuts. The mouse will work in the X Window
-System, and on the console when gpm is running.
-
- <br><dt><code>-o &lt;dir&gt;, --operatingdir=&lt;dir&gt;</code><dd>Set operating directory. Makes <code>nano</code> set up something similar to
-a chroot.
-
- <br><dt><code>-p, --preserve</code><dd>Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent to the
-editor can be can be stopped and started.
-
- <br><dt><code>-q, --quiet</code><dd>Do not report errors in the nanorc file and ask them to be acknowledged
+System, and on the console when gpm is running. Text can still be
+selected through dragging by holding down the Shift key.
+</p>
+</dd>
+<dt><samp>-n</samp></dt>
+<dt><samp>--noread</samp></dt>
+<dd><p>Treat any name given on the command line as a new file. This allows
+<code>nano</code> to write to named pipes: it will start with a blank buffer,
+and will write to the pipe when the user saves the &quot;file&quot;. This way
+<code>nano</code> can be used as an editor in combination with for instance
+<code>gpg</code> without having to write sensitive data to disk first.
+</p>
+</dd>
+<dt><samp>-o <var>directory</var></samp></dt>
+<dt><samp>--operatingdir=<var>directory</var></samp></dt>
+<dd><p>Set the operating directory. This makes <code>nano</code> set up something
+similar to a chroot.
+</p>
+</dd>
+<dt><samp>-p</samp></dt>
+<dt><samp>--preserve</samp></dt>
+<dd><p>Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent to the
+editor can be stopped and started.
+</p>
+</dd>
+<dt><samp>-q</samp></dt>
+<dt><samp>--quiet</samp></dt>
+<dd><p>Do not report errors in the nanorc file nor ask them to be acknowledged
by pressing Enter at startup.
-
- <br><dt><code>-r &lt;#cols&gt;, --fill=&lt;#cols&gt;</code><dd>Wrap lines at column #cols. If this value is 0 or less, wrapping will
-occur at the width of the screen less #cols, allowing it to vary along
-with the width of the screen if the screen is resized. The default
-value is -8.
-
- <br><dt><code>-s &lt;prog&gt;, --speller=&lt;prog&gt;</code><dd>Invoke the given program as the spell checker. By default, <code>nano</code>
-uses the command specified in the SPELL environment variable, or, if
-SPELL is not set, its own interactive spell checker that requires the
-<code>spell</code> program to be installed on your system.
-
- <br><dt><code>-t, --tempfile</code><dd>Don't ask whether or not to save the current contents of the file when
+</p>
+</dd>
+<dt><samp>-r <var>number</var></samp></dt>
+<dt><samp>--fill=<var>number</var></samp></dt>
+<dd><p>Hard-wrap lines at column <var>number</var> (by inserting a newline character).
+If the given value is 0 or less, wrapping will occur at the width of
+the screen minus the given amount, allowing the wrapping width to
+vary along with the width of the screen if and when it is resized.
+The default value is &lsquo;<samp>-8</samp>&rsquo;. This option conflicts with <samp>-w</samp>
+&ndash; the last one given takes effect.
+</p>
+</dd>
+<dt><samp>-s <var>program</var></samp></dt>
+<dt><samp>--speller=<var>program</var></samp></dt>
+<dd><p>Invoke the given program as the spell checker. By default, <code>nano</code>
+uses the command specified in the <code>SPELL</code> environment variable, or,
+if <code>SPELL</code> is not set, its own interactive spell checker that requires
+the <code>spell</code> program to be installed on your system.
+</p>
+</dd>
+<dt><samp>-t</samp></dt>
+<dt><samp>--tempfile</samp></dt>
+<dd><p>Don&rsquo;t ask whether or not to save the current contents of the file when
exiting, assume yes. This is most useful when using <code>nano</code> as the
composer of a mailer program.
-
- <br><dt><code>-u, --undo</code><dd>Enable experimental generic-purpose undo code. By default, the undo and
-redo shortcuts are Meta-U and Meta-E, respectively.
-
- <br><dt><code>-v, --view</code><dd>Don't allow the contents of the file to be altered. Note that this
+</p>
+</dd>
+<dt><samp>-v</samp></dt>
+<dt><samp>--view</samp></dt>
+<dd><p>Don&rsquo;t allow the contents of the file to be altered. Note that this
option should NOT be used in place of correct file permissions to
implement a read-only file.
-
- <br><dt><code>-w, --nowrap</code><dd>Don't wrap long lines at any length. This option overrides any value
-for -r.
-
- <p><a name="Expert-Mode"></a><br><dt><code>-x, --nohelp</code><dd>Expert Mode: don't show the Shortcut Lists at the bottom of the screen.
+</p>
+</dd>
+<dt><samp>-w</samp></dt>
+<dt><samp>--nowrap</samp></dt>
+<dd><p>Don&rsquo;t hard-wrap long lines at any length. This option conflicts with
+<samp>-r</samp> &ndash; the last one given takes effect.
+</p>
+<a name="Expert-Mode"></a></dd>
+<dt><samp>-x</samp></dt>
+<dt><samp>--nohelp</samp></dt>
+<dd><p>Expert Mode: don&rsquo;t show the Shortcut Lists at the bottom of the screen.
This affects the location of the statusbar as well, as in Expert Mode it
is located at the very bottom of the editor.
-
- <p>Note: When accessing the help system, Expert Mode is temporarily
-disabled to display the help system navigation keys.
-
- <br><dt><code>-z, --suspend</code><dd>Enable <code>nano</code>'s suspend ability using the system's suspend
+</p>
+<p>Note: When accessing the help system, Expert Mode is temporarily
+disabled to display the help-system navigation keys.
+</p>
+</dd>
+<dt><samp>-z</samp></dt>
+<dt><samp>--suspend</samp></dt>
+<dd><p>Enable the ability to suspend <code>nano</code> using the system&rsquo;s suspend
keystroke (usually ^Z).
-
- <br><dt><code>-$, --softwrap</code><dd>Enable 'soft wrapping'. <code>nano</code> will attempt to display the entire
-contents of a line, even if it is longer than the screen width. Since
-'$' normally refers to a variable in the Unix shell, you should specify
-this option last when using other options (e.g. 'nano -wS$') or pass it
-separately (e.g. 'nano -wS -$').
-
- <br><dt><code>-a, -b, -e, -f, -g, -j</code><dd>Ignored, for compatibility with Pico.
+</p>
+</dd>
+<dt><samp>-$</samp></dt>
+<dt><samp>--softwrap</samp></dt>
+<dd><p>Enable &rsquo;soft wrapping&rsquo;. This will make <code>nano</code> attempt to display the
+entire contents of any line, even if it is longer than the screen width, by
+continuing it over multiple screen lines. Since
+&lsquo;<samp>$</samp>&rsquo; normally refers to a variable in the Unix shell, you should specify
+this option last when using other options (e.g. <code>nano -wS$</code>) or pass it
+separately (e.g. <code>nano -wS -$</code>).
+</p>
+</dd>
+<dt><samp>-a</samp></dt>
+<dt><samp>-b</samp></dt>
+<dt><samp>-e</samp></dt>
+<dt><samp>-f</samp></dt>
+<dt><samp>-g</samp></dt>
+<dt><samp>-j</samp></dt>
+<dd><p>Ignored, for compatibility with Pico.
+</p></dd>
</dl>
-<div class="node">
-<a name="Editor-Basics"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#Online-Help">Online Help</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<hr>
+<a name="Editor-Basics"></a>
+<div class="header">
+<p>
+Next: <a href="#Online-Help" accesskey="n" rel="next">Online Help</a>, Previous: <a href="#Introduction" accesskey="p" rel="prev">Introduction</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
+<a name="Editor-Basics-1"></a>
<h2 class="chapter">2 Editor Basics</h2>
-<ul class="menu">
-<li><a accesskey="1" href="#Entering-Text">Entering Text</a>
-<li><a accesskey="2" href="#Special-Functions">Special Functions</a>
-<li><a accesskey="3" href="#The-Titlebar">The Titlebar</a>
-<li><a accesskey="4" href="#The-Statusbar">The Statusbar</a>
-<li><a accesskey="5" href="#Shortcut-Lists">Shortcut Lists</a>
-<li><a accesskey="6" href="#Using-the-Mouse">Using the Mouse</a>
-</ul>
-
-<div class="node">
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top">&bull; <a href="#Entering-Text" accesskey="1">Entering Text</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Special-Functions" accesskey="2">Special Functions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#The-Cutbuffer" accesskey="3">The Cutbuffer</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#The-Mark" accesskey="4">The Mark</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#The-Titlebar" accesskey="5">The Titlebar</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#The-Statusbar" accesskey="6">The Statusbar</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Shortcut-Lists" accesskey="7">Shortcut Lists</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Using-the-Mouse" accesskey="8">Using the Mouse</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+</table>
+
+<hr>
<a name="Entering-Text"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#Special-Functions">Special Functions</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Editor-Basics">Editor Basics</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Editor-Basics">Editor Basics</a>
-
+<div class="header">
+<p>
+Next: <a href="#Special-Functions" accesskey="n" rel="next">Special Functions</a>, Up: <a href="#Editor-Basics" accesskey="u" rel="up">Editor Basics</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
+<a name="Entering-Text-1"></a>
<h3 class="section">2.1 Entering Text</h3>
-<p>All key sequences in <code>nano</code> are entered using the keyboard.
-<code>nano</code> is a "modeless" editor. All keys, with the exception of
-Control and Meta key sequences, will enter text into the file being
-edited.
-
-<div class="node">
+<p><code>nano</code> is a &quot;modeless&quot; editor. All keystrokes, with the exception
+of Control and Meta key sequences, enter text into the file being edited.
+All key sequences in <code>nano</code> are entered using the keyboard.
+</p>
+<hr>
<a name="Special-Functions"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#The-Titlebar">The Titlebar</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Entering-Text">Entering Text</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Editor-Basics">Editor Basics</a>
-
+<div class="header">
+<p>
+Next: <a href="#The-Cutbuffer" accesskey="n" rel="next">The Cutbuffer</a>, Previous: <a href="#Entering-Text" accesskey="p" rel="prev">Entering Text</a>, Up: <a href="#Editor-Basics" accesskey="u" rel="up">Editor Basics</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
+<a name="Special-Functions-1"></a>
<h3 class="section">2.2 Special Functions</h3>
-<p>Special functions use the Control (Ctrl) key, displayed in the help and
-shortcut lists as ^; the Meta key, displayed as M; or the Escape (Esc)
-key.
-
- <ul>
-<li>Control key sequences are entered by holding down the Ctrl key and
-pressing the desired key, or by pressing the Esc key twice and pressing
-the desired key.
-<li>Pressing Esc twice and then typing a three-digit number from 000 to 255
-will enter the character with the corresponding value.
-<li>Meta key sequences are entered by holding down the Meta key (normally
+<p>Special functions use the Control key (Ctrl), displayed in the help and
+shortcut lists as ^; the Meta key (Alt or Cmd), displayed as M-; or the
+Escape key (Esc).
+</p>
+<ul>
+<li> Control key sequences are entered by holding down the Ctrl key and
+pressing the desired key, or by pressing the Esc key twice and then
+pressing the desired key.
+</li><li> Pressing the Esc key twice and then typing a three-digit number from
+000 to 255 will enter the character with the corresponding value.
+</li><li> Meta key sequences are entered by holding down the Meta key (normally
the Alt key) and pressing the desired key, or by pressing the Esc key
-once and pressing the desired key. Certain operating systems "swallow"
+once and then pressing the desired key. Certain operating systems &quot;swallow&quot;
the Alt key so that it never reaches the application; if your operating
system does this, you should use the Esc key to generate Meta key
-sequences.
-</ul>
+sequences.
+</li></ul>
-<div class="node">
+<hr>
+<a name="The-Cutbuffer"></a>
+<div class="header">
+<p>
+Next: <a href="#The-Mark" accesskey="n" rel="next">The Mark</a>, Previous: <a href="#Special-Functions" accesskey="p" rel="prev">Special Functions</a>, Up: <a href="#Editor-Basics" accesskey="u" rel="up">Editor Basics</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
+</div>
+<a name="The-Cutbuffer-1"></a>
+<h3 class="section">2.3 The Cutbuffer</h3>
+
+<p>Text can be cut from a file, a whole line at a time, by using the &rsquo;Cut Text&rsquo;
+command (default key binding: ^K). The cut line is stored in the cutbuffer.
+Consecutive strokes of ^K will add each cut line to this buffer, but a ^K
+after any other keystroke will overwrite the entire cutbuffer.
+</p>
+<p>The contents of the cutbuffer can be pasted back into the file with the
+&rsquo;Uncut Text&rsquo; command (default key binding: ^U).
+</p>
+<p>A line of text can be copied into the cutbuffer (without cutting it) with
+the &rsquo;Copy Text&rsquo; command (default key binding: M-6).
+</p>
+<hr>
+<a name="The-Mark"></a>
+<div class="header">
+<p>
+Next: <a href="#The-Titlebar" accesskey="n" rel="next">The Titlebar</a>, Previous: <a href="#The-Cutbuffer" accesskey="p" rel="prev">The Cutbuffer</a>, Up: <a href="#Editor-Basics" accesskey="u" rel="up">Editor Basics</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
+</div>
+<a name="The-Mark-1"></a>
+<h3 class="section">2.4 The Mark</h3>
+
+<p>Text can be selected by first &rsquo;setting the Mark&rsquo; (default key bindings:
+^6 and M-A) and then moving the cursor to the other end of the portion
+to be selected. The selected portion of text will be highlighted in
+reverse video (or in bold if you set the boldtext option).
+This selection can now be cut or copied in its entirety with a single
+^K or M-6. Or the selection can be used to limit the scope of a
+search-and-replace (^\) or spell-checking session (^T).
+</p>
+<p>Cutting or copying selected text will toggle the mark off automatically.
+If necessary, it can be toggled off manually with another ^6 or M-A.
+</p>
+<hr>
<a name="The-Titlebar"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#The-Statusbar">The Statusbar</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Special-Functions">Special Functions</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Editor-Basics">Editor Basics</a>
-
+<div class="header">
+<p>
+Next: <a href="#The-Statusbar" accesskey="n" rel="next">The Statusbar</a>, Previous: <a href="#The-Mark" accesskey="p" rel="prev">The Mark</a>, Up: <a href="#Editor-Basics" accesskey="u" rel="up">Editor Basics</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
-<h3 class="section">2.3 The Titlebar</h3>
+<a name="The-Titlebar-1"></a>
+<h3 class="section">2.5 The Titlebar</h3>
<p>The titlebar is the line displayed at the top of the editor. There are
three sections: left, center and right. The section on the left
displays the version of <code>nano</code> being used. The center section
-displays the current filename, or "New Buffer" if the file has not yet
-been named. The section on the right will display "Modified" if the
+displays the current filename, or &quot;New Buffer&quot; if the file has not yet
+been named. The section on the right will display &quot;Modified&quot; if the
file has been modified since it was last saved or opened.
-
- <p>Special modes: When <code>nano</code> is in "File browser" mode, the center
+</p>
+<p>Special modes: When <code>nano</code> is in &quot;File browser&quot; mode, the center
section will display the current directory instead of the filename. See
See <a href="#The-File-Browser">The File Browser</a>, for more info.
-
-<div class="node">
+</p>
+<hr>
<a name="The-Statusbar"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#Shortcut-Lists">Shortcut Lists</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#The-Titlebar">The Titlebar</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Editor-Basics">Editor Basics</a>
-
+<div class="header">
+<p>
+Next: <a href="#Shortcut-Lists" accesskey="n" rel="next">Shortcut Lists</a>, Previous: <a href="#The-Titlebar" accesskey="p" rel="prev">The Titlebar</a>, Up: <a href="#Editor-Basics" accesskey="u" rel="up">Editor Basics</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
-<h3 class="section">2.4 The Statusbar</h3>
+<a name="The-Statusbar-1"></a>
+<h3 class="section">2.6 The Statusbar</h3>
<p>The statusbar is the third line from the bottom of the screen, or the
bottom line in Expert Mode. See See <a href="#Expert-Mode">Expert Mode</a>, for more info. It
@@ -365,358 +585,1052 @@ shows important and informational messages. Any error messages that
occur from using the editor will appear on the statusbar. Any questions
that are asked of the user will be asked on the statusbar, and any user
input (search strings, filenames, etc.) will be input on the statusbar.
-
-<div class="node">
+</p>
+<hr>
<a name="Shortcut-Lists"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#Using-the-Mouse">Using the Mouse</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#The-Statusbar">The Statusbar</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Editor-Basics">Editor Basics</a>
-
+<div class="header">
+<p>
+Next: <a href="#Using-the-Mouse" accesskey="n" rel="next">Using the Mouse</a>, Previous: <a href="#The-Statusbar" accesskey="p" rel="prev">The Statusbar</a>, Up: <a href="#Editor-Basics" accesskey="u" rel="up">Editor Basics</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
-<h3 class="section">2.5 Shortcut Lists</h3>
+<a name="Shortcut-Lists-1"></a>
+<h3 class="section">2.7 Shortcut Lists</h3>
<p>The Shortcut Lists are the two lines at the bottom of the screen which
show some of the more commonly used functions in the editor.
-
-<div class="node">
+</p>
+<hr>
<a name="Using-the-Mouse"></a>
-<p><hr>
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Shortcut-Lists">Shortcut Lists</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Editor-Basics">Editor Basics</a>
-
+<div class="header">
+<p>
+Previous: <a href="#Shortcut-Lists" accesskey="p" rel="prev">Shortcut Lists</a>, Up: <a href="#Editor-Basics" accesskey="u" rel="up">Editor Basics</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
-<h3 class="section">2.6 Using the Mouse</h3>
+<a name="Using-the-Mouse-1"></a>
+<h3 class="section">2.8 Using the Mouse</h3>
<p>When mouse support has been configured and enabled, a single mouse click
places the cursor at the indicated position. Clicking a second time in
the same position toggles the mark. Clicking in the shortcut list
-executes the selected shortcut.
-
- <p>The mouse will work in the X Window System, and on the console when gpm
+executes the selected shortcut. To be able to select text with the
+left button, or paste text with the middle button, hold down the
+Shift key during those actions.
+</p>
+<p>The mouse will work in the X Window System, and on the console when gpm
is running.
+</p>
-<div class="node">
+<hr>
<a name="Online-Help"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#Feature-Toggles">Feature Toggles</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Editor-Basics">Editor Basics</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
-
+<div class="header">
+<p>
+Next: <a href="#Feature-Toggles" accesskey="n" rel="next">Feature Toggles</a>, Previous: <a href="#Editor-Basics" accesskey="p" rel="prev">Editor Basics</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
+<a name="Online-Help-1"></a>
<h2 class="chapter">3 Online Help</h2>
-<p>The online help system in <code>nano</code> is available by pressing ^G.
-It is fairly self explanatory, documenting the various parts of the
+<p>The online help system in <code>nano</code> is available by pressing ^G.
+It is fairly self-explanatory, documenting the various parts of the
editor and available keystrokes. Navigation is via the ^Y (Page Up)
and ^V (Page Down) keys. ^X exits the help system.
+</p>
-<div class="node">
+<hr>
<a name="Feature-Toggles"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#Nanorc-Files">Nanorc Files</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Online-Help">Online Help</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
-
+<div class="header">
+<p>
+Next: <a href="#Nanorc-Files" accesskey="n" rel="next">Nanorc Files</a>, Previous: <a href="#Online-Help" accesskey="p" rel="prev">Online Help</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
+<a name="Feature-Toggles-1"></a>
<h2 class="chapter">4 Feature Toggles</h2>
<p>Toggles allow you to change certain aspects of the editor that would
-normally be done via command line options. They are invoked via Meta
+normally be done via command-line options. They are invoked via Meta
key sequences. See See <a href="#Special-Functions">Special Functions</a>, for more info. The
following global toggles are available:
+</p>
+<dl compact="compact">
+<dt><code>Backup Files Toggle (Meta-B)</code></dt>
+<dd><p>toggles the -B (<code>--backup</code>) command line option.
+</p>
+</dd>
+<dt><code>Constant Cursor Position Display Toggle (Meta-C)</code></dt>
+<dd><p>toggles the -c (<code>--const</code>) command line option.
+</p>
+</dd>
+<dt><code>Multiple File Buffers Toggle (Meta-F)</code></dt>
+<dd><p>toggles the -F (<code>--multibuffer</code>) command line option.
+</p>
+</dd>
+<dt><code>Smart Home Key Toggle (Meta-H)</code></dt>
+<dd><p>toggles the -A (<code>--smarthome</code>) command line option.
+</p>
+</dd>
+<dt><code>Auto Indent Toggle (Meta-I)</code></dt>
+<dd><p>toggles the -i (<code>--autoindent</code>) command line option.
+</p>
+</dd>
+<dt><code>Cut To End Toggle (Meta-K)</code></dt>
+<dd><p>toggles the -k (<code>--cut</code>) command line option.
+</p>
+</dd>
+<dt><code>Long Line Wrapping Toggle (Meta-L)</code></dt>
+<dd><p>toggles the -w (<code>--nowrap</code>) command line option.
+</p>
+</dd>
+<dt><code>Mouse Support Toggle (Meta-M)</code></dt>
+<dd><p>toggles the -m (<code>--mouse</code>) command line option.
+</p>
+</dd>
+<dt><code>No Conversion From DOS/Mac Format Toggle (Meta-N)</code></dt>
+<dd><p>toggles the -N (<code>--noconvert</code>) command line option.
+</p>
+</dd>
+<dt><code>More Space For Editing Toggle (Meta-O)</code></dt>
+<dd><p>toggles the -O (<code>--morespace</code>) command line option.
+</p>
+</dd>
+<dt><code>Whitespace Display Toggle (Meta-P)</code></dt>
+<dd><p>toggles whitespace-display mode.
+See See <a href="#Whitespace">Whitespace</a>, for more info.
+</p>
+</dd>
+<dt><code>Tabs to Spaces Toggle (Meta-Q)</code></dt>
+<dd><p>toggles the -E (<code>--tabstospaces</code>) command line option.
+</p>
+</dd>
+<dt><code>Smooth Scrolling Toggle (Meta-S)</code></dt>
+<dd><p>toggles the -S (<code>--smooth</code>) command line option.
+</p>
+</dd>
+<dt><code>Expert/No Help Toggle (Meta-X)</code></dt>
+<dd><p>toggles the -x (<code>--nohelp</code>) command line option.
+</p>
+</dd>
+<dt><code>Color Syntax Highlighting Toggle (Meta-Y)</code></dt>
+<dd><p>toggles color syntax highlighting if you have color syntaxes in your
+nanorc. See See <a href="#Syntax-Highlighting">Syntax Highlighting</a>, for more info.
+</p>
+</dd>
+<dt><code>Suspend Toggle (Meta-Z)</code></dt>
+<dd><p>toggles the -z (<code>--suspend</code>) command line option.
+</p>
+</dd>
+<dt><code>Soft Wrapping Toggle (Meta-$)</code></dt>
+<dd><p>toggles the -$ (<code>--softwrap</code>) command line option.
+</p>
+</dd>
+</dl>
- <dl>
-<dt><code>Backup Files Toggle (Meta-B)</code><dd>toggles the -B (<code>--backup</code>) command line option.
-
- <br><dt><code>Constant Cursor Position Display Toggle (Meta-C)</code><dd>toggles the -c (<code>--const</code>) command line option.
-
- <br><dt><code>Multiple File Buffers Toggle (Meta-F)</code><dd>toggles the -F (<code>--multibuffer</code>) command line option.
-
- <br><dt><code>Smart Home Key Toggle (Meta-H)</code><dd>toggles the -A (<code>--smarthome</code>) command line option.
-
- <br><dt><code>Auto Indent Toggle (Meta-I)</code><dd>toggles the -i (<code>--autoindent</code>) command line option.
-
- <br><dt><code>Cut To End Toggle (Meta-K)</code><dd>toggles the -k (<code>--cut</code>) command line option.
-
- <br><dt><code>Long Line Wrapping Toggle (Meta-L)</code><dd>toggles the -w (<code>--nowrap</code>) command line option.
-
- <br><dt><code>Mouse Support Toggle (Meta-M)</code><dd>toggles the -m (<code>--mouse</code>) command line option.
-
- <br><dt><code>No Conversion From DOS/Mac Format Toggle (Meta-N)</code><dd>toggles the -N (<code>--noconvert</code>) command line option.
-
- <br><dt><code>More Space For Editing Toggle (Meta-O)</code><dd>toggles the -O (<code>--morespace</code>) command line option.
-
- <br><dt><code>Whitespace Display Toggle (Meta-P)</code><dd>toggles whitespace display mode if you have a "whitespace" option in
-your nanorc. See See <a href="#Nanorc-Files">Nanorc Files</a>, for more info.
-
- <br><dt><code>Tabs to Spaces Toggle (Meta-Q)</code><dd>toggles the -E (<code>--tabstospaces</code>) command line option.
-
- <br><dt><code>Smooth Scrolling Toggle (Meta-S)</code><dd>toggles the -S (<code>--smooth</code>) command line option.
-
- <br><dt><code>Expert/No Help Toggle (Meta-X)</code><dd>toggles the -x (<code>--nohelp</code>) command line option.
-
- <br><dt><code>Color Syntax Highlighting Toggle (Meta-Y)</code><dd>toggles color syntax highlighting if you have color syntaxes in your
-nanorc. See See <a href="#Nanorc-Files">Nanorc Files</a>, for more info.
-
- <br><dt><code>Suspend Toggle (Meta-Z)</code><dd>toggles the -z (<code>--suspend</code>) command line option.
-
- <br><dt><code>Soft Wrapping Toggle (Meta-$)</code><dd>toggles the -$ (<code>--softwrap</code>) command line option.
-
- </dl>
-<div class="node">
+<hr>
<a name="Nanorc-Files"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#The-File-Browser">The File Browser</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Feature-Toggles">Feature Toggles</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
-
+<div class="header">
+<p>
+Next: <a href="#The-File-Browser" accesskey="n" rel="next">The File Browser</a>, Previous: <a href="#Feature-Toggles" accesskey="p" rel="prev">Feature Toggles</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
+<a name="Nanorc-Files-1"></a>
<h2 class="chapter">5 Nanorc Files</h2>
<p>The nanorc files contain the default settings for <code>nano</code>. They
-should not be in DOS or Mac format. During startup, <code>nano</code> will
-first read its system-wide settings from SYSCONFDIR/nanorc, and then
-user-specific settings from ~/.nanorc.
-
- <p>A nanorc file accepts a series of "set" and "unset" commands, which can
-be used to configure <code>nano</code> on startup without using the command
-line options. Additionally, the "syntax", "color", and "icolor"
-keywords are used to define syntax highlighting rules for different text
-patterns. <code>nano</code> will read one command per line.
-
- <p>Options in nanorc files take precedence over <code>nano</code>'s defaults, and
-command line options override nanorc settings. Options are also unset
-by default, except for those that take arguments.
-
- <p>Quotes inside string parameters don't have to be escaped with
+should be in Unix format, not in DOS or Mac format. During startup,
+<code>nano</code> will first read the system-wide settings, from /etc/nanorc
+(the exact path might be different), and then the user-specific settings,
+from ~/.nanorc.
+</p>
+<p>A nanorc file accepts a series of &quot;set&quot; and &quot;unset&quot; commands, which can
+be used to configure <code>nano</code> on startup without using command-line
+options. Additionally, there are some commands to define syntax highlighting
+and to rebind keys &ndash; See <a href="#Syntax-Highlighting">Syntax Highlighting</a>, and See <a href="#Rebinding-Keys">Rebinding Keys</a>.
+<code>nano</code> will read one command per line.
+</p>
+<p>Options in nanorc files take precedence over <code>nano</code>&rsquo;s defaults, and
+command-line options override nanorc settings. Also, options that do not
+take an argument are unset by default. So using the <code>unset</code> command
+is only needed when wanting to override a setting of the system&rsquo;s nanorc
+file in your own <samp>~/.nanorc</samp>. Options that take an argument cannot
+be unset.
+</p>
+<p>Quotes inside string parameters don&rsquo;t have to be escaped with
backslashes. The last double quote in the string will be treated as its
-end. For example, for the "brackets" option,
-
- <blockquote>
-<code>""')&gt;]}"</code>
-</blockquote>
-
- <p>will match <code>"</code>, <code>'</code>, <code>)</code>, <code>&gt;</code>, <code>]</code>, and
-<code>}</code>.
-
- <p>The supported commands and arguments are:
-
- <dl>
-<dt><code>set/unset autoindent</code><dd>Use auto-indentation.
-
- <br><dt><code>set/unset backup</code><dd>Create backup files in "filename~".
-
- <br><dt><code>set backupdir "directory"</code><dd>Set the directory where <code>nano</code> puts unique backup files if file
+end. For example, for the &quot;brackets&quot; option, <code>&quot;&quot;')&gt;]}&quot;</code> will match
+<code>&quot;</code>, <code>'</code>, <code>)</code>, <code>&gt;</code>, <code>]</code>, and <code>}</code>.
+</p>
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top">&bull; <a href="#Settings" accesskey="1">Settings</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Syntax-Highlighting" accesskey="2">Syntax Highlighting</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Rebinding-Keys" accesskey="3">Rebinding Keys</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+</table>
+
+<hr>
+<a name="Settings"></a>
+<div class="header">
+<p>
+Next: <a href="#Syntax-Highlighting" accesskey="n" rel="next">Syntax Highlighting</a>, Up: <a href="#Nanorc-Files" accesskey="u" rel="up">Nanorc Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
+</div>
+<a name="Settings-1"></a>
+<h3 class="section">5.1 Settings</h3>
+
+<p>The supported settings in a nanorc file are:
+</p>
+<dl compact="compact">
+<dt><code>set allow_insecure_backup</code></dt>
+<dd><p>When backing up files, allow the backup to succeed even if its
+permissions can&rsquo;t be (re)set due to special OS considerations.
+You should NOT enable this option unless you are sure you need it.
+</p>
+</dd>
+<dt><code>set autoindent</code></dt>
+<dd><p>Use auto-indentation.
+</p>
+</dd>
+<dt><code>set backup</code></dt>
+<dd><p>When saving a file, back up the previous version of it to the current
+filename suffixed with a tilde (<code>~</code>).
+</p>
+</dd>
+<dt><code>set backupdir &quot;directory&quot;</code></dt>
+<dd><p>Set the directory where <code>nano</code> puts unique backup files, if file
backups are enabled.
-
- <br><dt><code>set/unset backwards</code><dd>Do backwards searches by default.
-
- <br><dt><code>set/unset boldtext</code><dd>Use bold text instead of reverse video text.
-
- <br><dt><code>set brackets "string"</code><dd>Set the characters treated as closing brackets when justifying
-paragraphs. They cannot contain blank characters. Only closing
-punctuation, optionally followed by closing brackets, can end sentences.
+</p>
+</dd>
+<dt><code>set backwards</code></dt>
+<dd><p>Do backwards searches by default.
+</p>
+</dd>
+<dt><code>set boldtext</code></dt>
+<dd><p>Use bold instead of reverse video for the titlebar, statusbar, key combos,
+and selected text. This can be overridden for the first three by setting
+the options &quot;titlecolor&quot;, &quot;statuscolor&quot;, and &quot;keycolor&quot;.
+</p>
+</dd>
+<dt><code>set brackets &quot;<var>string</var>&quot;</code></dt>
+<dd><p>Set the characters treated as closing brackets when justifying
+paragraphs. This may not include blank characters. Only closing
+punctuation (see &quot;punct&quot;), optionally followed by the specified
+closing brackets, can end sentences. The default value is
+</p>
+<blockquote>
+<p>&quot;&quot;&rsquo;)&gt;]}&quot;
+</p></blockquote>
+
+</dd>
+<dt><code>set casesensitive</code></dt>
+<dd><p>Do case-sensitive searches by default.
+</p>
+</dd>
+<dt><code>set const</code></dt>
+<dd><p>Constantly display the cursor position in the status bar.
+</p>
+</dd>
+<dt><code>set cut</code></dt>
+<dd><p>Use cut-to-end-of-line by default, instead of cutting the whole line.
+</p>
+</dd>
+<dt><code>set fill <var>number</var></code></dt>
+<dd><p>Hard-wrap lines at column number <var>number</var>. If <var>number</var> is 0 or less,
+the maximum line length will be the screen width less <var>number</var> columns.
+The default value is -8.
+</p>
+</dd>
+<dt><code>set functioncolor <var>fgcolor</var>,<var>bgcolor</var></code></dt>
+<dd><p>Specify the color combination to use for the function descriptions
+in the two help lines at the bottom of the screen.
+See <code>set titlecolor</code> for more details.
+</p>
+</dd>
+<dt><code>set historylog</code></dt>
+<dd><p>Enable the use of <samp>~/.nano/search_history</samp> for saving and reading
+search/replace strings.
+</p>
+</dd>
+<dt><code>set keycolor <var>fgcolor</var>,<var>bgcolor</var></code></dt>
+<dd><p>Specify the color combination to use for the shortcut key combos
+in the two help lines at the bottom of the screen.
+See <code>set titlecolor</code> for more details.
+</p>
+</dd>
+<dt><code>set locking</code></dt>
+<dd><p>Enable vim-style lock-files for when editing files.
+</p>
+</dd>
+<dt><code>set matchbrackets &quot;<var>string</var>&quot;</code></dt>
+<dd><p>Set the opening and closing brackets that can be found by bracket
+searches. This may not include blank characters. The opening set must
+come before the closing set, and the two sets must be in the same order.
The default value is
-
- <blockquote>
-<code>""')&gt;]}"</code>
-</blockquote>
-
- <br><dt><code>set/unset casesensitive</code><dd>Do case sensitive searches by default.
-
- <br><dt><code>set/unset const</code><dd>Constantly display the cursor position in the status bar.
-
- <br><dt><code>set/unset cut</code><dd>Use cut to end of line by default, instead of cutting the whole line.
-
- <br><dt><code>set fill "n"</code><dd>Wrap lines at column number "n". If "n" is 0 or less, the maximum line
-length will be the screen width less "n" columns. The default value is
--8.
-
- <br><dt><code>set/unset historylog</code><dd>Enable ~/.nano_history for saving and reading search/replace strings.
-
- <br><dt><code>set matchbrackets "string"</code><dd>Set the opening and closing brackets that can be found by bracket
-searches. They cannot contain blank characters. The former set must
-come before the latter set, and both must be in the same order. The
-default value is
-
- <blockquote>
-<code>"(&lt;[{)&gt;]}"</code>
-</blockquote>
-
- <br><dt><code>set/unset morespace</code><dd>Use the blank line below the titlebar as extra editing space.
-
- <br><dt><code>set/unset mouse</code><dd>Enable mouse support, so that mouse clicks can be used to place the
+</p>
+<blockquote>
+<p>&quot;(&lt;[{)&gt;]}&quot;
+</p></blockquote>
+
+</dd>
+<dt><code>set morespace</code></dt>
+<dd><p>Use the blank line below the titlebar as extra editing space.
+</p>
+</dd>
+<dt><code>set mouse</code></dt>
+<dd><p>Enable mouse support, so that mouse clicks can be used to place the
cursor, set the mark (with a double click), or execute shortcuts.
-
- <br><dt><code>set/unset multibuffer</code><dd>Allow inserting files into their own buffers.
-
- <br><dt><code>set/unset noconvert</code><dd>Don't convert files from DOS/Mac format.
-
- <br><dt><code>set/unset nofollow</code><dd>Don't follow symlinks when writing files.
-
- <br><dt><code>set/unset nohelp</code><dd>Don't display the help lists at the bottom of the screen.
-
- <br><dt><code>set/unset nonewlines</code><dd>Don't add newlines to the ends of files.
-
- <br><dt><code>set/unset nowrap</code><dd>Don't wrap text at all.
-
- <br><dt><code>set operatingdir "directory"</code><dd><code>nano</code> will only read and write files inside "directory" and its
+</p>
+</dd>
+<dt><code>set multibuffer</code></dt>
+<dd><p>Allow inserting files into their own buffers.
+</p>
+</dd>
+<dt><code>set noconvert</code></dt>
+<dd><p>Don&rsquo;t convert files from DOS/Mac format.
+</p>
+</dd>
+<dt><code>set nofollow</code></dt>
+<dd><p>Don&rsquo;t follow symlinks when writing files.
+</p>
+</dd>
+<dt><code>set nohelp</code></dt>
+<dd><p>Don&rsquo;t display the help lists at the bottom of the screen.
+</p>
+</dd>
+<dt><code>set nonewlines</code></dt>
+<dd><p>Don&rsquo;t add newlines to the ends of files.
+</p>
+</dd>
+<dt><code>set nowrap</code></dt>
+<dd><p>Don&rsquo;t hard-wrap text at all.
+</p>
+</dd>
+<dt><code>set operatingdir &quot;directory&quot;</code></dt>
+<dd><p><code>nano</code> will only read and write files inside &quot;directory&quot; and its
subdirectories. Also, the current directory is changed to here, so
files are inserted from this directory. By default, the operating
directory feature is turned off.
-
- <br><dt><code>set/unset preserve</code><dd>Preserve the XON and XOFF keys (^Q and ^S).
-
- <br><dt><code>set punct "string"</code><dd>Set the characters treated as closing punctuation when justifying
-paragraphs. They cannot contain blank characters. Only closing
-punctuation, optionally followed by closing brackets, can end sentences.
-The default value is <code>"!.?"</code>.
-
- <br><dt><code>set/unset quickblank</code><dd>Do quick statusbar blanking. Statusbar messages will disappear after 1
+</p>
+</dd>
+<dt><code>set poslog</code></dt>
+<dd><p>Save the cursor position of files between editing sessions.
+</p>
+</dd>
+<dt><code>set preserve</code></dt>
+<dd><p>Preserve the XON and XOFF keys (^Q and ^S).
+</p>
+</dd>
+<dt><code>set punct &quot;<var>string</var>&quot;</code></dt>
+<dd><p>Set the characters treated as closing punctuation when justifying
+paragraphs. This may not include blank characters. Only the
+specified closing punctuation, optionally followed by closing brackets
+(see &quot;brackets&quot;), can end sentences. The default value is &quot;!.?&quot;.
+</p>
+</dd>
+<dt><code>set quickblank</code></dt>
+<dd><p>Do quick statusbar blanking. Statusbar messages will disappear after 1
keystroke instead of 25.
-
- <br><dt><code>set quotestr "string"</code><dd>The email-quote string, used to justify email-quoted paragraphs. This
+</p>
+</dd>
+<dt><code>set quiet</code></dt>
+<dd><p>When set, <code>nano</code> will not report errors in the nanorc file nor ask them
+to be acknowledged by pressing Enter at startup. If this option is used, it
+should be placed at the top of the file to be fully effective.
+</p>
+</dd>
+<dt><code>set quotestr &quot;<var>string</var>&quot;</code></dt>
+<dd><p>The email-quote string, used to justify email-quoted paragraphs. This
is an extended regular expression if your system supports them,
otherwise a literal string. The default value is
-
- <blockquote>
-<code>"^([ \\t]*[#:&gt;\\|}])+"</code>
-</blockquote>
-
- <p>if you have extended regular expression support, or "&gt; " otherwise.
-Note that '\\t' stands for a literal Tab character.
-
- <br><dt><code>set/unset rebinddelete</code><dd>Interpret the Delete key differently so that both Backspace and Delete
+</p>
+<blockquote>
+<p>&quot;^([ \\t]*[#:&gt;\\|}])+&quot;
+</p></blockquote>
+
+<p>if you have extended regular expression support, and &quot;&gt; &quot; otherwise.
+Note that &rsquo;\\t&rsquo; stands for a literal Tab character.
+</p>
+</dd>
+<dt><code>set rebinddelete</code></dt>
+<dd><p>Interpret the Delete key differently so that both Backspace and Delete
work properly. You should only need to use this option if Backspace
acts like Delete on your system.
-
- <br><dt><code>set/unset rebindkeypad</code><dd>Interpret the numeric keypad keys so that they all work properly. You
-should only need to use this option if they don't, as mouse support
-won't work properly with this option enabled.
-
- <br><dt><code>set/unset regexp</code><dd>Do extended regular expression searches by default.
-
- <br><dt><code>set/unset smarthome</code><dd>Make the Home key smarter. When Home is pressed anywhere but at the
+</p>
+</dd>
+<dt><code>set rebindkeypad</code></dt>
+<dd><p>Interpret the numeric keypad keys so that they all work properly. You
+should only need to use this option if they don&rsquo;t, as mouse support
+won&rsquo;t work properly with this option enabled.
+</p>
+</dd>
+<dt><code>set regexp</code></dt>
+<dd><p>Do extended regular expression searches by default.
+</p>
+</dd>
+<dt><code>set smarthome</code></dt>
+<dd><p>Make the Home key smarter. When Home is pressed anywhere but at the
very beginning of non-whitespace characters on a line, the cursor will
jump to that beginning (either forwards or backwards). If the cursor is
already at that position, it will jump to the true beginning of the
line.
-
- <br><dt><code>set/unset smooth</code><dd>Use smooth scrolling by default.
-
- <br><dt><code>set/unset softwrap</code><dd>Use soft wrapping by default.
-
- <br><dt><code>set speller "spellprog"</code><dd>Use spelling checker "spellprog" instead of the built-in one, which
-calls "spell".
-
- <br><dt><code>set/unset suspend</code><dd>Allow <code>nano</code> to be suspended.
-
- <br><dt><code>set/unset suspendenable</code><dd>If <code>nano</code> is allowed to be suspended, allow the suspend key
-(usually ^Z) to actually suspend it.
-
- <br><dt><code>set tabsize "n"</code><dd>Use a tab size of "n" columns. The value of "n" must be greater than 0.
-The default value is 8.
-
- <br><dt><code>set/unset tabstospaces</code><dd>Convert typed tabs to spaces.
-
- <br><dt><code>set/unset tempfile</code><dd>Save automatically on exit, don't prompt.
-
- <br><dt><code>set/unset undo</code><dd>Enable experimental generic-purpose undo code.
-
- <br><dt><code>set/unset view</code><dd>Disallow file modification.
-
- <br><dt><code>set whitespace "string"</code><dd>Set the two characters used to display the first characters of tabs and
-spaces. They must be single-column characters.
-
- <br><dt><code>set/unset wordbounds</code><dd>Detect word boundaries more accurately by treating punctuation
+</p>
+</dd>
+<dt><code>set smooth</code></dt>
+<dd><p>Use smooth scrolling by default.
+</p>
+</dd>
+<dt><code>set softwrap</code></dt>
+<dd><p>Enable soft line wrapping for easier viewing of very long lines.
+</p>
+</dd>
+<dt><code>set speller &quot;spellprog&quot;</code></dt>
+<dd><p>Use spelling checker &quot;spellprog&quot; instead of the built-in one, which
+calls &quot;spell&quot;.
+</p>
+</dd>
+<dt><code>set statuscolor <var>fgcolor</var>,<var>bgcolor</var></code></dt>
+<dd><p>Specify the color combination to use for the statusbar.
+See <code>set titlecolor</code> for more details.
+</p>
+</dd>
+<dt><code>set suspend</code></dt>
+<dd><p>Allow <code>nano</code> to be suspended.
+</p>
+</dd>
+<dt><code>set tabsize <var>number</var></code></dt>
+<dd><p>Use a tab size of <var>number</var> columns. The value of <var>number</var> must be
+greater than 0. The default value is 8.
+</p>
+</dd>
+<dt><code>set tabstospaces</code></dt>
+<dd><p>Convert typed tabs to spaces.
+</p>
+</dd>
+<dt><code>set tempfile</code></dt>
+<dd><p>Save automatically on exit, don&rsquo;t prompt.
+</p>
+</dd>
+<dt><code>set titlecolor <var>fgcolor</var>,<var>bgcolor</var></code></dt>
+<dd><p>Specify the color combination to use for the titlebar.
+Valid color names for foreground and background are:
+white, black, red, blue, green, yellow, magenta, and cyan.
+And either <var>fgcolor</var> or <var>,bgcolor</var> may be left out.
+</p>
+</dd>
+<dt><code>set view</code></dt>
+<dd><p>Disallow file modification.
+</p>
+<a name="Whitespace"></a></dd>
+<dt><code>set whitespace &quot;<var>string</var>&quot;</code></dt>
+<dd><p>Set the two characters used to indicate the presence of tabs and
+spaces. They must be single-column characters. The default pair
+for a UTF-8 locale is &quot;»·&quot;, and for other locales &quot;&gt;.&quot;.
+</p>
+</dd>
+<dt><code>set wordbounds</code></dt>
+<dd><p>Detect word boundaries more accurately by treating punctuation
characters as part of a word.
+</p>
+</dd>
+</dl>
- <br><dt><code>syntax "str" ["fileregex" ... ]</code><dd>Defines a syntax named "str" which can be activated via the -Y/&ndash;syntax
-command line option, or will be automatically activated if the current
-filename matches the extended regular expression "fileregex". All
-following "color" and "icolor" statements will apply to "syntax" until a
-new syntax is defined.
-
- <p>The "none" syntax is reserved; specifying it on the command line is the
-same as not having a syntax at all. The "default" syntax is special: it
-takes no "fileregex", and applies to files that don't match any other
-syntax's "fileregex".
-
- <br><dt><code>color fgcolor,bgcolor "regex" ...</code><dd>For the currently defined syntax, display all expressions matching the
-extended regular expression "regex" with foreground color "fgcolor" and
-background color "bgcolor", at least one of which must be specified.
-Legal colors for foreground and background color are: white, black, red,
-blue, green, yellow, magenta, and cyan. You may use the prefix "bright"
-to force a stronger color highlight for the foreground. If your
-terminal supports transparency, not specifying a "bgcolor" tells "nano"
+<hr>
+<a name="Syntax-Highlighting"></a>
+<div class="header">
+<p>
+Next: <a href="#Rebinding-Keys" accesskey="n" rel="next">Rebinding Keys</a>, Previous: <a href="#Settings" accesskey="p" rel="prev">Settings</a>, Up: <a href="#Nanorc-Files" accesskey="u" rel="up">Nanorc Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
+</div>
+<a name="Syntax-Highlighting-1"></a>
+<h3 class="section">5.2 Syntax Highlighting</h3>
+
+<p>Coloring the different syntactic elements of a file
+is done via regular expressions (see the <code>color</code> command below).
+This is inherently imperfect, because regular expressions are not
+powerful enough to fully parse a file. Nevertheless, regular
+expressions can do a lot and are easy to make, so they are a
+good fit for a small editor like <code>nano</code>.
+</p>
+<p>A separate syntax can be defined for each kind of file
+via the following commands in a nanorc file:
+</p>
+<dl compact="compact">
+<dt><code>syntax &quot;str&quot; [&quot;fileregex&quot; &hellip;]</code></dt>
+<dd><p>Defines a syntax named &quot;str&quot; which can be activated via the -Y/&ndash;syntax
+command-line option, or will be automatically activated if the current
+filename matches the extended regular expression &quot;fileregex&quot;. All
+following &quot;color&quot; and &quot;icolor&quot; statements will apply to this &quot;str&quot;
+syntax until a new syntax is defined.
+</p>
+<p>The &quot;none&quot; syntax is reserved; specifying it on the command line is the
+same as not having a syntax at all. The &quot;default&quot; syntax is special: it
+takes no &quot;fileregex&quot;, and applies to files that don&rsquo;t match any other
+syntax&rsquo;s &quot;fileregex&quot;.
+</p>
+</dd>
+<dt><code>linter program [arg &hellip;]</code></dt>
+<dd><p>For the currently defined syntax, use the given program to invoke the
+linter (this overrides the speller function when defined).
+</p>
+</dd>
+<dt><code>formatter program [arg &hellip;]</code></dt>
+<dd><p>For the currently defined syntax, use the given program to automatically
+reformat text. Useful in certain programming languages (e.g. go).
+</p>
+</dd>
+<dt><code>header &quot;regex&quot; &hellip;</code></dt>
+<dd><p>For the currently defined syntax, add one or more regexes which will
+be compared against the very first line of the file to be edited,
+to determine whether this syntax should be used for that file.
+</p>
+</dd>
+<dt><code>magic &quot;regex&quot; &hellip;</code></dt>
+<dd><p>For the currently defined syntax, add one or more regexes which will be
+compared against the result of querying the magic database about the file
+to be edited, to determine whether this syntax should be used for that
+file. This functionality only works when libmagic is installed on the
+system and will be silently ignored otherwise.
+</p>
+</dd>
+<dt><code>color fgcolor,bgcolor &quot;regex&quot; &hellip;</code></dt>
+<dd><p>For the currently defined syntax, display all expressions matching the
+extended regular expression &quot;regex&quot; with foreground color &quot;fgcolor&quot; and
+background color &quot;bgcolor&quot;, at least one of which must be specified.
+Valid colors for foreground and background are: white, black, red,
+blue, green, yellow, magenta, and cyan. You may use the prefix &quot;bright&quot;
+to get a stronger color highlight for the foreground. If your
+terminal supports transparency, not specifying a &quot;bgcolor&quot; tells <code>nano</code>
to attempt to use a transparent background.
+</p>
+</dd>
+<dt><code>icolor fgcolor,bgcolor &quot;regex&quot; &hellip;</code></dt>
+<dd><p>Same as above, except that the expression matching is case insensitive.
+</p>
+</dd>
+<dt><code>color fgcolor,bgcolor start=&quot;sr&quot; end=&quot;er&quot;</code></dt>
+<dd><p>Display expressions which start with the extended regular expression
+&quot;sr&quot; and end with the extended regular expression &quot;er&quot; with foreground
+color &quot;fgcolor&quot; and background color &quot;bgcolor&quot;, at least one of which
+must be specified. This allows syntax highlighting to span multiple
+lines. Note that all subsequent instances of &quot;sr&quot; after an initial &quot;sr&quot;
+is found will be highlighted until the first instance of &quot;er&quot;.
+</p>
+</dd>
+<dt><code>icolor fgcolor,bgcolor start=&quot;sr&quot; end=&quot;er&quot;</code></dt>
+<dd><p>Same as above, except that the expression matching is case insensitive.
+</p>
+</dd>
+<dt><code>include &quot;syntaxfile&quot;</code></dt>
+<dd><p>Read in self-contained color syntaxes from &quot;syntaxfile&quot;. Note that
+&quot;syntaxfile&quot; can only contain the above commands, from &quot;syntax&quot; to
+&quot;icolor&quot;.
+</p>
+</dd>
+<dt><code>extendsyntax str directive [arg &hellip;]</code></dt>
+<dd><p>Extend the syntax previously defined as str to include new information.
+Allows you to add a new color, icolor, magic, header, or linter directive
+to an already defined syntax. Useful when you want to add to definitions
+from the system-installed syntax definitions (which are normally not writable).
+</p>
+</dd>
+</dl>
- <br><dt><code>icolor fgcolor,bgcolor "regex" ...</code><dd>Same as above, except that the expression matching is case insensitive.
+<hr>
+<a name="Rebinding-Keys"></a>
+<div class="header">
+<p>
+Previous: <a href="#Syntax-Highlighting" accesskey="p" rel="prev">Syntax Highlighting</a>, Up: <a href="#Nanorc-Files" accesskey="u" rel="up">Nanorc Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
+</div>
+<a name="Rebinding-Keys-1"></a>
+<h3 class="section">5.3 Rebinding Keys</h3>
+
+<p>Key bindings may be reassigned via the following two commands in a
+nanorc file:
+</p>
+<dl compact="compact">
+<dt><code>bind key function menu</code></dt>
+<dd><p>Rebinds <code>key</code> to <code>function</code> in the context of <code>menu</code>
+(or in all menus where the function exists by using <code>all</code>).
+</p>
+</dd>
+<dt><code>unbind key menu</code></dt>
+<dd><p>Unbinds <code>key</code> from <code>menu</code>
+(or from all menus where it exists by using <code>all</code>).
+</p>
+</dd>
+</dl>
- <br><dt><code>color fgcolor,bgcolor start="sr" end="er"</code><dd>Display expressions which start with the extended regular expression
-"sr" and end with the extended regular expression "er" with foreground
-color "fgcolor" and background color "bgcolor", at least one of which
-must be specified. This allows syntax highlighting to span multiple
-lines. Note that all subsequent instances of "sr" after an initial "sr"
-is found will be highlighted until the first instance of "er".
+<p>The format of <code>key</code> should be one of:
+</p>
+<dl compact="compact">
+<dt><code>^</code></dt>
+<dd><p>followed by an alpha character or the word &quot;Space&quot;.
+Example: <code>^C</code>
+</p>
+</dd>
+<dt><code>M-</code></dt>
+<dd><p>followed by a printable character or the word &quot;Space&quot;.
+Example: <code>M-C</code>
+</p>
+</dd>
+<dt><code>F</code></dt>
+<dd><p>followed by a numeric value from 1 to 16.
+Example: <code>F10</code>
+</p>
+</dd>
+</dl>
- <br><dt><code>icolor fgcolor,bgcolor start="sr" end="er"</code><dd>Same as above, except that the expression matching is case insensitive.
+<p>Valid names for the <code>function</code> to be bound are:
+</p>
+<dl compact="compact">
+<dt><code>help</code></dt>
+<dd><p>Invokes the help viewer.
+</p>
+</dd>
+<dt><code>cancel</code></dt>
+<dd><p>Cancels the current command.
+</p>
+</dd>
+<dt><code>exit</code></dt>
+<dd><p>Exits from the program (or from the help viewer or the file browser).
+</p>
+</dd>
+<dt><code>writeout</code></dt>
+<dd><p>Writes the current buffer to disk.
+</p>
+</dd>
+<dt><code>insert</code></dt>
+<dd><p>Inserts a file into the current buffer (or into a new buffer when multibuffer
+is enabled).
+</p>
+</dd>
+<dt><code>whereis</code></dt>
+<dd><p>Searches for text in the current buffer &ndash; or for filenames matching
+a string in the current list in the file browser
+</p>
+</dd>
+<dt><code>searchagain</code></dt>
+<dd><p>Repeats the last search command.
+</p>
+</dd>
+<dt><code>replace</code></dt>
+<dd><p>Interactively replaces text within the current buffer.
+</p>
+</dd>
+<dt><code>cut</code></dt>
+<dd><p>Cuts and stores the current line (or the marked region).
+</p>
+</dd>
+<dt><code>copytext</code></dt>
+<dd><p>Copies the current line (or the marked region) without deleting it.
+</p>
+</dd>
+<dt><code>uncut</code></dt>
+<dd><p>Copies the currently stored text into the current buffer at the
+current cursor position.
+</p>
+</dd>
+<dt><code>mark</code></dt>
+<dd><p>Sets the mark at the current position, to start selecting text.
+</p>
+</dd>
+<dt><code>cutrestoffile</code></dt>
+<dd><p>Cuts all text from the cursor position till the end of the buffer.
+</p>
+</dd>
+<dt><code>curpos</code></dt>
+<dd><p>Shows the current cursor position: the line, column, and character positions.
+</p>
+</dd>
+<dt><code>wordcount</code></dt>
+<dd><p>Counts the number of words, lines and characters in the current buffer.
+</p>
+</dd>
+<dt><code>speller</code></dt>
+<dd><p>Invokes a spell-checking program (or a linting program, if the current
+syntax highlighting defines one).
+</p>
+</dd>
+<dt><code>justify</code></dt>
+<dd><p>Justifies the current paragraph.
+</p>
+</dd>
+<dt><code>fulljustify</code></dt>
+<dd><p>Justifies the entire current buffer.
+</p>
+</dd>
+<dt><code>indent</code></dt>
+<dd><p>Indents (shifts to the right) the currently marked text.
+</p>
+</dd>
+<dt><code>unindent</code></dt>
+<dd><p>Unindents (shifts to the left) the currently marked text.
+</p>
+</dd>
+<dt><code>left</code></dt>
+<dd><p>Goes left one position (in the editor or browser).
+</p>
+</dd>
+<dt><code>right</code></dt>
+<dd><p>Goes right one position (in the editor or browser).
+</p>
+</dd>
+<dt><code>up</code></dt>
+<dd><p>Goes one line up (in the editor or browser).
+</p>
+</dd>
+<dt><code>down</code></dt>
+<dd><p>Goes one line down (in the editor or browser).
+</p>
+</dd>
+<dt><code>scrollup</code></dt>
+<dd><p>Scrolls up one line of text from the current position.
+</p>
+</dd>
+<dt><code>scrolldown</code></dt>
+<dd><p>Scrolls down one line of text from the current position.
+</p>
+</dd>
+<dt><code>nextword</code></dt>
+<dd><p>Moves the cursor to the beginning of the next word.
+</p>
+</dd>
+<dt><code>prevword</code></dt>
+<dd><p>Moves the cursor to the beginning of the previous word.
+</p>
+</dd>
+<dt><code>home</code></dt>
+<dd><p>Moves the cursor to the beginning of the current line.
+</p>
+</dd>
+<dt><code>end</code></dt>
+<dd><p>Moves the cursor to the end of the current line.
+</p>
+</dd>
+<dt><code>beginpara</code></dt>
+<dd><p>Moves the cursor to the beginning of the current paragraph.
+</p>
+</dd>
+<dt><code>endpara</code></dt>
+<dd><p>Moves the cursor to the end of the current paragraph.
+</p>
+</dd>
+<dt><code>prevpage</code></dt>
+<dd><p>Goes up one screenful.
+</p>
+</dd>
+<dt><code>nextpage</code></dt>
+<dd><p>Goes down one screenful.
+</p>
+</dd>
+<dt><code>firstline</code></dt>
+<dd><p>Goes to the first line of the file.
+</p>
+</dd>
+<dt><code>lastline</code></dt>
+<dd><p>Goes to the last line of the file.
+</p>
+</dd>
+<dt><code>gotoline</code></dt>
+<dd><p>Goes to a specific line (and column if specified).
+</p>
+</dd>
+<dt><code>gototext</code></dt>
+<dd><p>Switches from targeting a line number to searching for text.
+</p>
+</dd>
+<dt><code>findbracket</code></dt>
+<dd><p>Moves the cursor to the bracket (brace, parenthesis, etc.) that matches
+(pairs) with the one under the cursor.
+</p>
+</dd>
+<dt><code>prevbuf</code></dt>
+<dd><p>Switches to editing/viewing the previous buffer when using multibuffer mode.
+</p>
+</dd>
+<dt><code>nextbuf</code></dt>
+<dd><p>Switches to editing/viewing the next buffer when using multibuffer mode.
+</p>
+</dd>
+<dt><code>verbatim</code></dt>
+<dd><p>Inserts the next character verbatim into the file.
+</p>
+</dd>
+<dt><code>tab</code></dt>
+<dd><p>Inserts a tab at the current cursor location.
+</p>
+</dd>
+<dt><code>enter</code></dt>
+<dd><p>Inserts a new line below the current one.
+</p>
+</dd>
+<dt><code>delete</code></dt>
+<dd><p>Deletes the character under the cursor.
+</p>
+</dd>
+<dt><code>backspace</code></dt>
+<dd><p>Deletes the character before the cursor.
+</p>
+</dd>
+<dt><code>undo</code></dt>
+<dd><p>Undoes the last performed text action (add text, delete text, etc).
+</p>
+</dd>
+<dt><code>redo</code></dt>
+<dd><p>Redoes the last undone action (i.e., it undoes an undo).
+</p>
+</dd>
+<dt><code>refresh</code></dt>
+<dd><p>Refreshes the screen.
+</p>
+</dd>
+<dt><code>suspend</code></dt>
+<dd><p>Suspends the editor (if the suspending function is enabled, see the
+&quot;suspendenable&quot; entry below).
+</p>
+</dd>
+<dt><code>casesens</code></dt>
+<dd><p>Toggles case sensitivity in searching (search/replace menus only).
+</p>
+</dd>
+<dt><code>regexp</code></dt>
+<dd><p>Toggles whether searching/replacing is based on literal strings or regular expressions.
+</p>
+</dd>
+<dt><code>backwards</code></dt>
+<dd><p>Toggles whether searching/replacing goes forward or backward.
+</p>
+</dd>
+<dt><code>prevhistory</code></dt>
+<dd><p>Shows the previous history entry in the prompt menus (e.g. search).
+</p>
+</dd>
+<dt><code>nexthistory</code></dt>
+<dd><p>Shows the next history entry in the prompt menus (e.g. search).
+</p>
+</dd>
+<dt><code>flipreplace</code></dt>
+<dd><p>Toggles between searching for something and replacing something.
+</p>
+</dd>
+<dt><code>flipexecute</code></dt>
+<dd><p>Toggles between inserting a file and executing a command.
+</p>
+</dd>
+<dt><code>flipnewbuffer</code></dt>
+<dd><p>Toggles between inserting into the current buffer and into a new
+empty buffer.
+</p>
+</dd>
+<dt><code>dosformat</code></dt>
+<dd><p>When writing a file, switches to writing a DOS format (CR/LF).
+</p>
+</dd>
+<dt><code>macformat</code></dt>
+<dd><p>When writing a file, switches to writing a Mac format.
+</p>
+</dd>
+<dt><code>append</code></dt>
+<dd><p>When writing a file, appends to the end instead of overwriting.
+</p>
+</dd>
+<dt><code>prepend</code></dt>
+<dd><p>When writing a file, &rsquo;prepends&rsquo; (writes at the beginning) instead of overwriting.
+</p>
+</dd>
+<dt><code>backup</code></dt>
+<dd><p>When writing a file, creates a backup of the current file.
+</p>
+</dd>
+<dt><code>tofiles</code></dt>
+<dd><p>Starts the file browser, allowing to select a file from a list.
+</p>
+</dd>
+<dt><code>gotodir</code></dt>
+<dd><p>Goes to a directory to be specified, allowing to browse anywhere
+in the filesystem.
+</p>
+</dd>
+<dt><code>firstfile</code></dt>
+<dd><p>Goes to the first file when using the file browser (reading or writing files).
+</p>
+</dd>
+<dt><code>lastfile</code></dt>
+<dd><p>Goes to the last file when using the file browser (reading or writing files).
+</p>
+</dd>
+<dt><code>nohelp</code></dt>
+<dd><p>Toggles the presence of the two-line list of key bindings at the bottom of the screen.
+</p>
+</dd>
+<dt><code>constupdate</code></dt>
+<dd><p>Toggles the constant display of the current line, column, and character positions.
+</p>
+</dd>
+<dt><code>morespace</code></dt>
+<dd><p>Toggles the presence of the blank line which &rsquo;separates&rsquo; the titlebar from the file text.
+</p>
+</dd>
+<dt><code>smoothscroll</code></dt>
+<dd><p>Toggles smooth scrolling (when moving around with the arrow keys).
+</p>
+</dd>
+<dt><code>softwrap</code></dt>
+<dd><p>Toggles the displaying of overlong lines on multiple screen lines.
+</p>
+</dd>
+<dt><code>whitespacedisplay</code></dt>
+<dd><p>Toggles the showing of whitespace.
+</p>
+</dd>
+<dt><code>nosyntax</code></dt>
+<dd><p>Toggles syntax highlighting.
+</p>
+</dd>
+<dt><code>smarthome</code></dt>
+<dd><p>Toggles the smartness of the Home key.
+</p>
+</dd>
+<dt><code>autoindent</code></dt>
+<dd><p>Toggles whether new lines will contain the same amount of whitespace as the preceding line.
+</p>
+</dd>
+<dt><code>cuttoend</code></dt>
+<dd><p>Toggles whether cutting text will cut the whole line or just from the current cursor
+position to the end of the line.
+</p>
+</dd>
+<dt><code>nowrap</code></dt>
+<dd><p>Toggles whether long lines will be hard-wrapped to the next line.
+</p>
+</dd>
+<dt><code>tabstospaces</code></dt>
+<dd><p>Toggles whether typed tabs will be converted to spaces.
+</p>
+</dd>
+<dt><code>backupfile</code></dt>
+<dd><p>Toggles whether a backup will be made of the file to be edited.
+</p>
+</dd>
+<dt><code>multibuffer</code></dt>
+<dd><p>Toggles the use of multiple file buffers (if available).
+</p>
+</dd>
+<dt><code>mouse</code></dt>
+<dd><p>Toggles mouse support.
+</p>
+</dd>
+<dt><code>noconvert</code></dt>
+<dd><p>Toggles automatic conversion of files from DOS/Mac format.
+</p>
+</dd>
+<dt><code>suspendenable</code></dt>
+<dd><p>Toggles whether the suspend sequence (normally ^Z) will suspend the editor window.
+</p>
+</dd>
+</dl>
- <br><dt><code>include "syntaxfile"</code><dd>Read in self-contained color syntaxes from "syntaxfile". Note that
-"syntaxfile" can only contain "syntax", "color", and "icolor" commands.
+<p>Valid names for <code>menu</code> are:
+</p>
+<dl compact="compact">
+<dt><code>main</code></dt>
+<dd><p>The main editor window where text is entered and edited.
+</p>
+</dd>
+<dt><code>search</code></dt>
+<dd><p>The search menu (AKA whereis).
+</p>
+</dd>
+<dt><code>replace</code></dt>
+<dd><p>The &rsquo;search to replace&rsquo; menu.
+</p>
+</dd>
+<dt><code>replacewith</code></dt>
+<dd><p>The &rsquo;replace with&rsquo; menu, which comes up after &rsquo;search to replace&rsquo;.
+</p>
+</dd>
+<dt><code>gotoline</code></dt>
+<dd><p>The &rsquo;goto line (and column)&rsquo; menu.
+</p>
+</dd>
+<dt><code>writeout</code></dt>
+<dd><p>The &rsquo;write file&rsquo; menu.
+</p>
+</dd>
+<dt><code>insert</code></dt>
+<dd><p>The &rsquo;insert file&rsquo; menu.
+</p>
+</dd>
+<dt><code>extcmd</code></dt>
+<dd><p>The menu for inserting output from an external command, reached from the insert menu.
+</p>
+</dd>
+<dt><code>help</code></dt>
+<dd><p>The help-viewer menu.
+</p>
+</dd>
+<dt><code>spell</code></dt>
+<dd><p>The interactive spell checker Yes/no menu.
+</p>
+</dd>
+<dt><code>linter</code></dt>
+<dd><p>The linter menu.
+</p>
+</dd>
+<dt><code>browser</code></dt>
+<dd><p>The file browser for inserting or writing a file.
+</p>
+</dd>
+<dt><code>whereisfile</code></dt>
+<dd><p>The &rsquo;search for a file&rsquo; menu in the file browser.
+</p>
+</dd>
+<dt><code>gotodir</code></dt>
+<dd><p>The &rsquo;go to directory&rsquo; menu in the file browser.
+</p>
+</dd>
+<dt><code>all</code></dt>
+<dd><p>A special name that encompasses all menus. For <code>bind</code> it means
+all menus where the specified <code>function</code> exists; for <code>unbind</code>
+it means all menus where the specified <code>key</code> exists.
+</p></dd>
+</dl>
- </dl>
-<div class="node">
+<hr>
<a name="The-File-Browser"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#Pico-Compatibility">Pico Compatibility</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Nanorc-Files">Nanorc Files</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
-
+<div class="header">
+<p>
+Next: <a href="#Pico-Compatibility" accesskey="n" rel="next">Pico Compatibility</a>, Previous: <a href="#Nanorc-Files" accesskey="p" rel="prev">Nanorc Files</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
+<a name="The-File-Browser-1"></a>
<h2 class="chapter">6 The File Browser</h2>
-<p>When reading or writing files, pressing ^T will invoke the file browser.
+<p>When reading or writing files, pressing ^T will invoke the file browser.
Here, one can navigate directories in a graphical manner in order to
find the desired file.
-
- <p>Basic movement in the file browser is accomplished with the arrow keys,
+</p>
+<p>Basic movement in the file browser is accomplished with the arrow keys,
page up, and page down. More advanced movement is accomplished by
-searching via ^W (or 'w') and changing directories via ^_ (or 'g'). The
-behavior of the Enter (or 's') key varies by what is currently selected.
+searching via ^W (or &rsquo;w&rsquo;) and changing directories via ^_ (or &rsquo;g&rsquo;). The
+behavior of the Enter (or &rsquo;s&rsquo;) key varies by what is currently selected.
If the currently selected object is a directory, the file browser will
enter and display the contents of the directory. If the object is a
file, this filename and path are copied to the statusbar, and the file
browser exits.
+</p>
-<div class="node">
+<hr>
<a name="Pico-Compatibility"></a>
-<p><hr>
-Next:&nbsp;<a rel="next" accesskey="n" href="#Building-and-Configure-Options">Building and Configure Options</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#The-File-Browser">The File Browser</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
-
+<div class="header">
+<p>
+Next: <a href="#Building-and-Configure-Options" accesskey="n" rel="next">Building and Configure Options</a>, Previous: <a href="#The-File-Browser" accesskey="p" rel="prev">The File Browser</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
+<a name="Pico-Compatibility-1"></a>
<h2 class="chapter">7 Pico Compatibility</h2>
<p><code>nano</code> attempts to emulate Pico as closely as possible, but there
are certain differences between the editors:
-
- <dl>
-<dt><code>Search and Replace History</code><dd>As of version 1.1.99pre1 of <code>nano</code>, text entered as search or
+</p>
+<dl compact="compact">
+<dt><code>Search and Replace History</code></dt>
+<dd><p>As of version 1.1.99pre1 of <code>nano</code>, text entered as search or
replace strings will be stored and can be accessed with the up/down
arrow keys. Previously, <code>nano</code> offered a more consistent, but
-incompatible with Pico, method for entering search and replace strings.
+incompatible with Pico, method for entering search and replace strings.
In the old method, previous entries would be displayed by default as
editable text in front of the cursor, as opposed to being bracketed and
uneditable as it is in Pico. The old behavior could be made compatible
@@ -725,143 +1639,225 @@ with Pico via the <code>-p</code> option, but recent versions of Pico use the
editor. Since, with the new method, search and replace strings can
still be edited by simply hitting the up arrow key once, the old method
was removed completely.
+</p>
- <br><dt><code>Writing, Appending, or Prepending Selected Text to Files</code><dd>Text selected using the marking key (^^) can be written out, appended,
+</dd>
+<dt><code>Writing, Appending, or Prepending Selected Text to Files</code></dt>
+<dd><p>Text selected using the marking key (^^) can be written out, appended,
or prepended to a new or existing file using the WriteOut key (^O).
-
- <br><dt><code>Toggles</code><dd>Many options which alter the functionality of the program can be
-"toggled" on or off using Meta key sequences, meaning the program does
+</p>
+</dd>
+<dt><code>Toggles</code></dt>
+<dd><p>Many options which alter the functionality of the program can be
+&quot;toggled&quot; on or off using Meta key sequences, meaning the program does
not have to be restarted to turn a particular feature of the editor on
or off. Please see the internal help function (^G) for a list of what
functions can be toggled for a particular version of <code>nano</code>. See
See <a href="#Feature-Toggles">Feature Toggles</a>, for more info.
-
- <br><dt><code>Cursor Position Display</code><dd>The output of the "Display Cursor Position" in <code>nano</code> displays
-the given column position, as well as the row and total character
-position of the cursor.
-
- <br><dt><code>Interactive Replace and Spell Checker</code><dd>It is worth noting that <code>nano</code>'s replace function is interactive,
-i.e. it does not stop after one search string is found and automatically
-replace it. The <code>nano</code> implementation will pause at each search
-string found and query whether to replace this instance or not. The
+</p>
+</dd>
+<dt><code>Cursor Position Display</code></dt>
+<dd><p>The output of the &quot;Display Cursor Position&quot; in <code>nano</code> displays
+the current line position of the cursor, as well as the column and
+total character position.
+</p>
+</dd>
+<dt><code>Interactive Replace and Spell Checker</code></dt>
+<dd><p>It is worth noting that <code>nano</code>&rsquo;s replace function is interactive,
+i.e. it does not stop after one search string was found and automatically
+replaced. The <code>nano</code> implementation will pause at each found
+search string and query whether to replace this instance or not. The
internal spell checker operates similarly. Note that there is no way to
force these functions to behave in the Pico fashion. As of version
1.1.99pre1, misspelled words are sorted and trimmed for uniqueness in
-the internal spell checker such that the words 'apple' and 'Apple' will
-be prompted for correction separately.
+the internal spell checker such that the words &rsquo;apple&rsquo; and &rsquo;Apple&rsquo; will
+be prompted for correction separately.
+</p></dd>
</dl>
-<div class="node">
-<a name="Building-and-Configure-Options"></a>
-<p><hr>
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#Pico-Compatibility">Pico Compatibility</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<hr>
+<a name="Building-and-Configure-Options"></a>
+<div class="header">
+<p>
+Previous: <a href="#Pico-Compatibility" accesskey="p" rel="prev">Pico Compatibility</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
-
+<a name="Building-and-Configure-Options-1"></a>
<h2 class="chapter">8 Building and Configure Options</h2>
<p>Building <code>nano</code> from source is fairly straightforward if you are
familiar with compiling programs with autoconf support:
-
- <ul>
-<li>tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of
+</p>
+<ul>
+<li> tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of
<code>nano</code>)
-<li>cd nano-x.y.z/
-<li>./configure
-<li>make
-<li>make install
-</ul>
-
- <p>The possible options to <code>./configure</code> are:
-
- <dl>
-<dt><code>--disable-browser</code><dd>Disable the mini file browser when reading or writing files.
+</li><li> cd nano-x.y.z/
+</li><li> ./configure
+</li><li> make
+</li><li> make install
+</li></ul>
- <br><dt><code>--disable-help</code><dd>Disable the help function. Doing this makes the binary much smaller,
+<p>The possible options to <code>./configure</code> are:
+</p>
+<dl compact="compact">
+<dt><code>--disable-browser</code></dt>
+<dd><p>Disable the mini file browser when reading or writing files.
+</p>
+</dd>
+<dt><code>--disable-color</code></dt>
+<dd><p>Disable support for the syntax coloring of files. This also eliminates
+the -Y command-line option, which chooses a specific syntax.
+</p>
+</dd>
+<dt><code>--disable-extra</code></dt>
+<dd><p>Disable extra features. At the moment, this is just easter-egg-type
+stuff.
+</p>
+</dd>
+<dt><code>--disable-help</code></dt>
+<dd><p>Disable the help function. Doing this makes the binary much smaller,
but makes it difficult for new users to learn more than very basic
things about using the editor.
-
- <br><dt><code>--disable-justify</code><dd>Disable the justify and unjustify functions.
-
- <br><dt><code>--disable-mouse</code><dd>Disable all mouse functionality. This also disables the -m command line
-option, which enables the mouse functionality.
-
- <br><dt><code>--disable-operatingdir</code><dd>Disable setting the operating directory. This also disables the -o
-command line option, which sets the operating directory.
-
- <br><dt><code>--disable-speller</code><dd>Disable use of the spell checker. This also disables the -s command
-line option, which allows specifying an alternate spell checker.
-
- <br><dt><code>--disable-tabcomp</code><dd>Disable the tab completion code when reading or writing files.
-
- <br><dt><code>--disable-wrapping</code><dd>Disable all long line wrapping. This also eliminates the -w command
-line option, which enables long line wrapping.
-
- <br><dt><code>--enable-tiny</code><dd>This option disables all the above. It also disables some of the larger
-internals of the editor, like the marking code and the cut to end of
-line code. It also disables the function toggles.
-
- <br><dt><code>--enable-debug</code><dd>Enable support for runtime debug output. This can get pretty messy, so
-chances are you only want this feature to work on the nano source.
-
- <br><dt><code>--enable-extra</code><dd>Enable extra features. At the moment, this is just easter egg-type
-stuff.
-
- <br><dt><code>--enable-color</code><dd>Enable support for syntax coloring of files using the nanorc file. This
-enables nanorc support as well.
-
- <br><dt><code>--enable-multibuffer</code><dd>Enable support for opening multiple files at a time and switching
-between them on the fly.
-
- <br><dt><code>--enable-nanorc</code><dd>Enable support for reading the nanorc file at startup. You can store
-custom settings in the nanorc file rather than having to pass command
-line options to get desired behavior. See See <a href="#Nanorc-Files">Nanorc Files</a>, for
-more info.
-
- <br><dt><code>--enable-all</code><dd>Shortcut for enabling the above four features (extra, color,
-multibuffer, and nanorc).
-
- <br><dt><code>--disable-nls</code><dd>Disables Native Language support. This will disable use of the
+</p>
+</dd>
+<dt><code>--disable-histories</code></dt>
+<dd><p>Disable the code for the handling of the history files: the search and
+replace strings that were used, and the cursor position at which each
+file was closed. This also eliminates the -H and -P command-line
+options, which switch on the logging of search/replace strings and
+cursor positions.
+</p>
+</dd>
+<dt><code>--disable-justify</code></dt>
+<dd><p>Disable the justify and unjustify functions.
+</p>
+</dd>
+<dt><code>--disable-libmagic</code></dt>
+<dd><p>Disable the use of the library of magic-number tests (for determining
+the file type and thus which syntax to use for colouring &ndash; often the
+tests on filename extension and header line will be enough).
+</p>
+</dd>
+<dt><code>--disable-mouse</code></dt>
+<dd><p>Disable all mouse functionality. This also eliminates the -m
+command-line option, which enables the mouse functionality.
+</p>
+</dd>
+<dt><code>--disable-multibuffer</code></dt>
+<dd><p>Disable support for opening multiple files at a time and switching
+between them on the fly. This also eliminates the -F command-line
+option, which switches the use of multiple file buffers on.
+</p>
+</dd>
+<dt><code>--disable-nanorc</code></dt>
+<dd><p>Disable support for reading the nanorc files at startup. With such
+support, you can store custom settings in a system-wide and a per-user
+nanorc file rather than having to pass command-line options to get
+the desired behavior. See See <a href="#Nanorc-Files">Nanorc Files</a>, for more info.
+Disabling this also eliminates the -I and -q command-line options;
+the first inhibits the reading of nanorcfiles, and the second
+suppresses warnings about errors in those files.
+</p>
+</dd>
+<dt><code>--disable-operatingdir</code></dt>
+<dd><p>Disable setting the operating directory. This also eliminates the -o
+command-line option, which sets the operating directory.
+</p>
+</dd>
+<dt><code>--disable-speller</code></dt>
+<dd><p>Disable use of the spell checker. This also eliminates the -s
+command-line option, which allows specifying an alternate spell checker.
+</p>
+</dd>
+<dt><code>--disable-tabcomp</code></dt>
+<dd><p>Disable the tab completion code when reading or writing files.
+</p>
+</dd>
+<dt><code>--disable-wrapping</code></dt>
+<dd><p>Disable hard-wrapping of overlong lines. This also eliminates the -w
+command-line option, which enables long-line wrapping.
+</p>
+</dd>
+<dt><code>--enable-tiny</code></dt>
+<dd><p>This option disables all the above. It also disables some of the larger
+internals of the editor, like the marking code and the cut-to-end-of-line
+code. It also disables the function toggles. By using the enabling
+counterpart of the above options together with &ndash;enable-tiny, specific
+features can be switched back on.
+</p>
+</dd>
+<dt><code>--enable-debug</code></dt>
+<dd><p>Enable support for runtime debug output. This can get pretty messy, so
+chances are you only want this feature when you&rsquo;re working on the nano source.
+</p>
+</dd>
+<dt><code>--disable-nls</code></dt>
+<dd><p>Disables Native Language support. This will disable the use of any
available GNU <code>nano</code> translations.
-
- <br><dt><code>--disable-wrapping-as-root</code><dd>Disable long line wrapping by default when nano is run as root.
-
- <br><dt><code>--enable-utf8</code><dd>Enable support for reading and writing Unicode files. This will require
+</p>
+</dd>
+<dt><code>--disable-wrapping-as-root</code></dt>
+<dd><p>Disable hard-wrapping of overlong lines by default when <code>nano</code>
+is run as root.
+</p>
+</dd>
+<dt><code>--enable-utf8</code></dt>
+<dd><p>Enable support for reading and writing Unicode files. This will require
either a wide version of curses, or a UTF-8-enabled version of Slang.
+</p>
+</dd>
+<dt><code>--disable-utf8</code></dt>
+<dd><p>Disable support for reading and writing Unicode files. Normally the
+configure script auto-detects whether to enable UTF-8 support or not.
+You can use this or the previous option to override that detection.
+</p>
+</dd>
+<dt><code>--with-slang</code></dt>
+<dd><p>Compile <code>nano</code> against Slang instead of against ncurses or other
+curses libraries.
+</p>
+</dd>
+</dl>
- <br><dt><code>--disable-utf8</code><dd>Disable support for reading and writing Unicode files.
-
- <br><dt><code>--with-slang</code><dd>Compiling <code>nano</code> with Slang is supported, and will make the binary
-notably smaller than if compiled with ncurses or other curses libraries.
+<a name="SEC_Contents"></a>
+<h2 class="contents-heading">Table of Contents</h2>
+
+<div class="contents">
+
+<ul class="no-bullet">
+ <li><a name="toc-Introduction-1" href="#Introduction">1 Introduction</a>
+ <ul class="no-bullet">
+ <li><a name="toc-Overview-1" href="#Overview">1.1 Overview</a></li>
+ <li><a name="toc-Command-Line-Options-1" href="#Command-Line-Options">1.2 Command Line Options</a></li>
+ </ul></li>
+ <li><a name="toc-Editor-Basics-1" href="#Editor-Basics">2 Editor Basics</a>
+ <ul class="no-bullet">
+ <li><a name="toc-Entering-Text-1" href="#Entering-Text">2.1 Entering Text</a></li>
+ <li><a name="toc-Special-Functions-1" href="#Special-Functions">2.2 Special Functions</a></li>
+ <li><a name="toc-The-Cutbuffer-1" href="#The-Cutbuffer">2.3 The Cutbuffer</a></li>
+ <li><a name="toc-The-Mark-1" href="#The-Mark">2.4 The Mark</a></li>
+ <li><a name="toc-The-Titlebar-1" href="#The-Titlebar">2.5 The Titlebar</a></li>
+ <li><a name="toc-The-Statusbar-1" href="#The-Statusbar">2.6 The Statusbar</a></li>
+ <li><a name="toc-Shortcut-Lists-1" href="#Shortcut-Lists">2.7 Shortcut Lists</a></li>
+ <li><a name="toc-Using-the-Mouse-1" href="#Using-the-Mouse">2.8 Using the Mouse</a></li>
+ </ul></li>
+ <li><a name="toc-Online-Help-1" href="#Online-Help">3 Online Help</a></li>
+ <li><a name="toc-Feature-Toggles-1" href="#Feature-Toggles">4 Feature Toggles</a></li>
+ <li><a name="toc-Nanorc-Files-1" href="#Nanorc-Files">5 Nanorc Files</a>
+ <ul class="no-bullet">
+ <li><a name="toc-Settings-1" href="#Settings">5.1 Settings</a></li>
+ <li><a name="toc-Syntax-Highlighting-1" href="#Syntax-Highlighting">5.2 Syntax Highlighting</a></li>
+ <li><a name="toc-Rebinding-Keys-1" href="#Rebinding-Keys">5.3 Rebinding Keys</a></li>
+ </ul></li>
+ <li><a name="toc-The-File-Browser-1" href="#The-File-Browser">6 The File Browser</a></li>
+ <li><a name="toc-Pico-Compatibility-1" href="#Pico-Compatibility">7 Pico Compatibility</a></li>
+ <li><a name="toc-Building-and-Configure-Options-1" href="#Building-and-Configure-Options">8 Building and Configure Options</a></li>
+</ul>
+</div>
- </dl>
+<hr>
- <div class="contents">
-<h2>Table of Contents</h2>
-<ul>
-<li><a name="toc_Introduction" href="#Introduction">1 Introduction</a>
-<ul>
-<li><a href="#Overview">1.1 Overview</a>
-<li><a href="#Command-Line-Options">1.2 Command Line Options</a>
-</li></ul>
-<li><a name="toc_Editor-Basics" href="#Editor-Basics">2 Editor Basics</a>
-<ul>
-<li><a href="#Entering-Text">2.1 Entering Text</a>
-<li><a href="#Special-Functions">2.2 Special Functions</a>
-<li><a href="#The-Titlebar">2.3 The Titlebar</a>
-<li><a href="#The-Statusbar">2.4 The Statusbar</a>
-<li><a href="#Shortcut-Lists">2.5 Shortcut Lists</a>
-<li><a href="#Using-the-Mouse">2.6 Using the Mouse</a>
-</li></ul>
-<li><a name="toc_Online-Help" href="#Online-Help">3 Online Help</a>
-<li><a name="toc_Feature-Toggles" href="#Feature-Toggles">4 Feature Toggles</a>
-<li><a name="toc_Nanorc-Files" href="#Nanorc-Files">5 Nanorc Files</a>
-<li><a name="toc_The-File-Browser" href="#The-File-Browser">6 The File Browser</a>
-<li><a name="toc_Pico-Compatibility" href="#Pico-Compatibility">7 Pico Compatibility</a>
-<li><a name="toc_Building-and-Configure-Options" href="#Building-and-Configure-Options">8 Building and Configure Options</a>
-</li></ul>
-</div>
-</body></html>
+</body>
+</html>
diff --git a/doc/texinfo/nano.info b/doc/texinfo/nano.info
index f4cd7ed..4597c8b 100644
--- a/doc/texinfo/nano.info
+++ b/doc/texinfo/nano.info
@@ -1,4 +1,4 @@
-This is nano.info, produced by makeinfo version 4.13 from nano.texi.
+This is nano.info, produced by makeinfo version 5.2 from nano.texi.
INFO-DIR-SECTION Editors
START-INFO-DIR-ENTRY
@@ -6,9 +6,12 @@ START-INFO-DIR-ENTRY
END-INFO-DIR-ENTRY

-File: nano.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
+File: nano.info, Node: Top, Next: Introduction, Up: (dir)
- This manual documents GNU `nano', a small and friendly text editor.
+nano Command Manual
+*******************
+
+This manual documents GNU 'nano', a small and friendly text editor.
* Menu:
@@ -27,10 +30,11 @@ File: nano.info, Node: Introduction, Next: Editor Basics, Prev: Top, Up: Top
1 Introduction
**************
-GNU `nano' is a small and friendly text editor. Besides basic text
-editing, `nano' offers many extra features like an interactive search
-and replace, go to line and column number, auto-indentation, feature
-toggles, internationalization support, and filename tab completion.
+GNU 'nano' is a small and friendly text editor. Besides basic text
+editing, 'nano' offers many extra features, like an interactive
+search-and-replace, go-to-line-and-column-number, auto-indentation,
+feature toggles, internationalization support, and filename tab
+completion.
* Menu:
@@ -38,30 +42,30 @@ toggles, internationalization support, and filename tab completion.
* Command Line Options::

-File: nano.info, Node: Overview, Next: Command Line Options, Prev: Introduction, Up: Introduction
+File: nano.info, Node: Overview, Next: Command Line Options, Up: Introduction
1.1 Overview
============
-The original goal for `nano' was a complete bug-for-bug compatible
-emulation of Pico, but `nano''s current goal is to be as compatible as
+The original goal for 'nano' was a complete bug-for-bug compatible
+emulation of Pico, but 'nano''s current goal is to be as compatible as
possible while offering a superset of Pico's functionality. See *Note
Pico Compatibility::, for more info.
- The usual way to invoke `nano' is:
+ The usual way to invoke 'nano' is:
- `nano [OPTION]... [FILE]'
+ 'nano [OPTION]... [FILE]'
But it is also possible to edit several files in a row.
Additionally, the cursor can be put on a desired line number by adding
this number with a plus sign before any filename, and even in a desired
column by adding it with a comma. So the complete synopsis is:
- `nano [OPTION]... [[+LINE] FILE]...'
+ 'nano [OPTION]... [[+LINE] FILE]...'
- `nano [OPTION]... [[+,COLUMN] FILE]...'
+ 'nano [OPTION]... [[+,COLUMN] FILE]...'
- `nano [OPTION]... [[+LINE,COLUMN] FILE]...'
+ 'nano [OPTION]... [[+LINE,COLUMN] FILE]...'
Email bug reports to <nano@nano-editor.org>.
@@ -71,194 +75,255 @@ File: nano.info, Node: Command Line Options, Prev: Overview, Up: Introduction
1.2 Command Line Options
========================
-`nano' takes the following options from the command line:
+'nano' takes the following options from the command line:
-`+LINE,COLUMN'
+'+LINE,COLUMN'
Start at line number LINE and column number COLUMN (at least one of
which must be specified) instead of the default of line 1, column
1.
-`-?'
- Same as `-h, --help'.
-
-`-A, --smarthome'
+'-A'
+'--smarthome'
Make the Home key smarter. When Home is pressed anywhere but at
the very beginning of non-whitespace characters on a line, the
cursor will jump to that beginning (either forwards or backwards).
- If the cursor is already at that position, it will jump to the
- true beginning of the line.
+ If the cursor is already at that position, it will jump to the true
+ beginning of the line.
-`-B, --backup'
+'-B'
+'--backup'
When saving a file, back up the previous version of it to the
- current filename suffixed with a ~.
+ current filename suffixed with a '~'.
-`-C <dir>, --backupdir=<dir>'
- Set the directory where `nano' puts unique backup files if file
+'-C DIRECTORY'
+'--backupdir=DIRECTORY'
+ Set the directory where 'nano' puts unique backup files if file
backups are enabled.
-`-D, --boldtext'
+'-D'
+'--boldtext'
Use bold text instead of reverse video text.
-`-E, --tabstospaces'
+'-E'
+'--tabstospaces'
Convert typed tabs to spaces.
-`-F, --multibuffer'
- Enable multiple file buffers, if available.
+'-F'
+'--multibuffer'
+ Enable multiple file buffers (if support for them has been compiled
+ in).
+
+'-G'
+'--locking'
+ Enable vim-style file locking when editing files.
-`-H, --historylog'
- Log search and replace strings to ~/.nano_history, so they can be
- retrieved in later sessions, if nanorc support is available.
+'-H'
+'--historylog'
+ Log search and replace strings to '~/.nano/search_history', so they
+ can be retrieved in later sessions.
-`-I, --ignorercfiles'
- Don't look at SYSCONFDIR/nanorc or ~/.nanorc, if nanorc support is
- available.
+'-I'
+'--ignorercfiles'
+ Don't look at the system's nanorc file nor at the user's
+ '~/.nanorc'.
-`-K, --rebindkeypad'
+'-K'
+'--rebindkeypad'
Interpret the numeric keypad keys so that they all work properly.
You should only need to use this option if they don't, as mouse
support won't work properly with this option enabled.
-`-L, --nonewlines'
+'-L'
+'--nonewlines'
Don't add newlines to the ends of files.
-`-N, --noconvert'
- Don't convert files from DOS/Mac format.
+'-N'
+'--noconvert'
+ Disable automatic conversion of files from DOS/Mac format.
-`-O, --morespace'
+'-O'
+'--morespace'
Use the blank line below the titlebar as extra editing space.
-`-Q <str>, --quotestr=<str>'
+'-P'
+'--poslog'
+ Log for each file the last location of the cursor, and read it back
+ upon reopening the file and place it there again.
+
+'-Q "CHARACTERS"'
+'--quotestr="CHARACTERS"'
Set the quoting string for justifying. The default value is
- `^([ \t]*[|>:}#])+'
+ "^([ \t]*[|>:}#])+"
- if extended regular expression support is available, or "> "
- otherwise. Note that `\t' above stands for a literal Tab
+ if extended regular expression support is available, or '> '
+ otherwise. Note that '\t' above stands for a literal Tab
character.
-`-R, --restricted'
+'-R'
+'--restricted'
Restricted mode: don't read or write to any file not specified on
- the command line; read any nanorc files; allow suspending; allow a
- file to be appended to, prepended to, or saved under a different
- name if it already has one; or use backup files or spell checking.
- Also accessible by invoking `nano' with any name beginning with
- 'r' (e.g. "rnano").
-
-`-S, --smooth'
- Enable smooth scrolling. Text will scroll line-by-line, instead
- of the usual chunk-by-chunk behavior.
-
-`-T <#cols>, --tabsize=<#cols>'
- Set the displayed tab length to #cols columns. The value of #cols
- must be greater than 0. The default value is 8.
-
-`-U, --quickblank'
+ the command line; don't read any nanorc files nor history files;
+ don't allow suspending nor spell checking; don't allow a file to be
+ appended to, prepended to, or saved under a different name if it
+ already has one; and don't use backup files. This restricted mode
+ is also accessible by invoking 'nano' with any name beginning with
+ 'r' (e.g. 'rnano').
+
+'-S'
+'--smooth'
+ Enable smooth scrolling. Text will scroll line-by-line, instead of
+ the usual chunk-by-chunk behavior.
+
+'-T NUMBER'
+'--tabsize=NUMBER'
+ Set the displayed tab length to NUMBER columns. The value of
+ NUMBER must be greater than 0. The default value is '8'.
+
+'-U'
+'--quickblank'
Do quick statusbar blanking. Statusbar messages will disappear
- after 1 keystroke instead of 25. Note that -c overrides this.
+ after 1 keystroke instead of 25. Note that '-c' overrides this.
-`-V, --version'
+'-V'
+'--version'
Show the current version number and exit.
-`-W, --wordbounds'
+'-W'
+'--wordbounds'
Detect word boundaries more accurately by treating punctuation
characters as parts of words.
-`-Y <str>, --syntax=<str>'
- Specify a specific syntax highlighting from the nanorc to use, if
- available. See *Note Nanorc Files::, for more info.
+'-Y NAME'
+'--syntax=NAME'
+ Specify a specific syntax from the nanorc files to use for
+ highlighting. See *Note Syntax Highlighting::, for more info.
-`-c, --const'
+'-c'
+'--const'
Constantly display the cursor position and line number on the
- statusbar. Note that this overrides -U.
+ statusbar. Note that this overrides '-U'.
-`-d, --rebinddelete'
+'-d'
+'--rebinddelete'
Interpret the Delete key differently so that both Backspace and
Delete work properly. You should only need to use this option if
Backspace acts like Delete on your system.
-`-h, --help'
- Show a summary of command line options and exit.
+'-h'
+'--help'
+ Show a summary of command-line options and exit.
-`-i, --autoindent'
+'-i'
+'--autoindent'
Automatically indent new lines to the same number of spaces and
tabs as the previous line.
-`-k, --cut'
- Cut from the current cursor position to the end of the current
- line.
+'-k'
+'--cut'
+ Make the 'Cut Text' command (normally ^K) cut from the current
+ cursor position to the end of the line, instead of cutting the
+ entire line.
-`-l, --nofollow'
+'-l'
+'--nofollow'
When writing files, if the given file is a symbolic link, it is
removed and a new file is created.
-`-m, --mouse'
+'-m'
+'--mouse'
Enable mouse support, if available for your system. When enabled,
mouse clicks can be used to place the cursor, set the mark (with a
- double click), and execute shortcuts. The mouse will work in the
- X Window System, and on the console when gpm is running.
-
-`-o <dir>, --operatingdir=<dir>'
- Set operating directory. Makes `nano' set up something similar to
- a chroot.
-
-`-p, --preserve'
- Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent
- to the editor can be can be stopped and started.
-
-`-q, --quiet'
- Do not report errors in the nanorc file and ask them to be
+ double click), and execute shortcuts. The mouse will work in the X
+ Window System, and on the console when gpm is running. Text can
+ still be selected through dragging by holding down the Shift key.
+
+'-n'
+'--noread'
+ Treat any name given on the command line as a new file. This
+ allows 'nano' to write to named pipes: it will start with a blank
+ buffer, and will write to the pipe when the user saves the "file".
+ This way 'nano' can be used as an editor in combination with for
+ instance 'gpg' without having to write sensitive data to disk
+ first.
+
+'-o DIRECTORY'
+'--operatingdir=DIRECTORY'
+ Set the operating directory. This makes 'nano' set up something
+ similar to a chroot.
+
+'-p'
+'--preserve'
+ Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent to
+ the editor can be stopped and started.
+
+'-q'
+'--quiet'
+ Do not report errors in the nanorc file nor ask them to be
acknowledged by pressing Enter at startup.
-`-r <#cols>, --fill=<#cols>'
- Wrap lines at column #cols. If this value is 0 or less, wrapping
- will occur at the width of the screen less #cols, allowing it to
- vary along with the width of the screen if the screen is resized.
- The default value is -8.
-
-`-s <prog>, --speller=<prog>'
- Invoke the given program as the spell checker. By default, `nano'
- uses the command specified in the SPELL environment variable, or,
- if SPELL is not set, its own interactive spell checker that
- requires the `spell' program to be installed on your system.
-
-`-t, --tempfile'
+'-r NUMBER'
+'--fill=NUMBER'
+ Hard-wrap lines at column NUMBER (by inserting a newline
+ character). If the given value is 0 or less, wrapping will occur
+ at the width of the screen minus the given amount, allowing the
+ wrapping width to vary along with the width of the screen if and
+ when it is resized. The default value is '-8'. This option
+ conflicts with '-w' - the last one given takes effect.
+
+'-s PROGRAM'
+'--speller=PROGRAM'
+ Invoke the given program as the spell checker. By default, 'nano'
+ uses the command specified in the 'SPELL' environment variable, or,
+ if 'SPELL' is not set, its own interactive spell checker that
+ requires the 'spell' program to be installed on your system.
+
+'-t'
+'--tempfile'
Don't ask whether or not to save the current contents of the file
- when exiting, assume yes. This is most useful when using `nano'
- as the composer of a mailer program.
-
-`-u, --undo'
- Enable experimental generic-purpose undo code. By default, the
- undo and redo shortcuts are Meta-U and Meta-E, respectively.
+ when exiting, assume yes. This is most useful when using 'nano' as
+ the composer of a mailer program.
-`-v, --view'
+'-v'
+'--view'
Don't allow the contents of the file to be altered. Note that this
option should NOT be used in place of correct file permissions to
implement a read-only file.
-`-w, --nowrap'
- Don't wrap long lines at any length. This option overrides any
- value for -r.
+'-w'
+'--nowrap'
+ Don't hard-wrap long lines at any length. This option conflicts
+ with '-r' - the last one given takes effect.
-`-x, --nohelp'
+'-x'
+'--nohelp'
Expert Mode: don't show the Shortcut Lists at the bottom of the
screen. This affects the location of the statusbar as well, as in
Expert Mode it is located at the very bottom of the editor.
Note: When accessing the help system, Expert Mode is temporarily
- disabled to display the help system navigation keys.
+ disabled to display the help-system navigation keys.
-`-z, --suspend'
- Enable `nano''s suspend ability using the system's suspend
+'-z'
+'--suspend'
+ Enable the ability to suspend 'nano' using the system's suspend
keystroke (usually ^Z).
-`-$, --softwrap'
- Enable 'soft wrapping'. `nano' will attempt to display the entire
- contents of a line, even if it is longer than the screen width.
- Since '$' normally refers to a variable in the Unix shell, you
- should specify this option last when using other options (e.g.
- 'nano -wS$') or pass it separately (e.g. 'nano -wS -$').
-
-`-a, -b, -e, -f, -g, -j'
+'-$'
+'--softwrap'
+ Enable 'soft wrapping'. This will make 'nano' attempt to display
+ the entire contents of any line, even if it is longer than the
+ screen width, by continuing it over multiple screen lines. Since
+ '$' normally refers to a variable in the Unix shell, you should
+ specify this option last when using other options (e.g. 'nano
+ -wS$') or pass it separately (e.g. 'nano -wS -$').
+
+'-a'
+'-b'
+'-e'
+'-f'
+'-g'
+'-j'
Ignored, for compatibility with Pico.

@@ -271,66 +336,103 @@ File: nano.info, Node: Editor Basics, Next: Online Help, Prev: Introduction,
* Entering Text::
* Special Functions::
+* The Cutbuffer::
+* The Mark::
* The Titlebar::
* The Statusbar::
* Shortcut Lists::
* Using the Mouse::

-File: nano.info, Node: Entering Text, Next: Special Functions, Prev: Editor Basics, Up: Editor Basics
+File: nano.info, Node: Entering Text, Next: Special Functions, Up: Editor Basics
2.1 Entering Text
=================
-All key sequences in `nano' are entered using the keyboard. `nano' is
-a "modeless" editor. All keys, with the exception of Control and Meta
-key sequences, will enter text into the file being edited.
+'nano' is a "modeless" editor. All keystrokes, with the exception of
+Control and Meta key sequences, enter text into the file being edited.
+All key sequences in 'nano' are entered using the keyboard.

-File: nano.info, Node: Special Functions, Next: The Titlebar, Prev: Entering Text, Up: Editor Basics
+File: nano.info, Node: Special Functions, Next: The Cutbuffer, Prev: Entering Text, Up: Editor Basics
2.2 Special Functions
=====================
-Special functions use the Control (Ctrl) key, displayed in the help and
-shortcut lists as ^; the Meta key, displayed as M; or the Escape (Esc)
-key.
+Special functions use the Control key (Ctrl), displayed in the help and
+shortcut lists as ^; the Meta key (Alt or Cmd), displayed as M-; or the
+Escape key (Esc).
* Control key sequences are entered by holding down the Ctrl key and
- pressing the desired key, or by pressing the Esc key twice and
+ pressing the desired key, or by pressing the Esc key twice and then
pressing the desired key.
-
- * Pressing Esc twice and then typing a three-digit number from 000
- to 255 will enter the character with the corresponding value.
-
+ * Pressing the Esc key twice and then typing a three-digit number
+ from 000 to 255 will enter the character with the corresponding
+ value.
* Meta key sequences are entered by holding down the Meta key
- (normally the Alt key) and pressing the desired key, or by
- pressing the Esc key once and pressing the desired key. Certain
+ (normally the Alt key) and pressing the desired key, or by pressing
+ the Esc key once and then pressing the desired key. Certain
operating systems "swallow" the Alt key so that it never reaches
- the application; if your operating system does this, you should
- use the Esc key to generate Meta key sequences.
+ the application; if your operating system does this, you should use
+ the Esc key to generate Meta key sequences.

-File: nano.info, Node: The Titlebar, Next: The Statusbar, Prev: Special Functions, Up: Editor Basics
+File: nano.info, Node: The Cutbuffer, Next: The Mark, Prev: Special Functions, Up: Editor Basics
+
+2.3 The Cutbuffer
+=================
+
+Text can be cut from a file, a whole line at a time, by using the 'Cut
+Text' command (default key binding: ^K). The cut line is stored in the
+cutbuffer. Consecutive strokes of ^K will add each cut line to this
+buffer, but a ^K after any other keystroke will overwrite the entire
+cutbuffer.
+
+ The contents of the cutbuffer can be pasted back into the file with
+the 'Uncut Text' command (default key binding: ^U).
+
+ A line of text can be copied into the cutbuffer (without cutting it)
+with the 'Copy Text' command (default key binding: M-6).
-2.3 The Titlebar
+
+File: nano.info, Node: The Mark, Next: The Titlebar, Prev: The Cutbuffer, Up: Editor Basics
+
+2.4 The Mark
+============
+
+Text can be selected by first 'setting the Mark' (default key bindings:
+^6 and M-A) and then moving the cursor to the other end of the portion
+to be selected. The selected portion of text will be highlighted in
+reverse video (or in bold if you set the boldtext option). This
+selection can now be cut or copied in its entirety with a single ^K or
+M-6. Or the selection can be used to limit the scope of a
+search-and-replace (^\) or spell-checking session (^T).
+
+ Cutting or copying selected text will toggle the mark off
+automatically. If necessary, it can be toggled off manually with
+another ^6 or M-A.
+
+
+File: nano.info, Node: The Titlebar, Next: The Statusbar, Prev: The Mark, Up: Editor Basics
+
+2.5 The Titlebar
================
The titlebar is the line displayed at the top of the editor. There are
three sections: left, center and right. The section on the left
-displays the version of `nano' being used. The center section displays
+displays the version of 'nano' being used. The center section displays
the current filename, or "New Buffer" if the file has not yet been
-named. The section on the right will display "Modified" if the file
-has been modified since it was last saved or opened.
+named. The section on the right will display "Modified" if the file has
+been modified since it was last saved or opened.
- Special modes: When `nano' is in "File browser" mode, the center
+ Special modes: When 'nano' is in "File browser" mode, the center
section will display the current directory instead of the filename. See
*Note The File Browser::, for more info.

File: nano.info, Node: The Statusbar, Next: Shortcut Lists, Prev: The Titlebar, Up: Editor Basics
-2.4 The Statusbar
+2.6 The Statusbar
=================
The statusbar is the third line from the bottom of the screen, or the
@@ -338,12 +440,12 @@ bottom line in Expert Mode. See *Note Expert Mode::, for more info. It
shows important and informational messages. Any error messages that
occur from using the editor will appear on the statusbar. Any questions
that are asked of the user will be asked on the statusbar, and any user
-input (search strings, filenames, etc.) will be input on the statusbar.
+input (search strings, filenames, etc.) will be input on the statusbar.

File: nano.info, Node: Shortcut Lists, Next: Using the Mouse, Prev: The Statusbar, Up: Editor Basics
-2.5 Shortcut Lists
+2.7 Shortcut Lists
==================
The Shortcut Lists are the two lines at the bottom of the screen which
@@ -352,13 +454,15 @@ show some of the more commonly used functions in the editor.

File: nano.info, Node: Using the Mouse, Prev: Shortcut Lists, Up: Editor Basics
-2.6 Using the Mouse
+2.8 Using the Mouse
===================
When mouse support has been configured and enabled, a single mouse click
places the cursor at the indicated position. Clicking a second time in
the same position toggles the mark. Clicking in the shortcut list
-executes the selected shortcut.
+executes the selected shortcut. To be able to select text with the left
+button, or paste text with the middle button, hold down the Shift key
+during those actions.
The mouse will work in the X Window System, and on the console when
gpm is running.
@@ -369,10 +473,10 @@ File: nano.info, Node: Online Help, Next: Feature Toggles, Prev: Editor Basic
3 Online Help
*************
-The online help system in `nano' is available by pressing ^G. It is
-fairly self explanatory, documenting the various parts of the editor
-and available keystrokes. Navigation is via the ^Y (Page Up) and ^V
-(Page Down) keys. ^X exits the help system.
+The online help system in 'nano' is available by pressing ^G. It is
+fairly self-explanatory, documenting the various parts of the editor and
+available keystrokes. Navigation is via the ^Y (Page Up) and ^V (Page
+Down) keys. ^X exits the help system.

File: nano.info, Node: Feature Toggles, Next: Nanorc Files, Prev: Online Help, Up: Top
@@ -381,63 +485,62 @@ File: nano.info, Node: Feature Toggles, Next: Nanorc Files, Prev: Online Help
*****************
Toggles allow you to change certain aspects of the editor that would
-normally be done via command line options. They are invoked via Meta
+normally be done via command-line options. They are invoked via Meta
key sequences. See *Note Special Functions::, for more info. The
following global toggles are available:
-`Backup Files Toggle (Meta-B)'
- toggles the -B (`--backup') command line option.
+'Backup Files Toggle (Meta-B)'
+ toggles the -B ('--backup') command line option.
-`Constant Cursor Position Display Toggle (Meta-C)'
- toggles the -c (`--const') command line option.
+'Constant Cursor Position Display Toggle (Meta-C)'
+ toggles the -c ('--const') command line option.
-`Multiple File Buffers Toggle (Meta-F)'
- toggles the -F (`--multibuffer') command line option.
+'Multiple File Buffers Toggle (Meta-F)'
+ toggles the -F ('--multibuffer') command line option.
-`Smart Home Key Toggle (Meta-H)'
- toggles the -A (`--smarthome') command line option.
+'Smart Home Key Toggle (Meta-H)'
+ toggles the -A ('--smarthome') command line option.
-`Auto Indent Toggle (Meta-I)'
- toggles the -i (`--autoindent') command line option.
+'Auto Indent Toggle (Meta-I)'
+ toggles the -i ('--autoindent') command line option.
-`Cut To End Toggle (Meta-K)'
- toggles the -k (`--cut') command line option.
+'Cut To End Toggle (Meta-K)'
+ toggles the -k ('--cut') command line option.
-`Long Line Wrapping Toggle (Meta-L)'
- toggles the -w (`--nowrap') command line option.
+'Long Line Wrapping Toggle (Meta-L)'
+ toggles the -w ('--nowrap') command line option.
-`Mouse Support Toggle (Meta-M)'
- toggles the -m (`--mouse') command line option.
+'Mouse Support Toggle (Meta-M)'
+ toggles the -m ('--mouse') command line option.
-`No Conversion From DOS/Mac Format Toggle (Meta-N)'
- toggles the -N (`--noconvert') command line option.
+'No Conversion From DOS/Mac Format Toggle (Meta-N)'
+ toggles the -N ('--noconvert') command line option.
-`More Space For Editing Toggle (Meta-O)'
- toggles the -O (`--morespace') command line option.
+'More Space For Editing Toggle (Meta-O)'
+ toggles the -O ('--morespace') command line option.
-`Whitespace Display Toggle (Meta-P)'
- toggles whitespace display mode if you have a "whitespace" option
- in your nanorc. See *Note Nanorc Files::, for more info.
+'Whitespace Display Toggle (Meta-P)'
+ toggles whitespace-display mode. See *Note Whitespace::, for more
+ info.
-`Tabs to Spaces Toggle (Meta-Q)'
- toggles the -E (`--tabstospaces') command line option.
+'Tabs to Spaces Toggle (Meta-Q)'
+ toggles the -E ('--tabstospaces') command line option.
-`Smooth Scrolling Toggle (Meta-S)'
- toggles the -S (`--smooth') command line option.
+'Smooth Scrolling Toggle (Meta-S)'
+ toggles the -S ('--smooth') command line option.
-`Expert/No Help Toggle (Meta-X)'
- toggles the -x (`--nohelp') command line option.
+'Expert/No Help Toggle (Meta-X)'
+ toggles the -x ('--nohelp') command line option.
-`Color Syntax Highlighting Toggle (Meta-Y)'
+'Color Syntax Highlighting Toggle (Meta-Y)'
toggles color syntax highlighting if you have color syntaxes in
- your nanorc. See *Note Nanorc Files::, for more info.
-
-`Suspend Toggle (Meta-Z)'
- toggles the -z (`--suspend') command line option.
+ your nanorc. See *Note Syntax Highlighting::, for more info.
-`Soft Wrapping Toggle (Meta-$)'
- toggles the -$ (`--softwrap') command line option.
+'Suspend Toggle (Meta-Z)'
+ toggles the -z ('--suspend') command line option.
+'Soft Wrapping Toggle (Meta-$)'
+ toggles the -$ ('--softwrap') command line option.

File: nano.info, Node: Nanorc Files, Next: The File Browser, Prev: Feature Toggles, Up: Top
@@ -445,225 +548,312 @@ File: nano.info, Node: Nanorc Files, Next: The File Browser, Prev: Feature To
5 Nanorc Files
**************
-The nanorc files contain the default settings for `nano'. They should
-not be in DOS or Mac format. During startup, `nano' will first read
-its system-wide settings from SYSCONFDIR/nanorc, and then user-specific
-settings from ~/.nanorc.
+The nanorc files contain the default settings for 'nano'. They should
+be in Unix format, not in DOS or Mac format. During startup, 'nano'
+will first read the system-wide settings, from /etc/nanorc (the exact
+path might be different), and then the user-specific settings, from
+~/.nanorc.
A nanorc file accepts a series of "set" and "unset" commands, which
-can be used to configure `nano' on startup without using the command
-line options. Additionally, the "syntax", "color", and "icolor"
-keywords are used to define syntax highlighting rules for different text
-patterns. `nano' will read one command per line.
-
- Options in nanorc files take precedence over `nano''s defaults, and
-command line options override nanorc settings. Options are also unset
-by default, except for those that take arguments.
+can be used to configure 'nano' on startup without using command-line
+options. Additionally, there are some commands to define syntax
+highlighting and to rebind keys - *Note Syntax Highlighting::, and *Note
+Rebinding Keys::. 'nano' will read one command per line.
+
+ Options in nanorc files take precedence over 'nano''s defaults, and
+command-line options override nanorc settings. Also, options that do
+not take an argument are unset by default. So using the 'unset' command
+is only needed when wanting to override a setting of the system's nanorc
+file in your own '~/.nanorc'. Options that take an argument cannot be
+unset.
Quotes inside string parameters don't have to be escaped with
backslashes. The last double quote in the string will be treated as its
-end. For example, for the "brackets" option,
+end. For example, for the "brackets" option, '""')>]}"' will match '"',
+''', ')', '>', ']', and '}'.
+
+* Menu:
+
+* Settings::
+* Syntax Highlighting::
+* Rebinding Keys::
+
+
+File: nano.info, Node: Settings, Next: Syntax Highlighting, Up: Nanorc Files
- `""')>]}"'
+5.1 Settings
+============
- will match `"', `'', `)', `>', `]', and `}'.
+The supported settings in a nanorc file are:
- The supported commands and arguments are:
+'set allow_insecure_backup'
+ When backing up files, allow the backup to succeed even if its
+ permissions can't be (re)set due to special OS considerations. You
+ should NOT enable this option unless you are sure you need it.
-`set/unset autoindent'
+'set autoindent'
Use auto-indentation.
-`set/unset backup'
- Create backup files in "filename~".
+'set backup'
+ When saving a file, back up the previous version of it to the
+ current filename suffixed with a tilde ('~').
-`set backupdir "directory"'
- Set the directory where `nano' puts unique backup files if file
+'set backupdir "directory"'
+ Set the directory where 'nano' puts unique backup files, if file
backups are enabled.
-`set/unset backwards'
+'set backwards'
Do backwards searches by default.
-`set/unset boldtext'
- Use bold text instead of reverse video text.
+'set boldtext'
+ Use bold instead of reverse video for the titlebar, statusbar, key
+ combos, and selected text. This can be overridden for the first
+ three by setting the options "titlecolor", "statuscolor", and
+ "keycolor".
-`set brackets "string"'
+'set brackets "STRING"'
Set the characters treated as closing brackets when justifying
- paragraphs. They cannot contain blank characters. Only closing
- punctuation, optionally followed by closing brackets, can end
- sentences. The default value is
+ paragraphs. This may not include blank characters. Only closing
+ punctuation (see "punct"), optionally followed by the specified
+ closing brackets, can end sentences. The default value is
- `""')>]}"'
+ ""')>]}"
-`set/unset casesensitive'
- Do case sensitive searches by default.
+'set casesensitive'
+ Do case-sensitive searches by default.
-`set/unset const'
+'set const'
Constantly display the cursor position in the status bar.
-`set/unset cut'
- Use cut to end of line by default, instead of cutting the whole
+'set cut'
+ Use cut-to-end-of-line by default, instead of cutting the whole
line.
-`set fill "n"'
- Wrap lines at column number "n". If "n" is 0 or less, the maximum
- line length will be the screen width less "n" columns. The
- default value is -8.
+'set fill NUMBER'
+ Hard-wrap lines at column number NUMBER. If NUMBER is 0 or less,
+ the maximum line length will be the screen width less NUMBER
+ columns. The default value is -8.
+
+'set functioncolor FGCOLOR,BGCOLOR'
+ Specify the color combination to use for the function descriptions
+ in the two help lines at the bottom of the screen. See 'set
+ titlecolor' for more details.
+
+'set historylog'
+ Enable the use of '~/.nano/search_history' for saving and reading
+ search/replace strings.
-`set/unset historylog'
- Enable ~/.nano_history for saving and reading search/replace
- strings.
+'set keycolor FGCOLOR,BGCOLOR'
+ Specify the color combination to use for the shortcut key combos in
+ the two help lines at the bottom of the screen. See 'set
+ titlecolor' for more details.
-`set matchbrackets "string"'
+'set locking'
+ Enable vim-style lock-files for when editing files.
+
+'set matchbrackets "STRING"'
Set the opening and closing brackets that can be found by bracket
- searches. They cannot contain blank characters. The former set
- must come before the latter set, and both must be in the same
- order. The default value is
+ searches. This may not include blank characters. The opening set
+ must come before the closing set, and the two sets must be in the
+ same order. The default value is
- `"(<[{)>]}"'
+ "(<[{)>]}"
-`set/unset morespace'
+'set morespace'
Use the blank line below the titlebar as extra editing space.
-`set/unset mouse'
+'set mouse'
Enable mouse support, so that mouse clicks can be used to place the
cursor, set the mark (with a double click), or execute shortcuts.
-`set/unset multibuffer'
+'set multibuffer'
Allow inserting files into their own buffers.
-`set/unset noconvert'
+'set noconvert'
Don't convert files from DOS/Mac format.
-`set/unset nofollow'
+'set nofollow'
Don't follow symlinks when writing files.
-`set/unset nohelp'
+'set nohelp'
Don't display the help lists at the bottom of the screen.
-`set/unset nonewlines'
+'set nonewlines'
Don't add newlines to the ends of files.
-`set/unset nowrap'
- Don't wrap text at all.
+'set nowrap'
+ Don't hard-wrap text at all.
-`set operatingdir "directory"'
- `nano' will only read and write files inside "directory" and its
+'set operatingdir "directory"'
+ 'nano' will only read and write files inside "directory" and its
subdirectories. Also, the current directory is changed to here, so
files are inserted from this directory. By default, the operating
directory feature is turned off.
-`set/unset preserve'
+'set poslog'
+ Save the cursor position of files between editing sessions.
+
+'set preserve'
Preserve the XON and XOFF keys (^Q and ^S).
-`set punct "string"'
+'set punct "STRING"'
Set the characters treated as closing punctuation when justifying
- paragraphs. They cannot contain blank characters. Only closing
- punctuation, optionally followed by closing brackets, can end
- sentences. The default value is `"!.?"'.
+ paragraphs. This may not include blank characters. Only the
+ specified closing punctuation, optionally followed by closing
+ brackets (see "brackets"), can end sentences. The default value is
+ "!.?".
-`set/unset quickblank'
+'set quickblank'
Do quick statusbar blanking. Statusbar messages will disappear
after 1 keystroke instead of 25.
-`set quotestr "string"'
+'set quiet'
+ When set, 'nano' will not report errors in the nanorc file nor ask
+ them to be acknowledged by pressing Enter at startup. If this
+ option is used, it should be placed at the top of the file to be
+ fully effective.
+
+'set quotestr "STRING"'
The email-quote string, used to justify email-quoted paragraphs.
This is an extended regular expression if your system supports
them, otherwise a literal string. The default value is
- `"^([ \\t]*[#:>\\|}])+"'
+ "^([ \\t]*[#:>\\|}])+"
- if you have extended regular expression support, or "> " otherwise.
- Note that '\\t' stands for a literal Tab character.
+ if you have extended regular expression support, and "> "
+ otherwise. Note that '\\t' stands for a literal Tab character.
-`set/unset rebinddelete'
+'set rebinddelete'
Interpret the Delete key differently so that both Backspace and
Delete work properly. You should only need to use this option if
Backspace acts like Delete on your system.
-`set/unset rebindkeypad'
+'set rebindkeypad'
Interpret the numeric keypad keys so that they all work properly.
You should only need to use this option if they don't, as mouse
support won't work properly with this option enabled.
-`set/unset regexp'
+'set regexp'
Do extended regular expression searches by default.
-`set/unset smarthome'
+'set smarthome'
Make the Home key smarter. When Home is pressed anywhere but at
the very beginning of non-whitespace characters on a line, the
cursor will jump to that beginning (either forwards or backwards).
- If the cursor is already at that position, it will jump to the
- true beginning of the line.
+ If the cursor is already at that position, it will jump to the true
+ beginning of the line.
-`set/unset smooth'
+'set smooth'
Use smooth scrolling by default.
-`set/unset softwrap'
- Use soft wrapping by default.
+'set softwrap'
+ Enable soft line wrapping for easier viewing of very long lines.
-`set speller "spellprog"'
+'set speller "spellprog"'
Use spelling checker "spellprog" instead of the built-in one, which
calls "spell".
-`set/unset suspend'
- Allow `nano' to be suspended.
+'set statuscolor FGCOLOR,BGCOLOR'
+ Specify the color combination to use for the statusbar. See 'set
+ titlecolor' for more details.
-`set/unset suspendenable'
- If `nano' is allowed to be suspended, allow the suspend key
- (usually ^Z) to actually suspend it.
+'set suspend'
+ Allow 'nano' to be suspended.
-`set tabsize "n"'
- Use a tab size of "n" columns. The value of "n" must be greater
- than 0. The default value is 8.
+'set tabsize NUMBER'
+ Use a tab size of NUMBER columns. The value of NUMBER must be
+ greater than 0. The default value is 8.
-`set/unset tabstospaces'
+'set tabstospaces'
Convert typed tabs to spaces.
-`set/unset tempfile'
+'set tempfile'
Save automatically on exit, don't prompt.
-`set/unset undo'
- Enable experimental generic-purpose undo code.
+'set titlecolor FGCOLOR,BGCOLOR'
+ Specify the color combination to use for the titlebar. Valid color
+ names for foreground and background are: white, black, red, blue,
+ green, yellow, magenta, and cyan. And either FGCOLOR or ,BGCOLOR
+ may be left out.
-`set/unset view'
+'set view'
Disallow file modification.
-`set whitespace "string"'
- Set the two characters used to display the first characters of
- tabs and spaces. They must be single-column characters.
+'set whitespace "STRING"'
+ Set the two characters used to indicate the presence of tabs and
+ spaces. They must be single-column characters. The default pair
+ for a UTF-8 locale is "»·", and for other locales ">.".
-`set/unset wordbounds'
+'set wordbounds'
Detect word boundaries more accurately by treating punctuation
characters as part of a word.
-`syntax "str" ["fileregex" ... ]'
+
+File: nano.info, Node: Syntax Highlighting, Next: Rebinding Keys, Prev: Settings, Up: Nanorc Files
+
+5.2 Syntax Highlighting
+=======================
+
+Coloring the different syntactic elements of a file is done via regular
+expressions (see the 'color' command below). This is inherently
+imperfect, because regular expressions are not powerful enough to fully
+parse a file. Nevertheless, regular expressions can do a lot and are
+easy to make, so they are a good fit for a small editor like 'nano'.
+
+ A separate syntax can be defined for each kind of file via the
+following commands in a nanorc file:
+
+'syntax "str" ["fileregex" ...]'
Defines a syntax named "str" which can be activated via the
- -Y/-syntax command line option, or will be automatically activated
+ -Y/-syntax command-line option, or will be automatically activated
if the current filename matches the extended regular expression
"fileregex". All following "color" and "icolor" statements will
- apply to "syntax" until a new syntax is defined.
-
- The "none" syntax is reserved; specifying it on the command line
- is the same as not having a syntax at all. The "default" syntax
- is special: it takes no "fileregex", and applies to files that
- don't match any other syntax's "fileregex".
-
-`color fgcolor,bgcolor "regex" ...'
+ apply to this "str" syntax until a new syntax is defined.
+
+ The "none" syntax is reserved; specifying it on the command line is
+ the same as not having a syntax at all. The "default" syntax is
+ special: it takes no "fileregex", and applies to files that don't
+ match any other syntax's "fileregex".
+
+'linter program [arg ...]'
+ For the currently defined syntax, use the given program to invoke
+ the linter (this overrides the speller function when defined).
+
+'formatter program [arg ...]'
+ For the currently defined syntax, use the given program to
+ automatically reformat text. Useful in certain programming
+ languages (e.g. go).
+
+'header "regex" ...'
+ For the currently defined syntax, add one or more regexes which
+ will be compared against the very first line of the file to be
+ edited, to determine whether this syntax should be used for that
+ file.
+
+'magic "regex" ...'
+ For the currently defined syntax, add one or more regexes which
+ will be compared against the result of querying the magic database
+ about the file to be edited, to determine whether this syntax
+ should be used for that file. This functionality only works when
+ libmagic is installed on the system and will be silently ignored
+ otherwise.
+
+'color fgcolor,bgcolor "regex" ...'
For the currently defined syntax, display all expressions matching
the extended regular expression "regex" with foreground color
"fgcolor" and background color "bgcolor", at least one of which
- must be specified. Legal colors for foreground and background
- color are: white, black, red, blue, green, yellow, magenta, and
- cyan. You may use the prefix "bright" to force a stronger color
- highlight for the foreground. If your terminal supports
- transparency, not specifying a "bgcolor" tells "nano" to attempt
- to use a transparent background.
-
-`icolor fgcolor,bgcolor "regex" ...'
+ must be specified. Valid colors for foreground and background are:
+ white, black, red, blue, green, yellow, magenta, and cyan. You may
+ use the prefix "bright" to get a stronger color highlight for the
+ foreground. If your terminal supports transparency, not specifying
+ a "bgcolor" tells 'nano' to attempt to use a transparent
+ background.
+
+'icolor fgcolor,bgcolor "regex" ...'
Same as above, except that the expression matching is case
insensitive.
-`color fgcolor,bgcolor start="sr" end="er"'
+'color fgcolor,bgcolor start="sr" end="er"'
Display expressions which start with the extended regular
expression "sr" and end with the extended regular expression "er"
with foreground color "fgcolor" and background color "bgcolor", at
@@ -672,15 +862,378 @@ end. For example, for the "brackets" option,
instances of "sr" after an initial "sr" is found will be
highlighted until the first instance of "er".
-`icolor fgcolor,bgcolor start="sr" end="er"'
+'icolor fgcolor,bgcolor start="sr" end="er"'
Same as above, except that the expression matching is case
insensitive.
-`include "syntaxfile"'
+'include "syntaxfile"'
Read in self-contained color syntaxes from "syntaxfile". Note that
- "syntaxfile" can only contain "syntax", "color", and "icolor"
- commands.
+ "syntaxfile" can only contain the above commands, from "syntax" to
+ "icolor".
+
+'extendsyntax str directive [arg ...]'
+ Extend the syntax previously defined as str to include new
+ information. Allows you to add a new color, icolor, magic, header,
+ or linter directive to an already defined syntax. Useful when you
+ want to add to definitions from the system-installed syntax
+ definitions (which are normally not writable).
+
+
+File: nano.info, Node: Rebinding Keys, Prev: Syntax Highlighting, Up: Nanorc Files
+
+5.3 Rebinding Keys
+==================
+
+Key bindings may be reassigned via the following two commands in a
+nanorc file:
+
+'bind key function menu'
+ Rebinds 'key' to 'function' in the context of 'menu' (or in all
+ menus where the function exists by using 'all').
+
+'unbind key menu'
+ Unbinds 'key' from 'menu' (or from all menus where it exists by
+ using 'all').
+
+ The format of 'key' should be one of:
+
+'^'
+ followed by an alpha character or the word "Space". Example: '^C'
+
+'M-'
+ followed by a printable character or the word "Space". Example:
+ 'M-C'
+
+'F'
+ followed by a numeric value from 1 to 16. Example: 'F10'
+
+ Valid names for the 'function' to be bound are:
+
+'help'
+ Invokes the help viewer.
+
+'cancel'
+ Cancels the current command.
+
+'exit'
+ Exits from the program (or from the help viewer or the file
+ browser).
+
+'writeout'
+ Writes the current buffer to disk.
+
+'insert'
+ Inserts a file into the current buffer (or into a new buffer when
+ multibuffer is enabled).
+
+'whereis'
+ Searches for text in the current buffer - or for filenames matching
+ a string in the current list in the file browser
+
+'searchagain'
+ Repeats the last search command.
+
+'replace'
+ Interactively replaces text within the current buffer.
+
+'cut'
+ Cuts and stores the current line (or the marked region).
+
+'copytext'
+ Copies the current line (or the marked region) without deleting it.
+
+'uncut'
+ Copies the currently stored text into the current buffer at the
+ current cursor position.
+
+'mark'
+ Sets the mark at the current position, to start selecting text.
+
+'cutrestoffile'
+ Cuts all text from the cursor position till the end of the buffer.
+
+'curpos'
+ Shows the current cursor position: the line, column, and character
+ positions.
+
+'wordcount'
+ Counts the number of words, lines and characters in the current
+ buffer.
+
+'speller'
+ Invokes a spell-checking program (or a linting program, if the
+ current syntax highlighting defines one).
+
+'justify'
+ Justifies the current paragraph.
+
+'fulljustify'
+ Justifies the entire current buffer.
+
+'indent'
+ Indents (shifts to the right) the currently marked text.
+
+'unindent'
+ Unindents (shifts to the left) the currently marked text.
+
+'left'
+ Goes left one position (in the editor or browser).
+
+'right'
+ Goes right one position (in the editor or browser).
+
+'up'
+ Goes one line up (in the editor or browser).
+
+'down'
+ Goes one line down (in the editor or browser).
+'scrollup'
+ Scrolls up one line of text from the current position.
+
+'scrolldown'
+ Scrolls down one line of text from the current position.
+
+'nextword'
+ Moves the cursor to the beginning of the next word.
+
+'prevword'
+ Moves the cursor to the beginning of the previous word.
+
+'home'
+ Moves the cursor to the beginning of the current line.
+
+'end'
+ Moves the cursor to the end of the current line.
+
+'beginpara'
+ Moves the cursor to the beginning of the current paragraph.
+
+'endpara'
+ Moves the cursor to the end of the current paragraph.
+
+'prevpage'
+ Goes up one screenful.
+
+'nextpage'
+ Goes down one screenful.
+
+'firstline'
+ Goes to the first line of the file.
+
+'lastline'
+ Goes to the last line of the file.
+
+'gotoline'
+ Goes to a specific line (and column if specified).
+
+'gototext'
+ Switches from targeting a line number to searching for text.
+
+'findbracket'
+ Moves the cursor to the bracket (brace, parenthesis, etc.) that
+ matches (pairs) with the one under the cursor.
+
+'prevbuf'
+ Switches to editing/viewing the previous buffer when using
+ multibuffer mode.
+
+'nextbuf'
+ Switches to editing/viewing the next buffer when using multibuffer
+ mode.
+
+'verbatim'
+ Inserts the next character verbatim into the file.
+
+'tab'
+ Inserts a tab at the current cursor location.
+
+'enter'
+ Inserts a new line below the current one.
+
+'delete'
+ Deletes the character under the cursor.
+
+'backspace'
+ Deletes the character before the cursor.
+
+'undo'
+ Undoes the last performed text action (add text, delete text, etc).
+
+'redo'
+ Redoes the last undone action (i.e., it undoes an undo).
+
+'refresh'
+ Refreshes the screen.
+
+'suspend'
+ Suspends the editor (if the suspending function is enabled, see the
+ "suspendenable" entry below).
+
+'casesens'
+ Toggles case sensitivity in searching (search/replace menus only).
+
+'regexp'
+ Toggles whether searching/replacing is based on literal strings or
+ regular expressions.
+
+'backwards'
+ Toggles whether searching/replacing goes forward or backward.
+
+'prevhistory'
+ Shows the previous history entry in the prompt menus (e.g.
+ search).
+
+'nexthistory'
+ Shows the next history entry in the prompt menus (e.g. search).
+
+'flipreplace'
+ Toggles between searching for something and replacing something.
+
+'flipexecute'
+ Toggles between inserting a file and executing a command.
+
+'flipnewbuffer'
+ Toggles between inserting into the current buffer and into a new
+ empty buffer.
+
+'dosformat'
+ When writing a file, switches to writing a DOS format (CR/LF).
+
+'macformat'
+ When writing a file, switches to writing a Mac format.
+
+'append'
+ When writing a file, appends to the end instead of overwriting.
+
+'prepend'
+ When writing a file, 'prepends' (writes at the beginning) instead
+ of overwriting.
+
+'backup'
+ When writing a file, creates a backup of the current file.
+
+'tofiles'
+ Starts the file browser, allowing to select a file from a list.
+
+'gotodir'
+ Goes to a directory to be specified, allowing to browse anywhere in
+ the filesystem.
+
+'firstfile'
+ Goes to the first file when using the file browser (reading or
+ writing files).
+
+'lastfile'
+ Goes to the last file when using the file browser (reading or
+ writing files).
+
+'nohelp'
+ Toggles the presence of the two-line list of key bindings at the
+ bottom of the screen.
+
+'constupdate'
+ Toggles the constant display of the current line, column, and
+ character positions.
+
+'morespace'
+ Toggles the presence of the blank line which 'separates' the
+ titlebar from the file text.
+
+'smoothscroll'
+ Toggles smooth scrolling (when moving around with the arrow keys).
+
+'softwrap'
+ Toggles the displaying of overlong lines on multiple screen lines.
+
+'whitespacedisplay'
+ Toggles the showing of whitespace.
+
+'nosyntax'
+ Toggles syntax highlighting.
+
+'smarthome'
+ Toggles the smartness of the Home key.
+
+'autoindent'
+ Toggles whether new lines will contain the same amount of
+ whitespace as the preceding line.
+
+'cuttoend'
+ Toggles whether cutting text will cut the whole line or just from
+ the current cursor position to the end of the line.
+
+'nowrap'
+ Toggles whether long lines will be hard-wrapped to the next line.
+
+'tabstospaces'
+ Toggles whether typed tabs will be converted to spaces.
+
+'backupfile'
+ Toggles whether a backup will be made of the file to be edited.
+
+'multibuffer'
+ Toggles the use of multiple file buffers (if available).
+
+'mouse'
+ Toggles mouse support.
+
+'noconvert'
+ Toggles automatic conversion of files from DOS/Mac format.
+
+'suspendenable'
+ Toggles whether the suspend sequence (normally ^Z) will suspend the
+ editor window.
+
+ Valid names for 'menu' are:
+
+'main'
+ The main editor window where text is entered and edited.
+
+'search'
+ The search menu (AKA whereis).
+
+'replace'
+ The 'search to replace' menu.
+
+'replacewith'
+ The 'replace with' menu, which comes up after 'search to replace'.
+
+'gotoline'
+ The 'goto line (and column)' menu.
+
+'writeout'
+ The 'write file' menu.
+
+'insert'
+ The 'insert file' menu.
+
+'extcmd'
+ The menu for inserting output from an external command, reached
+ from the insert menu.
+
+'help'
+ The help-viewer menu.
+
+'spell'
+ The interactive spell checker Yes/no menu.
+
+'linter'
+ The linter menu.
+
+'browser'
+ The file browser for inserting or writing a file.
+
+'whereisfile'
+ The 'search for a file' menu in the file browser.
+
+'gotodir'
+ The 'go to directory' menu in the file browser.
+
+'all'
+ A special name that encompasses all menus. For 'bind' it means all
+ menus where the specified 'function' exists; for 'unbind' it means
+ all menus where the specified 'key' exists.

File: nano.info, Node: The File Browser, Next: Pico Compatibility, Prev: Nanorc Files, Up: Top
@@ -707,52 +1260,52 @@ File: nano.info, Node: Pico Compatibility, Next: Building and Configure Option
7 Pico Compatibility
********************
-`nano' attempts to emulate Pico as closely as possible, but there are
+'nano' attempts to emulate Pico as closely as possible, but there are
certain differences between the editors:
-`Search and Replace History'
- As of version 1.1.99pre1 of `nano', text entered as search or
+'Search and Replace History'
+ As of version 1.1.99pre1 of 'nano', text entered as search or
replace strings will be stored and can be accessed with the up/down
- arrow keys. Previously, `nano' offered a more consistent, but
+ arrow keys. Previously, 'nano' offered a more consistent, but
incompatible with Pico, method for entering search and replace
- strings. In the old method, previous entries would be displayed
- by default as editable text in front of the cursor, as opposed to
+ strings. In the old method, previous entries would be displayed by
+ default as editable text in front of the cursor, as opposed to
being bracketed and uneditable as it is in Pico. The old behavior
- could be made compatible with Pico via the `-p' option, but recent
- versions of Pico use the `-p' option to preserve the XON and XOFF
+ could be made compatible with Pico via the '-p' option, but recent
+ versions of Pico use the '-p' option to preserve the XON and XOFF
sequences within the editor. Since, with the new method, search
and replace strings can still be edited by simply hitting the up
arrow key once, the old method was removed completely.
-`Writing, Appending, or Prepending Selected Text to Files'
+'Writing, Appending, or Prepending Selected Text to Files'
Text selected using the marking key (^^) can be written out,
- appended, or prepended to a new or existing file using the
- WriteOut key (^O).
+ appended, or prepended to a new or existing file using the WriteOut
+ key (^O).
-`Toggles'
+'Toggles'
Many options which alter the functionality of the program can be
"toggled" on or off using Meta key sequences, meaning the program
does not have to be restarted to turn a particular feature of the
- editor on or off. Please see the internal help function (^G) for
- a list of what functions can be toggled for a particular version
- of `nano'. See *Note Feature Toggles::, for more info.
-
-`Cursor Position Display'
- The output of the "Display Cursor Position" in `nano' displays the
- given column position, as well as the row and total character
- position of the cursor.
-
-`Interactive Replace and Spell Checker'
- It is worth noting that `nano''s replace function is interactive,
- i.e. it does not stop after one search string is found and
- automatically replace it. The `nano' implementation will pause at
- each search string found and query whether to replace this
- instance or not. The internal spell checker operates similarly.
- Note that there is no way to force these functions to behave in
- the Pico fashion. As of version 1.1.99pre1, misspelled words are
- sorted and trimmed for uniqueness in the internal spell checker
- such that the words 'apple' and 'Apple' will be prompted for
- correction separately.
+ editor on or off. Please see the internal help function (^G) for a
+ list of what functions can be toggled for a particular version of
+ 'nano'. See *Note Feature Toggles::, for more info.
+
+'Cursor Position Display'
+ The output of the "Display Cursor Position" in 'nano' displays the
+ current line position of the cursor, as well as the column and
+ total character position.
+
+'Interactive Replace and Spell Checker'
+ It is worth noting that 'nano''s replace function is interactive,
+ i.e. it does not stop after one search string was found and
+ automatically replaced. The 'nano' implementation will pause at
+ each found search string and query whether to replace this instance
+ or not. The internal spell checker operates similarly. Note that
+ there is no way to force these functions to behave in the Pico
+ fashion. As of version 1.1.99pre1, misspelled words are sorted and
+ trimmed for uniqueness in the internal spell checker such that the
+ words 'apple' and 'Apple' will be prompted for correction
+ separately.

File: nano.info, Node: Building and Configure Options, Prev: Pico Compatibility, Up: Top
@@ -760,125 +1313,146 @@ File: nano.info, Node: Building and Configure Options, Prev: Pico Compatibilit
8 Building and Configure Options
********************************
-Building `nano' from source is fairly straightforward if you are
+Building 'nano' from source is fairly straightforward if you are
familiar with compiling programs with autoconf support:
- * tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of `nano')
-
+ * tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of 'nano')
* cd nano-x.y.z/
-
* ./configure
-
* make
-
* make install
- The possible options to `./configure' are:
+ The possible options to './configure' are:
-`--disable-browser'
+'--disable-browser'
Disable the mini file browser when reading or writing files.
-`--disable-help'
+'--disable-color'
+ Disable support for the syntax coloring of files. This also
+ eliminates the -Y command-line option, which chooses a specific
+ syntax.
+
+'--disable-extra'
+ Disable extra features. At the moment, this is just
+ easter-egg-type stuff.
+
+'--disable-help'
Disable the help function. Doing this makes the binary much
smaller, but makes it difficult for new users to learn more than
very basic things about using the editor.
-`--disable-justify'
- Disable the justify and unjustify functions.
-
-`--disable-mouse'
- Disable all mouse functionality. This also disables the -m
- command line option, which enables the mouse functionality.
+'--disable-histories'
+ Disable the code for the handling of the history files: the search
+ and replace strings that were used, and the cursor position at
+ which each file was closed. This also eliminates the -H and -P
+ command-line options, which switch on the logging of search/replace
+ strings and cursor positions.
-`--disable-operatingdir'
- Disable setting the operating directory. This also disables the -o
- command line option, which sets the operating directory.
+'--disable-justify'
+ Disable the justify and unjustify functions.
-`--disable-speller'
- Disable use of the spell checker. This also disables the -s
- command line option, which allows specifying an alternate spell
+'--disable-libmagic'
+ Disable the use of the library of magic-number tests (for
+ determining the file type and thus which syntax to use for
+ colouring - often the tests on filename extension and header line
+ will be enough).
+
+'--disable-mouse'
+ Disable all mouse functionality. This also eliminates the -m
+ command-line option, which enables the mouse functionality.
+
+'--disable-multibuffer'
+ Disable support for opening multiple files at a time and switching
+ between them on the fly. This also eliminates the -F command-line
+ option, which switches the use of multiple file buffers on.
+
+'--disable-nanorc'
+ Disable support for reading the nanorc files at startup. With such
+ support, you can store custom settings in a system-wide and a
+ per-user nanorc file rather than having to pass command-line
+ options to get the desired behavior. See *Note Nanorc Files::, for
+ more info. Disabling this also eliminates the -I and -q
+ command-line options; the first inhibits the reading of
+ nanorcfiles, and the second suppresses warnings about errors in
+ those files.
+
+'--disable-operatingdir'
+ Disable setting the operating directory. This also eliminates the
+ -o command-line option, which sets the operating directory.
+
+'--disable-speller'
+ Disable use of the spell checker. This also eliminates the -s
+ command-line option, which allows specifying an alternate spell
checker.
-`--disable-tabcomp'
+'--disable-tabcomp'
Disable the tab completion code when reading or writing files.
-`--disable-wrapping'
- Disable all long line wrapping. This also eliminates the -w
- command line option, which enables long line wrapping.
+'--disable-wrapping'
+ Disable hard-wrapping of overlong lines. This also eliminates the
+ -w command-line option, which enables long-line wrapping.
-`--enable-tiny'
+'--enable-tiny'
This option disables all the above. It also disables some of the
- larger internals of the editor, like the marking code and the cut
- to end of line code. It also disables the function toggles.
+ larger internals of the editor, like the marking code and the
+ cut-to-end-of-line code. It also disables the function toggles.
+ By using the enabling counterpart of the above options together
+ with -enable-tiny, specific features can be switched back on.
-`--enable-debug'
+'--enable-debug'
Enable support for runtime debug output. This can get pretty
- messy, so chances are you only want this feature to work on the
- nano source.
-
-`--enable-extra'
- Enable extra features. At the moment, this is just easter egg-type
- stuff.
+ messy, so chances are you only want this feature when you're
+ working on the nano source.
-`--enable-color'
- Enable support for syntax coloring of files using the nanorc file.
- This enables nanorc support as well.
+'--disable-nls'
+ Disables Native Language support. This will disable the use of any
+ available GNU 'nano' translations.
-`--enable-multibuffer'
- Enable support for opening multiple files at a time and switching
- between them on the fly.
+'--disable-wrapping-as-root'
+ Disable hard-wrapping of overlong lines by default when 'nano' is
+ run as root.
-`--enable-nanorc'
- Enable support for reading the nanorc file at startup. You can
- store custom settings in the nanorc file rather than having to
- pass command line options to get desired behavior. See *Note
- Nanorc Files::, for more info.
-
-`--enable-all'
- Shortcut for enabling the above four features (extra, color,
- multibuffer, and nanorc).
-
-`--disable-nls'
- Disables Native Language support. This will disable use of the
- available GNU `nano' translations.
-
-`--disable-wrapping-as-root'
- Disable long line wrapping by default when nano is run as root.
-
-`--enable-utf8'
+'--enable-utf8'
Enable support for reading and writing Unicode files. This will
- require either a wide version of curses, or a UTF-8-enabled
- version of Slang.
-
-`--disable-utf8'
- Disable support for reading and writing Unicode files.
+ require either a wide version of curses, or a UTF-8-enabled version
+ of Slang.
-`--with-slang'
- Compiling `nano' with Slang is supported, and will make the binary
- notably smaller than if compiled with ncurses or other curses
- libraries.
+'--disable-utf8'
+ Disable support for reading and writing Unicode files. Normally
+ the configure script auto-detects whether to enable UTF-8 support
+ or not. You can use this or the previous option to override that
+ detection.
+'--with-slang'
+ Compile 'nano' against Slang instead of against ncurses or other
+ curses libraries.

Tag Table:
-Node: Top200
-Node: Introduction527
-Node: Overview966
-Node: Command Line Options1871
-Ref: Expert Mode7858
-Node: Editor Basics8745
-Node: Entering Text8994
-Node: Special Functions9342
-Node: The Titlebar10346
-Node: The Statusbar11071
-Node: Shortcut Lists11643
-Node: Using the Mouse11923
-Node: Online Help12383
-Node: Feature Toggles12760
-Node: Nanorc Files14867
-Node: The File Browser23472
-Node: Pico Compatibility24294
-Node: Building and Configure Options26950
+Node: Top199
+Node: Introduction550
+Node: Overview990
+Node: Command Line Options1874
+Ref: Expert Mode8793
+Node: Editor Basics9758
+Node: Entering Text10038
+Node: Special Functions10364
+Node: The Cutbuffer11404
+Node: The Mark12091
+Node: The Titlebar12828
+Node: The Statusbar13544
+Node: Shortcut Lists14117
+Node: Using the Mouse14397
+Node: Online Help14990
+Node: Feature Toggles15366
+Node: Nanorc Files17428
+Node: Settings18859
+Ref: Whitespace25479
+Node: Syntax Highlighting25831
+Node: Rebinding Keys29957
+Node: The File Browser38444
+Node: Pico Compatibility39266
+Node: Building and Configure Options41926

End Tag Table
diff --git a/doc/texinfo/nano.texi b/doc/texinfo/nano.texi
index fe12428..b77feb1 100644
--- a/doc/texinfo/nano.texi
+++ b/doc/texinfo/nano.texi
@@ -7,9 +7,9 @@
@c This file has the new style title page commands.
@c Run 'makeinfo' rather than 'texinfo-format-buffer'.
@smallbook
-@set EDITION 0.1
-@set VERSION 2.2.0
-@set UPDATED 30 Nov 2009
+@set EDITION 0.3
+@set VERSION 2.4.0
+@set UPDATED March 2015
@dircategory Editors
@direntry
@@ -23,7 +23,7 @@
@titlepage
@title GNU @code{nano}
@subtitle a small and friendly text editor.
-@subtitle version 2.2.0
+@subtitle version 2.4.0
@author Chris Allegretta
@page
@@ -32,9 +32,9 @@ This manual documents GNU @code{nano}, a small and friendly text
editor.
This manual is part of the GNU @code{nano} distribution.@*
-@sp4
+@sp 4
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-2008, 2009 Free Software Foundation, Inc.
+2009, 2014, 2015 Free Software Foundation, Inc.
This document is dual-licensed. You may distribute and/or modify it
under the terms of either of the following licenses:
@@ -54,7 +54,9 @@ You may contact the author by
e-mail: @email{chrisa@@asty.org}@*
@end titlepage
-@node Top, Introduction, (dir), (dir)
+
+@node Top
+@top
This manual documents GNU @code{nano}, a small and friendly text
editor.
@@ -70,12 +72,13 @@ editor.
* Building and Configure Options::
@end menu
-@node Introduction, Editor Basics, Top, Top
+
+@node Introduction
@chapter Introduction
GNU @code{nano} is a small and friendly text editor. Besides basic text
-editing, @code{nano} offers many extra features like an interactive
-search and replace, go to line and column number, auto-indentation,
+editing, @code{nano} offers many extra features, like an interactive
+search-and-replace, go-to-line-and-column-number, auto-indentation,
feature toggles, internationalization support, and filename tab
completion.
@@ -84,7 +87,7 @@ completion.
* Command Line Options::
@end menu
-@node Overview, Command Line Options, Introduction, Introduction
+@node Overview
@section Overview
The original goal for @code{nano} was a complete bug-for-bug compatible
@@ -113,245 +116,334 @@ adding it with a comma. So the complete synopsis is:
Email bug reports to @email{nano@@nano-editor.org}.
-@node Command Line Options, , Overview, Introduction
+@node Command Line Options
@section Command Line Options
-@code{nano} takes the following options from the command line:
+@command{nano} takes the following options from the command line:
-@table @code
-@item +LINE,COLUMN
-Start at line number LINE and column number COLUMN (at least one of
+@table @option
+@item +@var{line},@var{column}
+Start at line number @var{line} and column number @var{column} (at least one of
which must be specified) instead of the default of line 1, column 1.
-@item -?
-Same as @code{-h, --help}.
-
-@item -A, --smarthome
+@item -A
+@itemx --smarthome
Make the Home key smarter. When Home is pressed anywhere but at the
very beginning of non-whitespace characters on a line, the cursor will
jump to that beginning (either forwards or backwards). If the cursor is
already at that position, it will jump to the true beginning of the
line.
-@item -B, --backup
+@item -B
+@itemx --backup
When saving a file, back up the previous version of it to the current
-filename suffixed with a ~.
+filename suffixed with a @samp{~}.
-@item -C <dir>, --backupdir=<dir>
-Set the directory where @code{nano} puts unique backup files if file
+@item -C @var{directory}
+@itemx --backupdir=@var{directory}
+Set the directory where @command{nano} puts unique backup files if file
backups are enabled.
-@item -D, --boldtext
+@item -D
+@itemx --boldtext
Use bold text instead of reverse video text.
-@item -E, --tabstospaces
+@item -E
+@itemx --tabstospaces
Convert typed tabs to spaces.
-@item -F, --multibuffer
-Enable multiple file buffers, if available.
+@item -F
+@itemx --multibuffer
+Enable multiple file buffers (if support for them has been compiled in).
+
+@item -G
+@itemx --locking
+Enable vim-style file locking when editing files.
-@item -H, --historylog
-Log search and replace strings to ~/.nano_history, so they can be
-retrieved in later sessions, if nanorc support is available.
+@item -H
+@itemx --historylog
+Log search and replace strings to @file{~/.nano/search_history},
+so they can be retrieved in later sessions.
-@item -I, --ignorercfiles
-Don't look at SYSCONFDIR/nanorc or ~/.nanorc, if nanorc support is
-available.
+@item -I
+@itemx --ignorercfiles
+Don't look at the system's nanorc file nor at the user's @file{~/.nanorc}.
-@item -K, --rebindkeypad
+@item -K
+@itemx --rebindkeypad
Interpret the numeric keypad keys so that they all work properly. You
should only need to use this option if they don't, as mouse support
won't work properly with this option enabled.
-@item -L, --nonewlines
+@item -L
+@itemx --nonewlines
Don't add newlines to the ends of files.
-@item -N, --noconvert
-Don't convert files from DOS/Mac format.
+@item -N
+@itemx --noconvert
+Disable automatic conversion of files from DOS/Mac format.
-@item -O, --morespace
+@item -O
+@itemx --morespace
Use the blank line below the titlebar as extra editing space.
-@item -Q <str>, --quotestr=<str>
+@item -P
+@itemx --poslog
+Log for each file the last location of the cursor, and read it
+back upon reopening the file and place it there again.
+
+@item -Q "@var{characters}"
+@itemx --quotestr="@var{characters}"
Set the quoting string for justifying. The default value is
@quotation
-@code{^([ \t]*[|>:@}#])+}
+"^([ \t]*[|>:@}#])+"
@end quotation
-if extended regular expression support is available, or "> " otherwise.
+if extended regular expression support is available, or @code{> } otherwise.
Note that @code{\t} above stands for a literal Tab character.
-@item -R, --restricted
+@item -R
+@itemx --restricted
Restricted mode: don't read or write to any file not specified on the
-command line; read any nanorc files; allow suspending; allow a file to
-be appended to, prepended to, or saved under a different name if it
-already has one; or use backup files or spell checking. Also accessible
-by invoking @code{nano} with any name beginning with 'r' (e.g. "rnano").
-
-@item -S, --smooth
+command line; don't read any nanorc files nor history files; don't allow
+suspending nor spell checking; don't
+allow a file to be appended to, prepended to, or saved under a different
+name if it already has one; and don't use backup files.
+This restricted mode is also accessible by invoking @command{nano} with
+any name beginning with @samp{r} (e.g. @command{rnano}).
+
+@item -S
+@itemx --smooth
Enable smooth scrolling. Text will scroll line-by-line, instead of the
usual chunk-by-chunk behavior.
-@item -T <#cols>, --tabsize=<#cols>
-Set the displayed tab length to #cols columns. The value of #cols must
-be greater than 0. The default value is 8.
+@item -T @var{number}
+@itemx --tabsize=@var{number}
+Set the displayed tab length to @var{number} columns. The value of
+@var{number} must be greater than 0. The default value is @samp{8}.
-@item -U, --quickblank
+@item -U
+@itemx --quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1
-keystroke instead of 25. Note that -c overrides this.
+keystroke instead of 25. Note that @option{-c} overrides this.
-@item -V, --version
+@item -V
+@itemx --version
Show the current version number and exit.
-@item -W, --wordbounds
+@item -W
+@itemx --wordbounds
Detect word boundaries more accurately by treating punctuation
characters as parts of words.
-@item -Y <str>, --syntax=<str>
-Specify a specific syntax highlighting from the nanorc to use, if
-available. See @xref{Nanorc Files}, for more info.
+@item -Y @var{name}
+@itemx --syntax=@var{name}
+Specify a specific syntax from the nanorc files to use for highlighting.
+See @xref{Syntax Highlighting}, for more info.
-@item -c, --const
+@item -c
+@itemx --const
Constantly display the cursor position and line number on the statusbar.
-Note that this overrides -U.
+Note that this overrides @option{-U}.
-@item -d, --rebinddelete
+@item -d
+@itemx --rebinddelete
Interpret the Delete key differently so that both Backspace and Delete
work properly. You should only need to use this option if Backspace
acts like Delete on your system.
-@item -h, --help
-Show a summary of command line options and exit.
+@item -h
+@itemx --help
+Show a summary of command-line options and exit.
-@item -i, --autoindent
+@item -i
+@itemx --autoindent
Automatically indent new lines to the same number of spaces and tabs as
the previous line.
-@item -k, --cut
-Cut from the current cursor position to the end of the current line.
+@item -k
+@itemx --cut
+Make the 'Cut Text' command (normally ^K) cut from the current cursor
+position to the end of the line, instead of cutting the entire line.
-@item -l, --nofollow
+@item -l
+@itemx --nofollow
When writing files, if the given file is a symbolic link, it is removed
and a new file is created.
-@item -m, --mouse
+@item -m
+@itemx --mouse
Enable mouse support, if available for your system. When enabled, mouse
clicks can be used to place the cursor, set the mark (with a double
click), and execute shortcuts. The mouse will work in the X Window
-System, and on the console when gpm is running.
-
-@item -o <dir>, --operatingdir=<dir>
-Set operating directory. Makes @code{nano} set up something similar to
-a chroot.
-
-@item -p, --preserve
+System, and on the console when gpm is running. Text can still be
+selected through dragging by holding down the Shift key.
+
+@item -n
+@itemx --noread
+Treat any name given on the command line as a new file. This allows
+@command{nano} to write to named pipes: it will start with a blank buffer,
+and will write to the pipe when the user saves the "file". This way
+@command{nano} can be used as an editor in combination with for instance
+@command{gpg} without having to write sensitive data to disk first.
+
+@item -o @var{directory}
+@itemx --operatingdir=@var{directory}
+Set the operating directory. This makes @command{nano} set up something
+similar to a chroot.
+
+@item -p
+@itemx --preserve
Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent to the
-editor can be can be stopped and started.
+editor can be stopped and started.
-@item -q, --quiet
-Do not report errors in the nanorc file and ask them to be acknowledged
+@item -q
+@itemx --quiet
+Do not report errors in the nanorc file nor ask them to be acknowledged
by pressing Enter at startup.
-@item -r <#cols>, --fill=<#cols>
-Wrap lines at column #cols. If this value is 0 or less, wrapping will
-occur at the width of the screen less #cols, allowing it to vary along
-with the width of the screen if the screen is resized. The default
-value is -8.
-
-@item -s <prog>, --speller=<prog>
-Invoke the given program as the spell checker. By default, @code{nano}
-uses the command specified in the SPELL environment variable, or, if
-SPELL is not set, its own interactive spell checker that requires the
-@code{spell} program to be installed on your system.
-
-@item -t, --tempfile
+@item -r @var{number}
+@itemx --fill=@var{number}
+Hard-wrap lines at column @var{number} (by inserting a newline character).
+If the given value is 0 or less, wrapping will occur at the width of
+the screen minus the given amount, allowing the wrapping width to
+vary along with the width of the screen if and when it is resized.
+The default value is @samp{-8}. This option conflicts with @option{-w}
+-- the last one given takes effect.
+
+@item -s @var{program}
+@itemx --speller=@var{program}
+Invoke the given program as the spell checker. By default, @command{nano}
+uses the command specified in the @env{SPELL} environment variable, or,
+if @env{SPELL} is not set, its own interactive spell checker that requires
+the @command{spell} program to be installed on your system.
+
+@item -t
+@itemx --tempfile
Don't ask whether or not to save the current contents of the file when
-exiting, assume yes. This is most useful when using @code{nano} as the
+exiting, assume yes. This is most useful when using @command{nano} as the
composer of a mailer program.
-@item -u, --undo
-Enable experimental generic-purpose undo code. By default, the undo and
-redo shortcuts are Meta-U and Meta-E, respectively.
-
-@item -v, --view
+@item -v
+@itemx --view
Don't allow the contents of the file to be altered. Note that this
option should NOT be used in place of correct file permissions to
implement a read-only file.
-@item -w, --nowrap
-Don't wrap long lines at any length. This option overrides any value
-for -r.
+@item -w
+@itemx --nowrap
+Don't hard-wrap long lines at any length. This option conflicts with
+@option{-r} -- the last one given takes effect.
@anchor{Expert Mode}
-@item -x, --nohelp
+@item -x
+@itemx --nohelp
Expert Mode: don't show the Shortcut Lists at the bottom of the screen.
This affects the location of the statusbar as well, as in Expert Mode it
is located at the very bottom of the editor.
Note: When accessing the help system, Expert Mode is temporarily
-disabled to display the help system navigation keys.
+disabled to display the help-system navigation keys.
-@item -z, --suspend
-Enable @code{nano}'s suspend ability using the system's suspend
+@item -z
+@itemx --suspend
+Enable the ability to suspend @command{nano} using the system's suspend
keystroke (usually ^Z).
-@item -$, --softwrap
-Enable 'soft wrapping'. @code{nano} will attempt to display the entire
-contents of a line, even if it is longer than the screen width. Since
-'$' normally refers to a variable in the Unix shell, you should specify
-this option last when using other options (e.g. 'nano -wS$') or pass it
-separately (e.g. 'nano -wS -$').
-
-@item -a, -b, -e, -f, -g, -j
+@item -$
+@itemx --softwrap
+Enable 'soft wrapping'. This will make @command{nano} attempt to display the
+entire contents of any line, even if it is longer than the screen width, by
+continuing it over multiple screen lines. Since
+@samp{$} normally refers to a variable in the Unix shell, you should specify
+this option last when using other options (e.g. @code{nano -wS$}) or pass it
+separately (e.g. @code{nano -wS -$}).
+
+@item -a
+@itemx -b
+@itemx -e
+@itemx -f
+@itemx -g
+@itemx -j
Ignored, for compatibility with Pico.
@end table
-@node Editor Basics, Online Help, Introduction, Top
+@node Editor Basics
@chapter Editor Basics
+
@menu
* Entering Text::
* Special Functions::
+* The Cutbuffer::
+* The Mark::
* The Titlebar::
* The Statusbar::
* Shortcut Lists::
* Using the Mouse::
@end menu
-@node Entering Text, Special Functions, Editor Basics, Editor Basics
+@node Entering Text
@section Entering Text
+@code{nano} is a "modeless" editor. All keystrokes, with the exception
+of Control and Meta key sequences, enter text into the file being edited.
All key sequences in @code{nano} are entered using the keyboard.
-@code{nano} is a "modeless" editor. All keys, with the exception of
-Control and Meta key sequences, will enter text into the file being
-edited.
-@node Special Functions, The Titlebar, Entering Text, Editor Basics
+@node Special Functions
@section Special Functions
-Special functions use the Control (Ctrl) key, displayed in the help and
-shortcut lists as ^; the Meta key, displayed as M; or the Escape (Esc)
-key.
+Special functions use the Control key (Ctrl), displayed in the help and
+shortcut lists as ^; the Meta key (Alt or Cmd), displayed as M-; or the
+Escape key (Esc).
@itemize @bullet
@item
Control key sequences are entered by holding down the Ctrl key and
-pressing the desired key, or by pressing the Esc key twice and pressing
-the desired key.
+pressing the desired key, or by pressing the Esc key twice and then
+pressing the desired key.
@item
-Pressing Esc twice and then typing a three-digit number from 000 to 255
-will enter the character with the corresponding value.
+Pressing the Esc key twice and then typing a three-digit number from
+000 to 255 will enter the character with the corresponding value.
@item
Meta key sequences are entered by holding down the Meta key (normally
the Alt key) and pressing the desired key, or by pressing the Esc key
-once and pressing the desired key. Certain operating systems "swallow"
+once and then pressing the desired key. Certain operating systems "swallow"
the Alt key so that it never reaches the application; if your operating
system does this, you should use the Esc key to generate Meta key
sequences.
@end itemize
-@node The Titlebar, The Statusbar, Special Functions, Editor Basics
+@node The Cutbuffer
+@section The Cutbuffer
+
+Text can be cut from a file, a whole line at a time, by using the 'Cut Text'
+command (default key binding: ^K). The cut line is stored in the cutbuffer.
+Consecutive strokes of ^K will add each cut line to this buffer, but a ^K
+after any other keystroke will overwrite the entire cutbuffer.
+
+The contents of the cutbuffer can be pasted back into the file with the
+'Uncut Text' command (default key binding: ^U).
+
+A line of text can be copied into the cutbuffer (without cutting it) with
+the 'Copy Text' command (default key binding: M-6).
+
+@node The Mark
+@section The Mark
+
+Text can be selected by first 'setting the Mark' (default key bindings:
+^6 and M-A) and then moving the cursor to the other end of the portion
+to be selected. The selected portion of text will be highlighted in
+reverse video (or in bold if you set the boldtext option).
+This selection can now be cut or copied in its entirety with a single
+^K or M-6. Or the selection can be used to limit the scope of a
+search-and-replace (^\) or spell-checking session (^T).
+
+Cutting or copying selected text will toggle the mark off automatically.
+If necessary, it can be toggled off manually with another ^6 or M-A.
+
+@node The Titlebar
@section The Titlebar
The titlebar is the line displayed at the top of the editor. There are
@@ -365,7 +457,7 @@ Special modes: When @code{nano} is in "File browser" mode, the center
section will display the current directory instead of the filename. See
@xref{The File Browser}, for more info.
-@node The Statusbar, Shortcut Lists, The Titlebar, Editor Basics
+@node The Statusbar
@section The Statusbar
The statusbar is the third line from the bottom of the screen, or the
@@ -375,38 +467,40 @@ occur from using the editor will appear on the statusbar. Any questions
that are asked of the user will be asked on the statusbar, and any user
input (search strings, filenames, etc.) will be input on the statusbar.
-@node Shortcut Lists, Using the Mouse, The Statusbar, Editor Basics
+@node Shortcut Lists
@section Shortcut Lists
The Shortcut Lists are the two lines at the bottom of the screen which
show some of the more commonly used functions in the editor.
-@node Using the Mouse, , Shortcut Lists, Editor Basics
+@node Using the Mouse
@section Using the Mouse
When mouse support has been configured and enabled, a single mouse click
places the cursor at the indicated position. Clicking a second time in
the same position toggles the mark. Clicking in the shortcut list
-executes the selected shortcut.
+executes the selected shortcut. To be able to select text with the
+left button, or paste text with the middle button, hold down the
+Shift key during those actions.
The mouse will work in the X Window System, and on the console when gpm
is running.
-@node Online Help, Feature Toggles, Editor Basics, Top
+@node Online Help
@chapter Online Help
The online help system in @code{nano} is available by pressing ^G.
-It is fairly self explanatory, documenting the various parts of the
+It is fairly self-explanatory, documenting the various parts of the
editor and available keystrokes. Navigation is via the ^Y (Page Up)
and ^V (Page Down) keys. ^X exits the help system.
-@node Feature Toggles, Nanorc Files, Online Help, Top
+@node Feature Toggles
@chapter Feature Toggles
Toggles allow you to change certain aspects of the editor that would
-normally be done via command line options. They are invoked via Meta
+normally be done via command-line options. They are invoked via Meta
key sequences. See @xref{Special Functions}, for more info. The
following global toggles are available:
@@ -443,8 +537,8 @@ toggles the -N (@code{--noconvert}) command line option.
toggles the -O (@code{--morespace}) command line option.
@item Whitespace Display Toggle (Meta-P)
-toggles whitespace display mode if you have a "whitespace" option in
-your nanorc. See @xref{Nanorc Files}, for more info.
+toggles whitespace-display mode.
+See @xref{Whitespace}, for more info.
@item Tabs to Spaces Toggle (Meta-Q)
toggles the -E (@code{--tabstospaces}) command line option.
@@ -457,7 +551,7 @@ toggles the -x (@code{--nohelp}) command line option.
@item Color Syntax Highlighting Toggle (Meta-Y)
toggles color syntax highlighting if you have color syntaxes in your
-nanorc. See @xref{Nanorc Files}, for more info.
+nanorc. See @xref{Syntax Highlighting}, for more info.
@item Suspend Toggle (Meta-Z)
toggles the -z (@code{--suspend}) command line option.
@@ -468,116 +562,145 @@ toggles the -$ (@code{--softwrap}) command line option.
@end table
-@node Nanorc Files, The File Browser, Feature Toggles, Top
+@node Nanorc Files
@chapter Nanorc Files
The nanorc files contain the default settings for @code{nano}. They
-should not be in DOS or Mac format. During startup, @code{nano} will
-first read its system-wide settings from SYSCONFDIR/nanorc, and then
-user-specific settings from ~/.nanorc.
+should be in Unix format, not in DOS or Mac format. During startup,
+@code{nano} will first read the system-wide settings, from /etc/nanorc
+(the exact path might be different), and then the user-specific settings,
+from ~/.nanorc.
A nanorc file accepts a series of "set" and "unset" commands, which can
-be used to configure @code{nano} on startup without using the command
-line options. Additionally, the "syntax", "color", and "icolor"
-keywords are used to define syntax highlighting rules for different text
-patterns. @code{nano} will read one command per line.
+be used to configure @code{nano} on startup without using command-line
+options. Additionally, there are some commands to define syntax highlighting
+and to rebind keys -- @xref{Syntax Highlighting}, and @xref{Rebinding Keys}.
+@code{nano} will read one command per line.
Options in nanorc files take precedence over @code{nano}'s defaults, and
-command line options override nanorc settings. Options are also unset
-by default, except for those that take arguments.
+command-line options override nanorc settings. Also, options that do not
+take an argument are unset by default. So using the @code{unset} command
+is only needed when wanting to override a setting of the system's nanorc
+file in your own @file{~/.nanorc}. Options that take an argument cannot
+be unset.
Quotes inside string parameters don't have to be escaped with
backslashes. The last double quote in the string will be treated as its
-end. For example, for the "brackets" option,
+end. For example, for the "brackets" option, @code{""')>]@}"} will match
+@code{"}, @code{'}, @code{)}, @code{>}, @code{]}, and @code{@}}.
-@quotation
-@code{""')>]@}"}
-@end quotation
+@menu
+* Settings::
+* Syntax Highlighting::
+* Rebinding Keys::
+@end menu
-will match @code{"}, @code{'}, @code{)}, @code{>}, @code{]}, and
-@code{@}}.
+@node Settings
+@section Settings
-The supported commands and arguments are:
+The supported settings in a nanorc file are:
@table @code
-@item set/unset autoindent
+@item set allow_insecure_backup
+When backing up files, allow the backup to succeed even if its
+permissions can't be (re)set due to special OS considerations.
+You should NOT enable this option unless you are sure you need it.
+
+@item set autoindent
Use auto-indentation.
-@item set/unset backup
-Create backup files in "filename~".
+@item set backup
+When saving a file, back up the previous version of it to the current
+filename suffixed with a tilde (@code{~}).
@item set backupdir "directory"
-Set the directory where @code{nano} puts unique backup files if file
+Set the directory where @code{nano} puts unique backup files, if file
backups are enabled.
-@item set/unset backwards
+@item set backwards
Do backwards searches by default.
-@item set/unset boldtext
-Use bold text instead of reverse video text.
+@item set boldtext
+Use bold instead of reverse video for the titlebar, statusbar, key combos,
+and selected text. This can be overridden for the first three by setting
+the options "titlecolor", "statuscolor", and "keycolor".
-@item set brackets "string"
+@item set brackets "@var{string}"
Set the characters treated as closing brackets when justifying
-paragraphs. They cannot contain blank characters. Only closing
-punctuation, optionally followed by closing brackets, can end sentences.
-The default value is
+paragraphs. This may not include blank characters. Only closing
+punctuation (see "punct"), optionally followed by the specified
+closing brackets, can end sentences. The default value is
@quotation
-@code{""')>]@}"}
+""')>]@}"
@end quotation
-@item set/unset casesensitive
-Do case sensitive searches by default.
+@item set casesensitive
+Do case-sensitive searches by default.
-@item set/unset const
+@item set const
Constantly display the cursor position in the status bar.
-@item set/unset cut
-Use cut to end of line by default, instead of cutting the whole line.
+@item set cut
+Use cut-to-end-of-line by default, instead of cutting the whole line.
-@item set fill "n"
-Wrap lines at column number "n". If "n" is 0 or less, the maximum line
-length will be the screen width less "n" columns. The default value is
--8.
+@item set fill @var{number}
+Hard-wrap lines at column number @var{number}. If @var{number} is 0 or less,
+the maximum line length will be the screen width less @var{number} columns.
+The default value is -8.
-@item set/unset historylog
-Enable ~/.nano_history for saving and reading search/replace strings.
+@item set functioncolor @var{fgcolor},@var{bgcolor}
+Specify the color combination to use for the function descriptions
+in the two help lines at the bottom of the screen.
+See @code{set titlecolor} for more details.
-@item set matchbrackets "string"
+@item set historylog
+Enable the use of @file{~/.nano/search_history} for saving and reading
+search/replace strings.
+
+@item set keycolor @var{fgcolor},@var{bgcolor}
+Specify the color combination to use for the shortcut key combos
+in the two help lines at the bottom of the screen.
+See @code{set titlecolor} for more details.
+
+@item set locking
+Enable vim-style lock-files for when editing files.
+
+@item set matchbrackets "@var{string}"
Set the opening and closing brackets that can be found by bracket
-searches. They cannot contain blank characters. The former set must
-come before the latter set, and both must be in the same order. The
-default value is
+searches. This may not include blank characters. The opening set must
+come before the closing set, and the two sets must be in the same order.
+The default value is
@quotation
-@code{"(<[@{)>]@}"}
+"(<[@{)>]@}"
@end quotation
-@item set/unset morespace
+@item set morespace
Use the blank line below the titlebar as extra editing space.
-@item set/unset mouse
+@item set mouse
Enable mouse support, so that mouse clicks can be used to place the
cursor, set the mark (with a double click), or execute shortcuts.
-@item set/unset multibuffer
+@item set multibuffer
Allow inserting files into their own buffers.
-@item set/unset noconvert
+@item set noconvert
Don't convert files from DOS/Mac format.
-@item set/unset nofollow
+@item set nofollow
Don't follow symlinks when writing files.
-@item set/unset nohelp
+@item set nohelp
Don't display the help lists at the bottom of the screen.
-@item set/unset nonewlines
+@item set nonewlines
Don't add newlines to the ends of files.
-@item set/unset nowrap
-Don't wrap text at all.
+@item set nowrap
+Don't hard-wrap text at all.
@item set operatingdir "directory"
@code{nano} will only read and write files inside "directory" and its
@@ -585,112 +708,162 @@ subdirectories. Also, the current directory is changed to here, so
files are inserted from this directory. By default, the operating
directory feature is turned off.
-@item set/unset preserve
+@item set poslog
+Save the cursor position of files between editing sessions.
+
+@item set preserve
Preserve the XON and XOFF keys (^Q and ^S).
-@item set punct "string"
+@item set punct "@var{string}"
Set the characters treated as closing punctuation when justifying
-paragraphs. They cannot contain blank characters. Only closing
-punctuation, optionally followed by closing brackets, can end sentences.
-The default value is @code{"!.?"}.
+paragraphs. This may not include blank characters. Only the
+specified closing punctuation, optionally followed by closing brackets
+(see "brackets"), can end sentences. The default value is "!.?".
-@item set/unset quickblank
+@item set quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1
keystroke instead of 25.
-@item set quotestr "string"
+@item set quiet
+When set, @code{nano} will not report errors in the nanorc file nor ask them
+to be acknowledged by pressing Enter at startup. If this option is used, it
+should be placed at the top of the file to be fully effective.
+
+@item set quotestr "@var{string}"
The email-quote string, used to justify email-quoted paragraphs. This
is an extended regular expression if your system supports them,
otherwise a literal string. The default value is
@quotation
-@code{"^([ \\t]*[#:>\\|@}])+"}
+"^([ \\t]*[#:>\\|@}])+"
@end quotation
-if you have extended regular expression support, or "> " otherwise.
+if you have extended regular expression support, and "> " otherwise.
Note that '\\t' stands for a literal Tab character.
-@item set/unset rebinddelete
+@item set rebinddelete
Interpret the Delete key differently so that both Backspace and Delete
work properly. You should only need to use this option if Backspace
acts like Delete on your system.
-@item set/unset rebindkeypad
+@item set rebindkeypad
Interpret the numeric keypad keys so that they all work properly. You
should only need to use this option if they don't, as mouse support
won't work properly with this option enabled.
-@item set/unset regexp
+@item set regexp
Do extended regular expression searches by default.
-@item set/unset smarthome
+@item set smarthome
Make the Home key smarter. When Home is pressed anywhere but at the
very beginning of non-whitespace characters on a line, the cursor will
jump to that beginning (either forwards or backwards). If the cursor is
already at that position, it will jump to the true beginning of the
line.
-@item set/unset smooth
+@item set smooth
Use smooth scrolling by default.
-@item set/unset softwrap
-Use soft wrapping by default.
+@item set softwrap
+Enable soft line wrapping for easier viewing of very long lines.
@item set speller "spellprog"
Use spelling checker "spellprog" instead of the built-in one, which
calls "spell".
-@item set/unset suspend
-Allow @code{nano} to be suspended.
+@item set statuscolor @var{fgcolor},@var{bgcolor}
+Specify the color combination to use for the statusbar.
+See @code{set titlecolor} for more details.
-@item set/unset suspendenable
-If @code{nano} is allowed to be suspended, allow the suspend key
-(usually ^Z) to actually suspend it.
+@item set suspend
+Allow @code{nano} to be suspended.
-@item set tabsize "n"
-Use a tab size of "n" columns. The value of "n" must be greater than 0.
-The default value is 8.
+@item set tabsize @var{number}
+Use a tab size of @var{number} columns. The value of @var{number} must be
+greater than 0. The default value is 8.
-@item set/unset tabstospaces
+@item set tabstospaces
Convert typed tabs to spaces.
-@item set/unset tempfile
+@item set tempfile
Save automatically on exit, don't prompt.
-@item set/unset undo
-Enable experimental generic-purpose undo code.
+@item set titlecolor @var{fgcolor},@var{bgcolor}
+Specify the color combination to use for the titlebar.
+Valid color names for foreground and background are:
+white, black, red, blue, green, yellow, magenta, and cyan.
+And either @var{fgcolor} or @var{,bgcolor} may be left out.
-@item set/unset view
+@item set view
Disallow file modification.
-@item set whitespace "string"
-Set the two characters used to display the first characters of tabs and
-spaces. They must be single-column characters.
+@anchor{Whitespace}
+@item set whitespace "@var{string}"
+Set the two characters used to indicate the presence of tabs and
+spaces. They must be single-column characters. The default pair
+for a UTF-8 locale is "»·", and for other locales ">.".
-@item set/unset wordbounds
+@item set wordbounds
Detect word boundaries more accurately by treating punctuation
characters as part of a word.
-@item syntax "str" ["fileregex" @dots{} ]
+@end table
+
+@node Syntax Highlighting
+@section Syntax Highlighting
+
+Coloring the different syntactic elements of a file
+is done via regular expressions (see the @code{color} command below).
+This is inherently imperfect, because regular expressions are not
+powerful enough to fully parse a file. Nevertheless, regular
+expressions can do a lot and are easy to make, so they are a
+good fit for a small editor like @code{nano}.
+
+A separate syntax can be defined for each kind of file
+via the following commands in a nanorc file:
+
+@table @code
+
+@item syntax "str" ["fileregex" @dots{}]
Defines a syntax named "str" which can be activated via the -Y/--syntax
-command line option, or will be automatically activated if the current
+command-line option, or will be automatically activated if the current
filename matches the extended regular expression "fileregex". All
-following "color" and "icolor" statements will apply to "syntax" until a
-new syntax is defined.
+following "color" and "icolor" statements will apply to this "str"
+syntax until a new syntax is defined.
The "none" syntax is reserved; specifying it on the command line is the
same as not having a syntax at all. The "default" syntax is special: it
takes no "fileregex", and applies to files that don't match any other
syntax's "fileregex".
+@item linter program [arg @dots{}]
+For the currently defined syntax, use the given program to invoke the
+linter (this overrides the speller function when defined).
+
+@item formatter program [arg @dots{}]
+For the currently defined syntax, use the given program to automatically
+reformat text. Useful in certain programming languages (e.g. go).
+
+@item header "regex" @dots{}
+For the currently defined syntax, add one or more regexes which will
+be compared against the very first line of the file to be edited,
+to determine whether this syntax should be used for that file.
+
+@item magic "regex" @dots{}
+For the currently defined syntax, add one or more regexes which will be
+compared against the result of querying the magic database about the file
+to be edited, to determine whether this syntax should be used for that
+file. This functionality only works when libmagic is installed on the
+system and will be silently ignored otherwise.
+
@item color fgcolor,bgcolor "regex" @dots{}
For the currently defined syntax, display all expressions matching the
extended regular expression "regex" with foreground color "fgcolor" and
background color "bgcolor", at least one of which must be specified.
-Legal colors for foreground and background color are: white, black, red,
+Valid colors for foreground and background are: white, black, red,
blue, green, yellow, magenta, and cyan. You may use the prefix "bright"
-to force a stronger color highlight for the foreground. If your
-terminal supports transparency, not specifying a "bgcolor" tells "nano"
+to get a stronger color highlight for the foreground. If your
+terminal supports transparency, not specifying a "bgcolor" tells @code{nano}
to attempt to use a transparent background.
@item icolor fgcolor,bgcolor "regex" @dots{}
@@ -709,12 +882,374 @@ Same as above, except that the expression matching is case insensitive.
@item include "syntaxfile"
Read in self-contained color syntaxes from "syntaxfile". Note that
-"syntaxfile" can only contain "syntax", "color", and "icolor" commands.
+"syntaxfile" can only contain the above commands, from "syntax" to
+"icolor".
+
+@item extendsyntax str directive [arg @dots{}]
+Extend the syntax previously defined as str to include new information.
+Allows you to add a new color, icolor, magic, header, or linter directive
+to an already defined syntax. Useful when you want to add to definitions
+from the system-installed syntax definitions (which are normally not writable).
+
+@end table
+
+@node Rebinding Keys
+@section Rebinding Keys
+
+Key bindings may be reassigned via the following two commands in a
+nanorc file:
+
+@table @code
+
+@item bind key function menu
+Rebinds @code{key} to @code{function} in the context of @code{menu}
+(or in all menus where the function exists by using @code{all}).
+
+@item unbind key menu
+Unbinds @code{key} from @code{menu}
+(or from all menus where it exists by using @code{all}).
+
+@end table
+
+The format of @code{key} should be one of:
+
+@table @code
+
+@item ^
+followed by an alpha character or the word "Space".
+Example: @code{^C}
+
+@item M-
+followed by a printable character or the word "Space".
+Example: @code{M-C}
+
+@item F
+followed by a numeric value from 1 to 16.
+Example: @code{F10}
@end table
+Valid names for the @code{function} to be bound are:
+
+@table @code
+
+@item help
+Invokes the help viewer.
+
+@item cancel
+Cancels the current command.
+
+@item exit
+Exits from the program (or from the help viewer or the file browser).
+
+@item writeout
+Writes the current buffer to disk.
+
+@item insert
+Inserts a file into the current buffer (or into a new buffer when multibuffer
+is enabled).
+
+@item whereis
+Searches for text in the current buffer -- or for filenames matching
+a string in the current list in the file browser
+
+@item searchagain
+Repeats the last search command.
+
+@item replace
+Interactively replaces text within the current buffer.
+
+@item cut
+Cuts and stores the current line (or the marked region).
+
+@item copytext
+Copies the current line (or the marked region) without deleting it.
+
+@item uncut
+Copies the currently stored text into the current buffer at the
+current cursor position.
+
+@item mark
+Sets the mark at the current position, to start selecting text.
+
+@item cutrestoffile
+Cuts all text from the cursor position till the end of the buffer.
+
+@item curpos
+Shows the current cursor position: the line, column, and character positions.
+
+@item wordcount
+Counts the number of words, lines and characters in the current buffer.
+
+@item speller
+Invokes a spell-checking program (or a linting program, if the current
+syntax highlighting defines one).
+
+@item justify
+Justifies the current paragraph.
+
+@item fulljustify
+Justifies the entire current buffer.
+
+@item indent
+Indents (shifts to the right) the currently marked text.
+
+@item unindent
+Unindents (shifts to the left) the currently marked text.
+
+@item left
+Goes left one position (in the editor or browser).
+
+@item right
+Goes right one position (in the editor or browser).
+
+@item up
+Goes one line up (in the editor or browser).
+
+@item down
+Goes one line down (in the editor or browser).
+
+@item scrollup
+Scrolls up one line of text from the current position.
+
+@item scrolldown
+Scrolls down one line of text from the current position.
-@node The File Browser, Pico Compatibility, Nanorc Files, Top
+@item nextword
+Moves the cursor to the beginning of the next word.
+
+@item prevword
+Moves the cursor to the beginning of the previous word.
+
+@item home
+Moves the cursor to the beginning of the current line.
+
+@item end
+Moves the cursor to the end of the current line.
+
+@item beginpara
+Moves the cursor to the beginning of the current paragraph.
+
+@item endpara
+Moves the cursor to the end of the current paragraph.
+
+@item prevpage
+Goes up one screenful.
+
+@item nextpage
+Goes down one screenful.
+
+@item firstline
+Goes to the first line of the file.
+
+@item lastline
+Goes to the last line of the file.
+
+@item gotoline
+Goes to a specific line (and column if specified).
+
+@item gototext
+Switches from targeting a line number to searching for text.
+
+@item findbracket
+Moves the cursor to the bracket (brace, parenthesis, etc.) that matches
+(pairs) with the one under the cursor.
+
+@item prevbuf
+Switches to editing/viewing the previous buffer when using multibuffer mode.
+
+@item nextbuf
+Switches to editing/viewing the next buffer when using multibuffer mode.
+
+@item verbatim
+Inserts the next character verbatim into the file.
+
+@item tab
+Inserts a tab at the current cursor location.
+
+@item enter
+Inserts a new line below the current one.
+
+@item delete
+Deletes the character under the cursor.
+
+@item backspace
+Deletes the character before the cursor.
+
+@item undo
+Undoes the last performed text action (add text, delete text, etc).
+
+@item redo
+Redoes the last undone action (i.e., it undoes an undo).
+
+@item refresh
+Refreshes the screen.
+
+@item suspend
+Suspends the editor (if the suspending function is enabled, see the
+"suspendenable" entry below).
+
+@item casesens
+Toggles case sensitivity in searching (search/replace menus only).
+
+@item regexp
+Toggles whether searching/replacing is based on literal strings or regular expressions.
+
+@item backwards
+Toggles whether searching/replacing goes forward or backward.
+
+@item prevhistory
+Shows the previous history entry in the prompt menus (e.g. search).
+
+@item nexthistory
+Shows the next history entry in the prompt menus (e.g. search).
+
+@item flipreplace
+Toggles between searching for something and replacing something.
+
+@item flipexecute
+Toggles between inserting a file and executing a command.
+
+@item flipnewbuffer
+Toggles between inserting into the current buffer and into a new
+empty buffer.
+
+@item dosformat
+When writing a file, switches to writing a DOS format (CR/LF).
+
+@item macformat
+When writing a file, switches to writing a Mac format.
+
+@item append
+When writing a file, appends to the end instead of overwriting.
+
+@item prepend
+When writing a file, 'prepends' (writes at the beginning) instead of overwriting.
+
+@item backup
+When writing a file, creates a backup of the current file.
+
+@item tofiles
+Starts the file browser, allowing to select a file from a list.
+
+@item gotodir
+Goes to a directory to be specified, allowing to browse anywhere
+in the filesystem.
+
+@item firstfile
+Goes to the first file when using the file browser (reading or writing files).
+
+@item lastfile
+Goes to the last file when using the file browser (reading or writing files).
+
+@item nohelp
+Toggles the presence of the two-line list of key bindings at the bottom of the screen.
+
+@item constupdate
+Toggles the constant display of the current line, column, and character positions.
+
+@item morespace
+Toggles the presence of the blank line which 'separates' the titlebar from the file text.
+
+@item smoothscroll
+Toggles smooth scrolling (when moving around with the arrow keys).
+
+@item softwrap
+Toggles the displaying of overlong lines on multiple screen lines.
+
+@item whitespacedisplay
+Toggles the showing of whitespace.
+
+@item nosyntax
+Toggles syntax highlighting.
+
+@item smarthome
+Toggles the smartness of the Home key.
+
+@item autoindent
+Toggles whether new lines will contain the same amount of whitespace as the preceding line.
+
+@item cuttoend
+Toggles whether cutting text will cut the whole line or just from the current cursor
+position to the end of the line.
+
+@item nowrap
+Toggles whether long lines will be hard-wrapped to the next line.
+
+@item tabstospaces
+Toggles whether typed tabs will be converted to spaces.
+
+@item backupfile
+Toggles whether a backup will be made of the file to be edited.
+
+@item multibuffer
+Toggles the use of multiple file buffers (if available).
+
+@item mouse
+Toggles mouse support.
+
+@item noconvert
+Toggles automatic conversion of files from DOS/Mac format.
+
+@item suspendenable
+Toggles whether the suspend sequence (normally ^Z) will suspend the editor window.
+
+@end table
+
+Valid names for @code{menu} are:
+
+@table @code
+
+@item main
+The main editor window where text is entered and edited.
+
+@item search
+The search menu (AKA whereis).
+
+@item replace
+The 'search to replace' menu.
+
+@item replacewith
+The 'replace with' menu, which comes up after 'search to replace'.
+
+@item gotoline
+The 'goto line (and column)' menu.
+
+@item writeout
+The 'write file' menu.
+
+@item insert
+The 'insert file' menu.
+
+@item extcmd
+The menu for inserting output from an external command, reached from the insert menu.
+
+@item help
+The help-viewer menu.
+
+@item spell
+The interactive spell checker Yes/no menu.
+
+@item linter
+The linter menu.
+
+@item browser
+The file browser for inserting or writing a file.
+
+@item whereisfile
+The 'search for a file' menu in the file browser.
+
+@item gotodir
+The 'go to directory' menu in the file browser.
+
+@item all
+A special name that encompasses all menus. For @code{bind} it means
+all menus where the specified @code{function} exists; for @code{unbind}
+it means all menus where the specified @code{key} exists.
+@end table
+
+
+@node The File Browser
@chapter The File Browser
When reading or writing files, pressing ^T will invoke the file browser.
@@ -730,7 +1265,8 @@ enter and display the contents of the directory. If the object is a
file, this filename and path are copied to the statusbar, and the file
browser exits.
-@node Pico Compatibility, Building and Configure Options, The File Browser, Top
+
+@node Pico Compatibility
@chapter Pico Compatibility
@code{nano} attempts to emulate Pico as closely as possible, but there
@@ -766,14 +1302,14 @@ functions can be toggled for a particular version of @code{nano}. See
@item Cursor Position Display
The output of the "Display Cursor Position" in @code{nano} displays
-the given column position, as well as the row and total character
-position of the cursor.
+the current line position of the cursor, as well as the column and
+total character position.
@item Interactive Replace and Spell Checker
It is worth noting that @code{nano}'s replace function is interactive,
-i.e. it does not stop after one search string is found and automatically
-replace it. The @code{nano} implementation will pause at each search
-string found and query whether to replace this instance or not. The
+i.e. it does not stop after one search string was found and automatically
+replaced. The @code{nano} implementation will pause at each found
+search string and query whether to replace this instance or not. The
internal spell checker operates similarly. Note that there is no way to
force these functions to behave in the Pico fashion. As of version
1.1.99pre1, misspelled words are sorted and trimmed for uniqueness in
@@ -781,7 +1317,8 @@ the internal spell checker such that the words 'apple' and 'Apple' will
be prompted for correction separately.
@end table
-@node Building and Configure Options, , Pico Compatibility, Top
+
+@node Building and Configure Options
@chapter Building and Configure Options
Building @code{nano} from source is fairly straightforward if you are
@@ -803,81 +1340,98 @@ The possible options to @code{./configure} are:
@item --disable-browser
Disable the mini file browser when reading or writing files.
+@item --disable-color
+Disable support for the syntax coloring of files. This also eliminates
+the -Y command-line option, which chooses a specific syntax.
+
+@item --disable-extra
+Disable extra features. At the moment, this is just easter-egg-type
+stuff.
+
@item --disable-help
Disable the help function. Doing this makes the binary much smaller,
but makes it difficult for new users to learn more than very basic
things about using the editor.
+@item --disable-histories
+Disable the code for the handling of the history files: the search and
+replace strings that were used, and the cursor position at which each
+file was closed. This also eliminates the -H and -P command-line
+options, which switch on the logging of search/replace strings and
+cursor positions.
+
@item --disable-justify
Disable the justify and unjustify functions.
+@item --disable-libmagic
+Disable the use of the library of magic-number tests (for determining
+the file type and thus which syntax to use for colouring -- often the
+tests on filename extension and header line will be enough).
+
@item --disable-mouse
-Disable all mouse functionality. This also disables the -m command line
-option, which enables the mouse functionality.
+Disable all mouse functionality. This also eliminates the -m
+command-line option, which enables the mouse functionality.
+
+@item --disable-multibuffer
+Disable support for opening multiple files at a time and switching
+between them on the fly. This also eliminates the -F command-line
+option, which switches the use of multiple file buffers on.
+
+@item --disable-nanorc
+Disable support for reading the nanorc files at startup. With such
+support, you can store custom settings in a system-wide and a per-user
+nanorc file rather than having to pass command-line options to get
+the desired behavior. See @xref{Nanorc Files}, for more info.
+Disabling this also eliminates the -I and -q command-line options;
+the first inhibits the reading of nanorcfiles, and the second
+suppresses warnings about errors in those files.
@item --disable-operatingdir
-Disable setting the operating directory. This also disables the -o
-command line option, which sets the operating directory.
+Disable setting the operating directory. This also eliminates the -o
+command-line option, which sets the operating directory.
@item --disable-speller
-Disable use of the spell checker. This also disables the -s command
-line option, which allows specifying an alternate spell checker.
+Disable use of the spell checker. This also eliminates the -s
+command-line option, which allows specifying an alternate spell checker.
@item --disable-tabcomp
Disable the tab completion code when reading or writing files.
@item --disable-wrapping
-Disable all long line wrapping. This also eliminates the -w command
-line option, which enables long line wrapping.
+Disable hard-wrapping of overlong lines. This also eliminates the -w
+command-line option, which enables long-line wrapping.
@item --enable-tiny
This option disables all the above. It also disables some of the larger
-internals of the editor, like the marking code and the cut to end of
-line code. It also disables the function toggles.
+internals of the editor, like the marking code and the cut-to-end-of-line
+code. It also disables the function toggles. By using the enabling
+counterpart of the above options together with --enable-tiny, specific
+features can be switched back on.
@item --enable-debug
Enable support for runtime debug output. This can get pretty messy, so
-chances are you only want this feature to work on the nano source.
-
-@item --enable-extra
-Enable extra features. At the moment, this is just easter egg-type
-stuff.
-
-@item --enable-color
-Enable support for syntax coloring of files using the nanorc file. This
-enables nanorc support as well.
-
-@item --enable-multibuffer
-Enable support for opening multiple files at a time and switching
-between them on the fly.
-
-@item --enable-nanorc
-Enable support for reading the nanorc file at startup. You can store
-custom settings in the nanorc file rather than having to pass command
-line options to get desired behavior. See @xref{Nanorc Files}, for
-more info.
-
-@item --enable-all
-Shortcut for enabling the above four features (extra, color,
-multibuffer, and nanorc).
+chances are you only want this feature when you're working on the nano source.
@item --disable-nls
-Disables Native Language support. This will disable use of the
+Disables Native Language support. This will disable the use of any
available GNU @code{nano} translations.
@item --disable-wrapping-as-root
-Disable long line wrapping by default when nano is run as root.
+Disable hard-wrapping of overlong lines by default when @code{nano}
+is run as root.
@item --enable-utf8
Enable support for reading and writing Unicode files. This will require
either a wide version of curses, or a UTF-8-enabled version of Slang.
@item --disable-utf8
-Disable support for reading and writing Unicode files.
+Disable support for reading and writing Unicode files. Normally the
+configure script auto-detects whether to enable UTF-8 support or not.
+You can use this or the previous option to override that detection.
@item --with-slang
-Compiling @code{nano} with Slang is supported, and will make the binary
-notably smaller than if compiled with ncurses or other curses libraries.
+Compile @code{nano} against Slang instead of against ncurses or other
+curses libraries.
@end table
diff --git a/doc/texinfo/texinfo.tex b/doc/texinfo/texinfo.tex
index 9140826..85f184c 100644
--- a/doc/texinfo/texinfo.tex
+++ b/doc/texinfo/texinfo.tex
@@ -3,11 +3,11 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2009-08-14.15}
+\def\texinfoversion{2013-02-01.11}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-% 2007, 2008, 2009 Free Software Foundation, Inc.
+% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
%
% This texinfo.tex file is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
@@ -24,13 +24,14 @@
%
% As a special exception, when this file is read by TeX when processing
% a Texinfo source document, you may use the result without
-% restriction. (This has been our intent since Texinfo was invented.)
+% restriction. This Exception is an additional permission under section 7
+% of the GNU General Public License, version 3 ("GPLv3").
%
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
-% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
-% ftp://tug.org/tex/texinfo.tex
-% (and all CTAN mirrors, see http://www.ctan.org).
+% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
+% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
+% http://www.gnu.org/software/texinfo/ (the Texinfo home page)
% The texinfo.tex in any given distribution could well be out
% of date, so if that's what you're using, please check.
%
@@ -65,7 +66,6 @@
\everyjob{\message{[Texinfo version \texinfoversion]}%
\catcode`+=\active \catcode`\_=\active}
-
\chardef\other=12
% We never want plain's \outer definition of \+ in Texinfo.
@@ -93,14 +93,13 @@
\let\ptexnewwrite\newwrite
\let\ptexnoindent=\noindent
\let\ptexplus=+
+\let\ptexraggedright=\raggedright
\let\ptexrbrace=\}
\let\ptexslash=\/
\let\ptexstar=\*
\let\ptext=\t
\let\ptextop=\top
-{\catcode`\'=\active
-\global\let\ptexquoteright'}% Math-mode def from plain.tex.
-\let\ptexraggedright=\raggedright
+{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
% If this character appears in an error message or help string, it
% starts a new line in the output.
@@ -118,10 +117,11 @@
% Set up fixed words for English if not already set.
\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putworderror\undefined \gdef\putworderror{error}\fi
\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
\ifx\putwordin\undefined \gdef\putwordin{in}\fi
-\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
-\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
@@ -160,15 +160,18 @@
\def\spaceisspace{\catcode`\ =\spacecat}
% sometimes characters are active, so we need control sequences.
+\chardef\ampChar = `\&
\chardef\colonChar = `\:
\chardef\commaChar = `\,
\chardef\dashChar = `\-
\chardef\dotChar = `\.
\chardef\exclamChar= `\!
+\chardef\hashChar = `\#
\chardef\lquoteChar= `\`
\chardef\questChar = `\?
\chardef\rquoteChar= `\'
\chardef\semiChar = `\;
+\chardef\slashChar = `\/
\chardef\underChar = `\_
% Ignore a token.
@@ -199,36 +202,7 @@
% that mark overfull boxes (in case you have decided
% that the text looks ok even though it passes the margin).
%
-\def\finalout{\overfullrule=0pt}
-
-% @| inserts a changebar to the left of the current line. It should
-% surround any changed text. This approach does *not* work if the
-% change spans more than two lines of output. To handle that, we would
-% have adopt a much more difficult approach (putting marks into the main
-% vertical list for the beginning and end of each change).
-%
-\def\|{%
- % \vadjust can only be used in horizontal mode.
- \leavevmode
- %
- % Append this vertical mode material after the current line in the output.
- \vadjust{%
- % We want to insert a rule with the height and depth of the current
- % leading; that is exactly what \strutbox is supposed to record.
- \vskip-\baselineskip
- %
- % \vadjust-items are inserted at the left edge of the type. So
- % the \llap here moves out into the left-hand margin.
- \llap{%
- %
- % For a thicker or thinner bar, change the `1pt'.
- \vrule height\baselineskip width1pt
- %
- % This is the space between the bar and the text.
- \hskip 12pt
- }%
- }%
-}
+\def\finalout{\overfullrule=0pt }
% Sometimes it is convenient to have everything in the transcript file
% and nothing on the terminal. We don't just call \tracingall here,
@@ -246,7 +220,7 @@
\tracingmacros2
\tracingrestores1
\showboxbreadth\maxdimen \showboxdepth\maxdimen
- \ifx\eTeXversion\undefined\else % etex gives us more logging
+ \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
\tracingscantokens1
\tracingifs1
\tracinggroups1
@@ -257,6 +231,13 @@
\errorcontextlines16
}%
+% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
+% aren't perfect, it's not the end of the world, being an error message,
+% after all.
+%
+\def\errormsg{\begingroup \indexnofonts \doerrormsg}
+\def\doerrormsg#1{\errmessage{#1}}
+
% add check for \lastpenalty to plain's definitions. If the last thing
% we did was a \nobreak, we don't want to insert more space.
%
@@ -267,7 +248,6 @@
\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
\removelastskip\penalty-200\bigskip\fi\fi}
-% For @cropmarks command.
% Do @cropmarks to get crop marks.
%
\newif\ifcropmarks
@@ -577,7 +557,7 @@
}
\def\inenvironment#1{%
\ifx#1\empty
- out of any environment%
+ outside of any environment%
\else
in environment \expandafter\string#1%
\fi
@@ -589,7 +569,7 @@
\parseargdef\end{%
\if 1\csname iscond.#1\endcsname
\else
- % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
+ % The general wording of \badenverr may not be ideal.
\expandafter\checkenv\csname#1\endcsname
\csname E#1\endcsname
\endgroup
@@ -599,85 +579,6 @@
\newhelp\EMsimple{Press RETURN to continue.}
-%% Simple single-character @ commands
-
-% @@ prints an @
-% Kludge this until the fonts are right (grr).
-\def\@{{\tt\char64}}
-
-% This is turned off because it was never documented
-% and you can use @w{...} around a quote to suppress ligatures.
-%% Define @` and @' to be the same as ` and '
-%% but suppressing ligatures.
-%\def\`{{`}}
-%\def\'{{'}}
-
-% Used to generate quoted braces.
-\def\mylbrace {{\tt\char123}}
-\def\myrbrace {{\tt\char125}}
-\let\{=\mylbrace
-\let\}=\myrbrace
-\begingroup
- % Definitions to produce \{ and \} commands for indices,
- % and @{ and @} for the aux/toc files.
- \catcode`\{ = \other \catcode`\} = \other
- \catcode`\[ = 1 \catcode`\] = 2
- \catcode`\! = 0 \catcode`\\ = \other
- !gdef!lbracecmd[\{]%
- !gdef!rbracecmd[\}]%
- !gdef!lbraceatcmd[@{]%
- !gdef!rbraceatcmd[@}]%
-!endgroup
-
-% @comma{} to avoid , parsing problems.
-\let\comma = ,
-
-% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
-% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
-\let\, = \c
-\let\dotaccent = \.
-\def\ringaccent#1{{\accent23 #1}}
-\let\tieaccent = \t
-\let\ubaraccent = \b
-\let\udotaccent = \d
-
-% Other special characters: @questiondown @exclamdown @ordf @ordm
-% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
-\def\questiondown{?`}
-\def\exclamdown{!`}
-\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
-\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
-
-% Dotless i and dotless j, used for accents.
-\def\imacro{i}
-\def\jmacro{j}
-\def\dotless#1{%
- \def\temp{#1}%
- \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
- \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
- \else \errmessage{@dotless can be used only with i or j}%
- \fi\fi
-}
-
-% The \TeX{} logo, as in plain, but resetting the spacing so that a
-% period following counts as ending a sentence. (Idea found in latex.)
-%
-\edef\TeX{\TeX \spacefactor=1000 }
-
-% @LaTeX{} logo. Not quite the same results as the definition in
-% latex.ltx, since we use a different font for the raised A; it's most
-% convenient for us to use an explicitly smaller font, rather than using
-% the \scriptstyle font (since we don't reset \scriptstyle and
-% \scriptscriptstyle).
-%
-\def\LaTeX{%
- L\kern-.36em
- {\setbox0=\hbox{T}%
- \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
- \kern-.15em
- \TeX
-}
-
% Be sure we're in horizontal mode when doing a tie, since we make space
% equivalent to this in @example-like environments. Otherwise, a space
% at the beginning of a line will start with \penalty -- and
@@ -694,7 +595,7 @@
\def\:{\spacefactor=1000 }
% @* forces a line break.
-\def\*{\hfil\break\hbox{}\ignorespaces}
+\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
% @/ allows a line break.
\let\/=\allowbreak
@@ -719,7 +620,7 @@
\else\ifx\temp\offword \plainnonfrenchspacing
\else
\errhelp = \EMsimple
- \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
+ \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
\fi\fi
}
@@ -801,15 +702,6 @@ where each line of input produces a line of output.}
\newdimen\mil \mil=0.001in
-% Old definition--didn't work.
-%\parseargdef\need{\par %
-%% This method tries to make TeX break the page naturally
-%% if the depth of the box does not fit.
-%{\baselineskip=0pt%
-%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
-%\prevdepth=-1000pt
-%}}
-
\parseargdef\need{%
% Ensure vertical mode, so we don't make a big box in the middle of a
% paragraph.
@@ -873,7 +765,7 @@ where each line of input produces a line of output.}
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
% paragraph. For more general purposes, use the \margin insertion
-% class. WHICH is `l' or `r'.
+% class. WHICH is `l' or `r'. Not documented, written for gawk manual.
%
\newskip\inmarginspacing \inmarginspacing=1cm
\def\strutdepth{\dp\strutbox}
@@ -920,6 +812,36 @@ where each line of input produces a line of output.}
\temp
}
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change). This command
+% is not documented, not supported, and doesn't work.
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
% @include FILE -- \input text of FILE.
%
\def\include{\parseargusing\filenamecatcodes\includezzz}
@@ -930,6 +852,7 @@ where each line of input produces a line of output.}
\makevalueexpandable % we want to expand any @value in FILE.
\turnoffactive % and allow special characters in the expansion
\indexnofonts % Allow `@@' and other weird things in file names.
+ \wlog{texinfo.tex: doing @include of #1^^J}%
\edef\temp{\noexpand\input #1 }%
%
% This trickery is to read FILE outside of a group, in case it makes
@@ -965,7 +888,7 @@ where each line of input produces a line of output.}
\def\popthisfilestack{\errthisfilestackempty}
\def\errthisfilestackempty{\errmessage{Internal error:
the stack of filenames is empty.}}
-
+%
\def\thisfile{}
% @center line
@@ -973,36 +896,46 @@ where each line of input produces a line of output.}
%
\parseargdef\center{%
\ifhmode
- \let\next\centerH
+ \let\centersub\centerH
\else
- \let\next\centerV
+ \let\centersub\centerV
\fi
- \next{\hfil \ignorespaces#1\unskip \hfil}%
+ \centersub{\hfil \ignorespaces#1\unskip \hfil}%
+ \let\centersub\relax % don't let the definition persist, just in case
}
-\def\centerH#1{%
- {%
- \hfil\break
- \advance\hsize by -\leftskip
- \advance\hsize by -\rightskip
- \line{#1}%
- \break
- }%
+\def\centerH#1{{%
+ \hfil\break
+ \advance\hsize by -\leftskip
+ \advance\hsize by -\rightskip
+ \line{#1}%
+ \break
+}}
+%
+\newcount\centerpenalty
+\def\centerV#1{%
+ % The idea here is the same as in \startdefun, \cartouche, etc.: if
+ % @center is the first thing after a section heading, we need to wipe
+ % out the negative parskip inserted by \sectionheading, but still
+ % prevent a page break here.
+ \centerpenalty = \lastpenalty
+ \ifnum\centerpenalty>10000 \vskip\parskip \fi
+ \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
+ \line{\kern\leftskip #1\kern\rightskip}%
}
-\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
% @sp n outputs n lines of vertical space
-
+%
\parseargdef\sp{\vskip #1\baselineskip}
% @comment ...line which is ignored...
% @c is the same as @comment
% @ignore ... @end ignore is another way to write a comment
-
+%
\def\comment{\begingroup \catcode`\^^M=\other%
\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
\commentxxx}
{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
-
+%
\let\c=\comment
% @paragraphindent NCHARS
@@ -1095,109 +1028,6 @@ where each line of input produces a line of output.}
}
-% @asis just yields its argument. Used with @table, for example.
-%
-\def\asis#1{#1}
-
-% @math outputs its argument in math mode.
-%
-% One complication: _ usually means subscripts, but it could also mean
-% an actual _ character, as in @math{@var{some_variable} + 1}. So make
-% _ active, and distinguish by seeing if the current family is \slfam,
-% which is what @var uses.
-{
- \catcode`\_ = \active
- \gdef\mathunderscore{%
- \catcode`\_=\active
- \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
- }
-}
-% Another complication: we want \\ (and @\) to output a \ character.
-% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
-% this is not advertised and we don't care. Texinfo does not
-% otherwise define @\.
-%
-% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
-\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
-%
-\def\math{%
- \tex
- \mathunderscore
- \let\\ = \mathbackslash
- \mathactive
- % make the texinfo accent commands work in math mode
- \let\"=\ddot
- \let\'=\acute
- \let\==\bar
- \let\^=\hat
- \let\`=\grave
- \let\u=\breve
- \let\v=\check
- \let\~=\tilde
- \let\dotaccent=\dot
- $\finishmath
-}
-\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
-
-% Some active characters (such as <) are spaced differently in math.
-% We have to reset their definitions in case the @math was an argument
-% to a command which sets the catcodes (such as @item or @section).
-%
-{
- \catcode`^ = \active
- \catcode`< = \active
- \catcode`> = \active
- \catcode`+ = \active
- \catcode`' = \active
- \gdef\mathactive{%
- \let^ = \ptexhat
- \let< = \ptexless
- \let> = \ptexgtr
- \let+ = \ptexplus
- \let' = \ptexquoteright
- }
-}
-
-% Some math mode symbols.
-\def\bullet{$\ptexbullet$}
-\def\geq{\ifmmode \ge\else $\ge$\fi}
-\def\leq{\ifmmode \le\else $\le$\fi}
-\def\minus{\ifmmode -\else $-$\fi}
-
-% @dots{} outputs an ellipsis using the current font.
-% We do .5em per period so that it has the same spacing in the cm
-% typewriter fonts as three actual period characters; on the other hand,
-% in other typewriter fonts three periods are wider than 1.5em. So do
-% whichever is larger.
-%
-\def\dots{%
- \leavevmode
- \setbox0=\hbox{...}% get width of three periods
- \ifdim\wd0 > 1.5em
- \dimen0 = \wd0
- \else
- \dimen0 = 1.5em
- \fi
- \hbox to \dimen0{%
- \hskip 0pt plus.25fil
- .\hskip 0pt plus1fil
- .\hskip 0pt plus1fil
- .\hskip 0pt plus.5fil
- }%
-}
-
-% @enddots{} is an end-of-sentence ellipsis.
-%
-\def\enddots{%
- \dots
- \spacefactor=\endofsentencespacefactor
-}
-
-% @comma{} is so commas can be inserted into text without messing up
-% Texinfo's parsing.
-%
-\let\comma = ,
-
% @refill is a no-op.
\let\refill=\relax
@@ -1262,9 +1092,8 @@ where each line of input produces a line of output.}
\newif\ifpdfmakepagedest
% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
-% can be set). So we test for \relax and 0 as well as \undefined,
-% borrowed from ifpdf.sty.
-\ifx\pdfoutput\undefined
+% can be set). So we test for \relax and 0 as well as being undefined.
+\ifx\pdfoutput\thisisundefined
\else
\ifx\pdfoutput\relax
\else
@@ -1279,50 +1108,24 @@ where each line of input produces a line of output.}
% for display in the outlines, and in other places. Thus, we have to
% double any backslashes. Otherwise, a name like "\node" will be
% interpreted as a newline (\n), followed by o, d, e. Not good.
-% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
-% (and related messages, the final outcome is that it is up to the TeX
-% user to double the backslashes and otherwise make the string valid, so
-% that's what we do).
-
-% double active backslashes.
-%
-{\catcode`\@=0 \catcode`\\=\active
- @gdef@activebackslashdouble{%
- @catcode`@\=@active
- @let\=@doublebackslash}
-}
-
-% To handle parens, we must adopt a different approach, since parens are
-% not active characters. hyperref.dtx (which has the same problem as
-% us) handles it with this amazing macro to replace tokens, with minor
-% changes for Texinfo. It is included here under the GPL by permission
-% from the author, Heiko Oberdiek.
-%
-% #1 is the tokens to replace.
-% #2 is the replacement.
-% #3 is the control sequence with the string.
-%
-\def\HyPsdSubst#1#2#3{%
- \def\HyPsdReplace##1#1##2\END{%
- ##1%
- \ifx\\##2\\%
- \else
- #2%
- \HyReturnAfterFi{%
- \HyPsdReplace##2\END
- }%
- \fi
- }%
- \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
-}
-\long\def\HyReturnAfterFi#1\fi{\fi#1}
-
-% #1 is a control sequence in which to do the replacements.
-\def\backslashparens#1{%
- \xdef#1{#1}% redefine it as its expansion; the definition is simply
- % \lastnode when called from \setref -> \pdfmkdest.
- \HyPsdSubst{(}{\realbackslash(}{#1}%
- \HyPsdSubst{)}{\realbackslash)}{#1}%
+%
+% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
+% related messages. The final outcome is that it is up to the TeX user
+% to double the backslashes and otherwise make the string valid, so
+% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
+% do this reliably, so we use it.
+
+% #1 is a control sequence in which to do the replacements,
+% which we \xdef.
+\def\txiescapepdf#1{%
+ \ifx\pdfescapestring\thisisundefined
+ % No primitive available; should we give a warning or log?
+ % Many times it won't matter.
+ \else
+ % The expandable \pdfescapestring primitive escapes parentheses,
+ % backslashes, and other special chars.
+ \xdef#1{\pdfescapestring{#1}}%
+ \fi
}
\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
@@ -1381,32 +1184,34 @@ output) for that.)}
%
% #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
\def\dopdfimage#1#2#3{%
- \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
- \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+ \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+ \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
%
- % pdftex (and the PDF format) support .png, .jpg, .pdf (among
- % others). Let's try in that order.
+ % pdftex (and the PDF format) support .pdf, .png, .jpg (among
+ % others). Let's try in that order, PDF first since if
+ % someone has a scalable image, presumably better to use that than a
+ % bitmap.
\let\pdfimgext=\empty
\begingroup
- \openin 1 #1.png \ifeof 1
- \openin 1 #1.jpg \ifeof 1
- \openin 1 #1.jpeg \ifeof 1
- \openin 1 #1.JPG \ifeof 1
- \openin 1 #1.pdf \ifeof 1
- \openin 1 #1.PDF \ifeof 1
+ \openin 1 #1.pdf \ifeof 1
+ \openin 1 #1.PDF \ifeof 1
+ \openin 1 #1.png \ifeof 1
+ \openin 1 #1.jpg \ifeof 1
+ \openin 1 #1.jpeg \ifeof 1
+ \openin 1 #1.JPG \ifeof 1
\errhelp = \nopdfimagehelp
\errmessage{Could not find image file #1 for pdf}%
- \else \gdef\pdfimgext{PDF}%
+ \else \gdef\pdfimgext{JPG}%
\fi
- \else \gdef\pdfimgext{pdf}%
+ \else \gdef\pdfimgext{jpeg}%
\fi
- \else \gdef\pdfimgext{JPG}%
+ \else \gdef\pdfimgext{jpg}%
\fi
- \else \gdef\pdfimgext{jpeg}%
+ \else \gdef\pdfimgext{png}%
\fi
- \else \gdef\pdfimgext{jpg}%
+ \else \gdef\pdfimgext{PDF}%
\fi
- \else \gdef\pdfimgext{png}%
+ \else \gdef\pdfimgext{pdf}%
\fi
\closein 1
\endgroup
@@ -1418,8 +1223,8 @@ output) for that.)}
\else
\immediate\pdfximage
\fi
- \ifdim \wd0 >0pt width \imagewidth \fi
- \ifdim \wd2 >0pt height \imageheight \fi
+ \ifdim \wd0 >0pt width \pdfimagewidth \fi
+ \ifdim \wd2 >0pt height \pdfimageheight \fi
\ifnum\pdftexversion<13
#1.\pdfimgext
\else
@@ -1434,10 +1239,9 @@ output) for that.)}
% such as \, aren't expanded when present in a section title.
\indexnofonts
\turnoffactive
- \activebackslashdouble
\makevalueexpandable
\def\pdfdestname{#1}%
- \backslashparens\pdfdestname
+ \txiescapepdf\pdfdestname
\safewhatsit{\pdfdest name{\pdfdestname} xyz}%
}}
%
@@ -1469,29 +1273,24 @@ output) for that.)}
% page number. We could generate a destination for the section
% text in the case where a section has no node, but it doesn't
% seem worth the trouble, since most documents are normally structured.
- \def\pdfoutlinedest{#3}%
+ \edef\pdfoutlinedest{#3}%
\ifx\pdfoutlinedest\empty
\def\pdfoutlinedest{#4}%
\else
- % Doubled backslashes in the name.
- {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
- \backslashparens\pdfoutlinedest}%
+ \txiescapepdf\pdfoutlinedest
\fi
%
- % Also double the backslashes in the display string.
- {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
- \backslashparens\pdfoutlinetext}%
+ % Also escape PDF chars in the display string.
+ \edef\pdfoutlinetext{#1}%
+ \txiescapepdf\pdfoutlinetext
%
\pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
}
%
\def\pdfmakeoutlines{%
\begingroup
- % Thanh's hack / proper braces in bookmarks
- \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
- \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
- %
% Read toc silently, to get counts of subentries for \pdfoutline.
+ \def\partentry##1##2##3##4{}% ignore parts in the outlines
\def\numchapentry##1##2##3##4{%
\def\thischapnum{##2}%
\def\thissecnum{0}%
@@ -1545,25 +1344,41 @@ output) for that.)}
% Latin 2 (0xea) gets translated to a | character. Info from
% Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
%
- % xx to do this right, we have to translate 8-bit characters to
- % their "best" equivalent, based on the @documentencoding. Right
- % now, I guess we'll just let the pdf reader have its way.
+ % TODO this right, we have to translate 8-bit characters to
+ % their "best" equivalent, based on the @documentencoding. Too
+ % much work for too little return. Just use the ASCII equivalents
+ % we use for the index sort strings.
+ %
\indexnofonts
\setupdatafile
+ % We can have normal brace characters in the PDF outlines, unlike
+ % Texinfo index files. So set that up.
+ \def\{{\lbracecharliteral}%
+ \def\}{\rbracecharliteral}%
\catcode`\\=\active \otherbackslash
\input \tocreadfilename
\endgroup
}
+ {\catcode`[=1 \catcode`]=2
+ \catcode`{=\other \catcode`}=\other
+ \gdef\lbracecharliteral[{]%
+ \gdef\rbracecharliteral[}]%
+ ]
%
\def\skipspaces#1{\def\PP{#1}\def\D{|}%
\ifx\PP\D\let\nextsp\relax
\else\let\nextsp\skipspaces
- \ifx\p\space\else\addtokens{\filename}{\PP}%
- \advance\filenamelength by 1
- \fi
+ \addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
\fi
\nextsp}
- \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+ \def\getfilename#1{%
+ \filenamelength=0
+ % If we don't expand the argument now, \skipspaces will get
+ % snagged on things like "@value{foo}".
+ \edef\temp{#1}%
+ \expandafter\skipspaces\temp|\relax
+ }
\ifnum\pdftexversion < 14
\let \startlink \pdfannotlink
\else
@@ -1660,9 +1475,6 @@ output) for that.)}
\def\ttsl{\setfontstyle{ttsl}}
-% Default leading.
-\newdimen\textleading \textleading = 13.2pt
-
% Set the baselineskip to #1, and the lineskip and strut size
% correspondingly. There is no deep meaning behind these magic numbers
% used as factors; they just match (closely enough) what Knuth defined.
@@ -1674,6 +1486,7 @@ output) for that.)}
% can get a sort of poor man's double spacing by redefining this.
\def\baselinefactor{1}
%
+\newdimen\textleading
\def\setleading#1{%
\dimen0 = #1\relax
\normalbaselineskip = \baselinefactor\dimen0
@@ -1695,7 +1508,7 @@ output) for that.)}
% if we are producing pdf, and we have \pdffontattr, then define cmaps.
% (\pdffontattr was introduced many years ago, but people still run
% older pdftex's; it's easy to conditionalize, so we do.)
-\ifpdf \ifx\pdffontattr\undefined \else
+\ifpdf \ifx\pdffontattr\thisisundefined \else
\begingroup
\catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
\catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
@@ -1946,28 +1759,34 @@ end
\fi\fi
-% Set the font macro #1 to the font named #2, adding on the
-% specified font prefix (normally `cm').
+% Set the font macro #1 to the font named \fontprefix#2.
% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
-% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
-% empty to omit).
+% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
+% Example:
+% #1 = \textrm
+% #2 = \rmshape
+% #3 = 10
+% #4 = \mainmagstep
+% #5 = OT1
+%
\def\setfont#1#2#3#4#5{%
\font#1=\fontprefix#2#3 scaled #4
\csname cmap#5\endcsname#1%
}
% This is what gets called when #5 of \setfont is empty.
\let\cmap\gobble
-% emacs-page end of cmaps
+%
+% (end of cmaps)
% Use cm as the default font prefix.
% To specify the font prefix, you must define \fontprefix
% before you read in texinfo.tex.
-\ifx\fontprefix\undefined
+\ifx\fontprefix\thisisundefined
\def\fontprefix{cm}
\fi
% Support font families that don't use the same naming scheme as CM.
\def\rmshape{r}
-\def\rmbshape{bx} %where the normal face is bold
+\def\rmbshape{bx} % where the normal face is bold
\def\bfshape{b}
\def\bxshape{bx}
\def\ttshape{tt}
@@ -1982,8 +1801,7 @@ end
\def\scshape{csc}
\def\scbshape{csc}
-% Definitions for a main text size of 11pt. This is the default in
-% Texinfo.
+% Definitions for a main text size of 11pt. (The default in Texinfo.)
%
\def\definetextfontsizexi{%
% Text fonts (11.2pt, magstep1).
@@ -2105,10 +1923,10 @@ end
\font\reducedsy=cmsy10
\def\reducedecsize{1000}
-% reset the current fonts
-\textfonts
+\textleading = 13.2pt % line spacing for 11pt CM
+\textfonts % reset the current fonts
\rm
-} % end of 11pt text font size definitions
+} % end of 11pt text font size definitions, \definetextfontsizexi
% Definitions to make the main text be 10pt Computer Modern, with
@@ -2236,25 +2054,24 @@ end
\font\reducedsy=cmsy9
\def\reducedecsize{0900}
-% reduce space between paragraphs
-\divide\parskip by 2
-
-% reset the current fonts
-\textfonts
+\divide\parskip by 2 % reduce space between paragraphs
+\textleading = 12pt % line spacing for 10pt CM
+\textfonts % reset the current fonts
\rm
-} % end of 10pt text font size definitions
+} % end of 10pt text font size definitions, \definetextfontsizex
% We provide the user-level command
% @fonttextsize 10
% (or 11) to redefine the text font size. pt is assumed.
%
-\def\xword{10}
\def\xiword{11}
+\def\xword{10}
+\def\xwordpt{10pt}
%
\parseargdef\fonttextsize{%
\def\textsizearg{#1}%
- \wlog{doing @fonttextsize \textsizearg}%
+ %\wlog{doing @fonttextsize \textsizearg}%
%
% Set \globaldefs so that documents can use this inside @tex, since
% makeinfo 4.8 does not support it, but we need it nonetheless.
@@ -2308,7 +2125,7 @@ end
\let\tenttsl=\titlettsl
\def\curfontsize{title}%
\def\lsize{chap}\def\lllsize{subsec}%
- \resetmathfonts \setleading{25pt}}
+ \resetmathfonts \setleading{27pt}}
\def\titlefont#1{{\titlefonts\rmisbold #1}}
\def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
@@ -2436,12 +2253,14 @@ end
% Markup style setup for left and right quotes.
\defmarkupstylesetup\markupsetuplq{%
- \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname
+ \expandafter\let\expandafter \temp
+ \csname markupsetuplq\currentmarkupstyle\endcsname
\ifx\temp\relax \markupsetuplqdefault \else \temp \fi
}
\defmarkupstylesetup\markupsetuprq{%
- \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname
+ \expandafter\let\expandafter \temp
+ \csname markupsetuprq\currentmarkupstyle\endcsname
\ifx\temp\relax \markupsetuprqdefault \else \temp \fi
}
@@ -2454,28 +2273,31 @@ end
\gdef\markupsetcodequoteleft{\let`\codequoteleft}
\gdef\markupsetcodequoteright{\let'\codequoteright}
-
-\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
}
\let\markupsetuplqcode \markupsetcodequoteleft
\let\markupsetuprqcode \markupsetcodequoteright
+%
\let\markupsetuplqexample \markupsetcodequoteleft
\let\markupsetuprqexample \markupsetcodequoteright
+%
+\let\markupsetuplqkbd \markupsetcodequoteleft
+\let\markupsetuprqkbd \markupsetcodequoteright
+%
+\let\markupsetuplqsamp \markupsetcodequoteleft
+\let\markupsetuprqsamp \markupsetcodequoteright
+%
\let\markupsetuplqverb \markupsetcodequoteleft
\let\markupsetuprqverb \markupsetcodequoteright
+%
\let\markupsetuplqverbatim \markupsetcodequoteleft
\let\markupsetuprqverbatim \markupsetcodequoteright
-\let\markupsetuplqsamp \markupsetnoligaturesquoteleft
-\let\markupsetuplqkbd \markupsetnoligaturesquoteleft
-
-% Allow an option to not replace quotes with a regular directed right
-% quote/apostrophe (char 0x27), but instead use the undirected quote
-% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it
-% the default, but it works for pasting with more pdf viewers (at least
-% evince), the lilypond developers report. xpdf does work with the
-% regular 0x27.
+% Allow an option to not use regular directed right quote/apostrophe
+% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
+% The undirected quote is ugly, so don't make it the default, but it
+% works for pasting with more pdf viewers (at least evince), the
+% lilypond developers report. xpdf does work with the regular 0x27.
%
\def\codequoteright{%
\expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
@@ -2499,33 +2321,83 @@ end
\else \char'22 \fi
}
+% Commands to set the quote options.
+%
+\parseargdef\codequoteundirected{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETtxicodequoteundirected\endcsname
+ = t%
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETtxicodequoteundirected\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
+ \fi\fi
+}
+%
+\parseargdef\codequotebacktick{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETtxicodequotebacktick\endcsname
+ = t%
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETtxicodequotebacktick\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
+ \fi\fi
+}
+
% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
\def\noligaturesquoteleft{\relax\lq}
% Count depth in font-changes, for error checks
\newcount\fontdepth \fontdepth=0
-%% Add scribe-like font environments, plus @l for inline lisp (usually sans
-%% serif) and @ii for TeX italic
+% Font commands.
-% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
-% unless the following character is such as not to need one.
-\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
- \ptexslash\fi\fi\fi}
-\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
-\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
+% #1 is the font command (\sl or \it), #2 is the text to slant.
+% If we are in a monospaced environment, however, 1) always use \ttsl,
+% and 2) do not add an italic correction.
+\def\dosmartslant#1#2{%
+ \ifusingtt
+ {{\ttsl #2}\let\next=\relax}%
+ {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
+ \next
+}
+\def\smartslanted{\dosmartslant\sl}
+\def\smartitalic{\dosmartslant\it}
-% like \smartslanted except unconditionally uses \ttsl.
-% @var is set to this for defun arguments.
-\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
+% Output an italic correction unless \next (presumed to be the following
+% character) is such as not to need one.
+\def\smartitaliccorrection{%
+ \ifx\next,%
+ \else\ifx\next-%
+ \else\ifx\next.%
+ \else\ptexslash
+ \fi\fi\fi
+ \aftersmartic
+}
+
+% Unconditional use \ttsl, and no ic. @var is set to this for defuns.
+\def\ttslanted#1{{\ttsl #1}}
% @cite is like \smartslanted except unconditionally use \sl. We never want
% ttsl for book titles, do we?
-\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
+
+\def\aftersmartic{}
+\def\var#1{%
+ \let\saveaftersmartic = \aftersmartic
+ \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
+ \smartslanted{#1}%
+}
\let\i=\smartitalic
\let\slanted=\smartslanted
-\def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}}
\let\dfn=\smartslanted
\let\emph=\smartitalic
@@ -2575,34 +2447,12 @@ end
% @samp.
\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
-% definition of @key that produces a lozenge. Doesn't adjust to text size.
-%\setfont\keyrm\rmshape{8}{1000}{OT1}
-%\font\keysy=cmsy9
-%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
-% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
-% \vbox{\hrule\kern-0.4pt
-% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
-% \kern-0.4pt\hrule}%
-% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+% @indicateurl is \samp, that is, with quotes.
+\let\indicateurl=\samp
-% definition of @key with no lozenge. If the current font is already
-% monospace, don't change it; that way, we respect @kbdinputstyle. But
-% if it isn't monospace, then use \tt.
-%
-\def\key#1{{\setupmarkupstyle{key}%
- \nohyphenation
- \ifmonospace\else\tt\fi
- #1}\null}
-
-% ctrl is no longer a Texinfo command.
-\def\ctrl #1{{\tt \rawbackslash \hat}#1}
-
-% @file, @option are the same as @samp.
-\let\file=\samp
-\let\option=\samp
-
-% @code is a modification of @t,
-% which makes spaces the same size as normal in the surrounding text.
+% @code (and similar) prints in typewriter, but with spaces the same
+% size as normal in the surrounding text, without hyphenation, etc.
+% This is a subroutine for that.
\def\tclose#1{%
{%
% Change normal interword space to be same as for the current font.
@@ -2621,13 +2471,13 @@ end
\plainfrenchspacing
#1%
}%
- \null
+ \null % reset spacefactor to 1000
}
% We *must* turn on hyphenation at `-' and `_' in @code.
% Otherwise, it is too hard to avoid overfull hboxes
% in the Emacs manual, the Library manual, etc.
-
+%
% Unfortunately, TeX uses one parameter (\hyphenchar) to control
% both hyphenation at - and hyphenation within words.
% We must therefore turn them both off (\tclose does that)
@@ -2646,14 +2496,16 @@ end
\let-\codedash
\let_\codeunder
\else
- \let-\realdash
+ \let-\normaldash
\let_\realunder
\fi
\codex
}
}
-\def\realdash{-}
+\def\codex #1{\tclose{#1}\endgroup}
+
+\def\normaldash{-}
\def\codedash{-\discretionary{}{}{}}
\def\codeunder{%
% this is all so @math{@code{var_name}+1} can work. In math mode, _
@@ -2666,12 +2518,11 @@ end
\discretionary{}{}{}}%
{\_}%
}
-\def\codex #1{\tclose{#1}\endgroup}
% An additional complication: the above will allow breaks after, e.g.,
-% each of the four underscores in __typeof__. This is undesirable in
-% some manuals, especially if they don't have long identifiers in
-% general. @allowcodebreaks provides a way to control this.
+% each of the four underscores in __typeof__. This is bad.
+% @allowcodebreaks provides a document-level way to turn breaking at -
+% and _ on and off.
%
\newif\ifallowcodebreaks \allowcodebreakstrue
@@ -2686,63 +2537,25 @@ end
\allowcodebreaksfalse
\else
\errhelp = \EMsimple
- \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
+ \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
\fi\fi
}
-% @kbd is like @code, except that if the argument is just one @key command,
-% then @kbd has no effect.
-\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
-
-% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
-% `example' (@kbd uses ttsl only inside of @example and friends),
-% or `code' (@kbd uses normal tty font always).
-\parseargdef\kbdinputstyle{%
- \def\txiarg{#1}%
- \ifx\txiarg\worddistinct
- \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
- \else\ifx\txiarg\wordexample
- \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
- \else\ifx\txiarg\wordcode
- \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
- \fi\fi\fi
-}
-\def\worddistinct{distinct}
-\def\wordexample{example}
-\def\wordcode{code}
-
-% Default is `distinct'.
-\kbdinputstyle distinct
-
-\def\xkey{\key}
-\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
-\ifx\one\xkey\ifx\threex\three \key{#2}%
-\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
-\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
-
-% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
-\let\indicateurl=\code
-\let\env=\code
+% For @command, @env, @file, @option quotes seem unnecessary,
+% so use \code rather than \samp.
\let\command=\code
-
-% @clicksequence{File @click{} Open ...}
-\def\clicksequence#1{\begingroup #1\endgroup}
-
-% @clickstyle @arrow (by default)
-\parseargdef\clickstyle{\def\click{#1}}
-\def\click{\arrow}
+\let\env=\code
+\let\file=\code
+\let\option=\code
% @uref (abbreviation for `urlref') takes an optional (comma-separated)
% second argument specifying the text to display and an optional third
% arg as text to display instead of (rather than in addition to) the url
-% itself. First (mandatory) arg is the url. Perhaps eventually put in
-% a hypertex \special here.
-%
-\def\uref#1{\douref #1,,,\finish}
-\def\douref#1,#2,#3,#4\finish{\begingroup
+% itself. First (mandatory) arg is the url.
+% (This \urefnobreak definition isn't used now, leaving it for a while
+% for comparison.)
+\def\urefnobreak#1{\dourefnobreak #1,,,\finish}
+\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
\unsepspaces
\pdfurl{#1}%
\setbox0 = \hbox{\ignorespaces #3}%
@@ -2763,6 +2576,103 @@ end
\endlink
\endgroup}
+% This \urefbreak definition is the active one.
+\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
+\let\uref=\urefbreak
+\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
+\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \urefcode{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% Allow line breaks around only a few characters (only).
+\def\urefcatcodes{%
+ \catcode\ampChar=\active \catcode\dotChar=\active
+ \catcode\hashChar=\active \catcode\questChar=\active
+ \catcode\slashChar=\active
+}
+{
+ \urefcatcodes
+ %
+ \global\def\urefcode{\begingroup
+ \setupmarkupstyle{code}%
+ \urefcatcodes
+ \let&\urefcodeamp
+ \let.\urefcodedot
+ \let#\urefcodehash
+ \let?\urefcodequest
+ \let/\urefcodeslash
+ \codex
+ }
+ %
+ % By default, they are just regular characters.
+ \global\def&{\normalamp}
+ \global\def.{\normaldot}
+ \global\def#{\normalhash}
+ \global\def?{\normalquest}
+ \global\def/{\normalslash}
+}
+
+% we put a little stretch before and after the breakable chars, to help
+% line breaking of long url's. The unequal skips make look better in
+% cmtt at least, especially for dots.
+\def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
+\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
+%
+\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
+\def\urefcodedot{\urefprestretch .\urefpoststretch}
+\def\urefcodehash{\urefprestretch \#\urefpoststretch}
+\def\urefcodequest{\urefprestretch ?\urefpoststretch}
+\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
+{
+ \catcode`\/=\active
+ \global\def\urefcodeslashfinish{%
+ \urefprestretch \slashChar
+ % Allow line break only after the final / in a sequence of
+ % slashes, to avoid line break between the slashes in http://.
+ \ifx\next/\else \urefpoststretch \fi
+ }
+}
+
+% One more complication: by default we'll break after the special
+% characters, but some people like to break before the special chars, so
+% allow that. Also allow no breaking at all, for manual control.
+%
+\parseargdef\urefbreakstyle{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\wordnone
+ \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
+ \else\ifx\txiarg\wordbefore
+ \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
+ \else\ifx\txiarg\wordafter
+ \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
+ \fi\fi\fi
+}
+\def\wordafter{after}
+\def\wordbefore{before}
+\def\wordnone{none}
+
+\urefbreakstyle after
+
% @url synonym for @uref, since that's how everyone uses it.
%
\let\url=\uref
@@ -2784,6 +2694,67 @@ end
\let\email=\uref
\fi
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\parseargdef\kbdinputstyle{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\txiarg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\txiarg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is `distinct'.
+\kbdinputstyle distinct
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
+
+\def\xkey{\key}
+\def\kbdsub#1#2#3\par{%
+ \def\one{#1}\def\three{#3}\def\threex{??}%
+ \ifx\one\xkey\ifx\threex\three \key{#2}%
+ \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+ \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+}
+
+% definition of @key that produces a lozenge. Doesn't adjust to text size.
+%\setfont\keyrm\rmshape{8}{1000}{OT1}
+%\font\keysy=cmsy9
+%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+% \vbox{\hrule\kern-0.4pt
+% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+% \kern-0.4pt\hrule}%
+% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+
+% definition of @key with no lozenge. If the current font is already
+% monospace, don't change it; that way, we respect @kbdinputstyle. But
+% if it isn't monospace, then use \tt.
+%
+\def\key#1{{\setupmarkupstyle{key}%
+ \nohyphenation
+ \ifmonospace\else\tt\fi
+ #1}\null}
+
+% @clicksequence{File @click{} Open ...}
+\def\clicksequence#1{\begingroup #1\endgroup}
+
+% @clickstyle @arrow (by default)
+\parseargdef\clickstyle{\def\click{#1}}
+\def\click{\arrow}
+
% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
%
@@ -2805,6 +2776,7 @@ end
\ifx\temp\empty \else
\space ({\unsepspaces \ignorespaces \temp \unskip})%
\fi
+ \null % reset \spacefactor=1000
}
% @abbr for "Comput. J." and the like.
@@ -2817,10 +2789,222 @@ end
\ifx\temp\empty \else
\space ({\unsepspaces \ignorespaces \temp \unskip})%
\fi
+ \null % reset \spacefactor=1000
+}
+
+% @asis just yields its argument. Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math outputs its argument in math mode.
+%
+% One complication: _ usually means subscripts, but it could also mean
+% an actual _ character, as in @math{@var{some_variable} + 1}. So make
+% _ active, and distinguish by seeing if the current family is \slfam,
+% which is what @var uses.
+{
+ \catcode`\_ = \active
+ \gdef\mathunderscore{%
+ \catcode`\_=\active
+ \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+ }
+}
+% Another complication: we want \\ (and @\) to output a math (or tt) \.
+% FYI, plain.tex uses \\ as a temporary control sequence (for no
+% particular reason), but this is not advertised and we don't care.
+%
+% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
+\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
+%
+\def\math{%
+ \tex
+ \mathunderscore
+ \let\\ = \mathbackslash
+ \mathactive
+ % make the texinfo accent commands work in math mode
+ \let\"=\ddot
+ \let\'=\acute
+ \let\==\bar
+ \let\^=\hat
+ \let\`=\grave
+ \let\u=\breve
+ \let\v=\check
+ \let\~=\tilde
+ \let\dotaccent=\dot
+ $\finishmath
+}
+\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
+
+% Some active characters (such as <) are spaced differently in math.
+% We have to reset their definitions in case the @math was an argument
+% to a command which sets the catcodes (such as @item or @section).
+%
+{
+ \catcode`^ = \active
+ \catcode`< = \active
+ \catcode`> = \active
+ \catcode`+ = \active
+ \catcode`' = \active
+ \gdef\mathactive{%
+ \let^ = \ptexhat
+ \let< = \ptexless
+ \let> = \ptexgtr
+ \let+ = \ptexplus
+ \let' = \ptexquoteright
+ }
+}
+
+% ctrl is no longer a Texinfo command, but leave this definition for fun.
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
+% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
+% except specified as a normal braced arg, so no newlines to worry about.
+%
+\def\outfmtnametex{tex}
+%
+\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
+\long\def\doinlinefmt#1,#2,\finish{%
+ \def\inlinefmtname{#1}%
+ \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
+}
+% For raw, must switch into @tex before parsing the argument, to avoid
+% setting catcodes prematurely. Doing it this way means that, for
+% example, @inlineraw{html, foo{bar} gets a parse error instead of being
+% ignored. But this isn't important because if people want a literal
+% *right* brace they would have to use a command anyway, so they may as
+% well use a command to get a left brace too. We could re-use the
+% delimiter character idea from \verb, but it seems like overkill.
+%
+\long\def\inlineraw{\tex \doinlineraw}
+\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
+\def\doinlinerawtwo#1,#2,\finish{%
+ \def\inlinerawname{#1}%
+ \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
+ \endgroup % close group opened by \tex.
}
\message{glyphs,}
+% and logos.
+
+% @@ prints an @, as does @atchar{}.
+\def\@{\char64 }
+\let\atchar=\@
+
+% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
+% Unless we're in typewriter, use \ecfont because the CM text fonts do
+% not have braces, and we don't want to switch into math.
+\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
+\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
+\let\{=\mylbrace \let\lbracechar=\{
+\let\}=\myrbrace \let\rbracechar=\}
+\begingroup
+ % Definitions to produce \{ and \} commands for indices,
+ % and @{ and @} for the aux/toc files.
+ \catcode`\{ = \other \catcode`\} = \other
+ \catcode`\[ = 1 \catcode`\] = 2
+ \catcode`\! = 0 \catcode`\\ = \other
+ !gdef!lbracecmd[\{]%
+ !gdef!rbracecmd[\}]%
+ !gdef!lbraceatcmd[@{]%
+ !gdef!rbraceatcmd[@}]%
+!endgroup
+
+% @comma{} to avoid , parsing problems.
+\let\comma = ,
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
+\let\, = \ptexc
+\let\dotaccent = \ptexdot
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \ptext
+\let\ubaraccent = \ptexb
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown @ordf @ordm
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+ \def\temp{#1}%
+ \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
+ \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
+ \else \errmessage{@dotless can be used only with i or j}%
+ \fi\fi
+}
+
+% The \TeX{} logo, as in plain, but resetting the spacing so that a
+% period following counts as ending a sentence. (Idea found in latex.)
+%
+\edef\TeX{\TeX \spacefactor=1000 }
+
+% @LaTeX{} logo. Not quite the same results as the definition in
+% latex.ltx, since we use a different font for the raised A; it's most
+% convenient for us to use an explicitly smaller font, rather than using
+% the \scriptstyle font (since we don't reset \scriptstyle and
+% \scriptscriptstyle).
+%
+\def\LaTeX{%
+ L\kern-.36em
+ {\setbox0=\hbox{T}%
+ \vbox to \ht0{\hbox{%
+ \ifx\textnominalsize\xwordpt
+ % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
+ % Revert to plain's \scriptsize, which is 7pt.
+ \count255=\the\fam $\fam\count255 \scriptstyle A$%
+ \else
+ % For 11pt, we can use our lllsize.
+ \selectfonts\lllsize A%
+ \fi
+ }%
+ \vss
+ }}%
+ \kern-.15em
+ \TeX
+}
+
+% Some math mode symbols.
+\def\bullet{$\ptexbullet$}
+\def\geq{\ifmmode \ge\else $\ge$\fi}
+\def\leq{\ifmmode \le\else $\le$\fi}
+\def\minus{\ifmmode -\else $-$\fi}
+
+% @dots{} outputs an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in the cm
+% typewriter fonts as three actual period characters; on the other hand,
+% in other typewriter fonts three periods are wider than 1.5em. So do
+% whichever is larger.
+%
+\def\dots{%
+ \leavevmode
+ \setbox0=\hbox{...}% get width of three periods
+ \ifdim\wd0 > 1.5em
+ \dimen0 = \wd0
+ \else
+ \dimen0 = 1.5em
+ \fi
+ \hbox to \dimen0{%
+ \hskip 0pt plus.25fil
+ .\hskip 0pt plus1fil
+ .\hskip 0pt plus1fil
+ .\hskip 0pt plus.5fil
+ }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \dots
+ \spacefactor=\endofsentencespacefactor
+}
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
%
@@ -2842,7 +3026,7 @@ end
{\tentt \global\dimen0 = 3em}% Width of the box.
\dimen2 = .55pt % Thickness of rules
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
-\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
+\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
%
\setbox\errorbox=\hbox to \dimen0{\hfil
\hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
@@ -2963,12 +3147,17 @@ end
% hopefully nobody will notice/care.
\edef\ecsize{\csname\curfontsize ecsize\endcsname}%
\edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
- \ifx\curfontstyle\bfstylename
- % bold:
- \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
+ \ifmonospace
+ % typewriter:
+ \font\thisecfont = ectt\ecsize \space at \nominalsize
\else
- % regular:
- \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
+ \ifx\curfontstyle\bfstylename
+ % bold:
+ \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
+ \else
+ % regular:
+ \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
+ \fi
\fi
\thisecfont
}
@@ -2991,7 +3180,7 @@ end
% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
% so we'll define it if necessary.
%
-\ifx\Orb\undefined
+\ifx\Orb\thisisundefined
\def\Orb{\mathhexbox20D}
\fi
@@ -3019,8 +3208,9 @@ end
\newif\ifsetshortcontentsaftertitlepage
\let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
-\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
- \endgroup\page\hbox{}\page}
+\parseargdef\shorttitlepage{%
+ \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}
\envdef\titlepage{%
% Open one extra group, as we want to close it in the middle of \Etitlepage.
@@ -3080,14 +3270,28 @@ end
\finishedtitlepagetrue
}
-%%% Macros to be used within @titlepage:
+% Settings used for typesetting titles: no hyphenation, no indentation,
+% don't worry much about spacing, ragged right. This should be used
+% inside a \vbox, and fonts need to be set appropriately first. Because
+% it is always used for titles, nothing else, we call \rmisbold. \par
+% should be specified before the end of the \vbox, since a vbox is a group.
+%
+\def\raggedtitlesettings{%
+ \rmisbold
+ \hyphenpenalty=10000
+ \parindent=0pt
+ \tolerance=5000
+ \ptexraggedright
+}
+
+% Macros to be used within @titlepage:
\let\subtitlerm=\tenrm
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
\parseargdef\title{%
\checkenv\titlepage
- \leftline{\titlefonts\rmisbold #1}
+ \vbox{\titlefonts \raggedtitlesettings #1\par}%
% print a rule at the page bottom also.
\finishedtitlepagefalse
\vskip4pt \hrule height 4pt width \hsize \vskip4pt
@@ -3113,7 +3317,7 @@ end
}
-%%% Set up page headings and footings.
+% Set up page headings and footings.
\let\thispage=\folio
@@ -3207,10 +3411,14 @@ end
\def\headings #1 {\csname HEADINGS#1\endcsname}
-\def\HEADINGSoff{%
-\global\evenheadline={\hfil} \global\evenfootline={\hfil}
-\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
-\HEADINGSoff
+\def\headingsoff{% non-global headings elimination
+ \evenheadline={\hfil}\evenfootline={\hfil}%
+ \oddheadline={\hfil}\oddfootline={\hfil}%
+}
+
+\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
+\HEADINGSoff % it's the default
+
% When we turn headings on, set the page number to 1.
% For double-sided printing, put current file name in lower left corner,
% chapter name on inside top of right hand pages, document
@@ -3261,7 +3469,7 @@ end
% This produces Day Month Year style of output.
% Only define if not already defined, in case a txi-??.tex file has set
% up a different format (e.g., txi-cs.tex does this).
-\ifx\today\undefined
+\ifx\today\thisisundefined
\def\today{%
\number\day\space
\ifcase\month
@@ -3322,7 +3530,7 @@ end
\begingroup
\advance\leftskip by-\tableindent
\advance\hsize by\tableindent
- \advance\rightskip by0pt plus1fil
+ \advance\rightskip by0pt plus1fil\relax
\leavevmode\unhbox0\par
\endgroup
%
@@ -3808,18 +4016,18 @@ end
\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
\global\advance\multitablelinespace by-\ht0
\fi
-%% Test to see if parskip is larger than space between lines of
-%% table. If not, do nothing.
-%% If so, set to same dimension as multitablelinespace.
+% Test to see if parskip is larger than space between lines of
+% table. If not, do nothing.
+% If so, set to same dimension as multitablelinespace.
\ifdim\multitableparskip>\multitablelinespace
\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
- %% than skip between lines in the table.
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+ % than skip between lines in the table.
\fi%
\ifdim\multitableparskip=0pt
\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
- %% than skip between lines in the table.
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+ % than skip between lines in the table.
\fi}
@@ -3980,7 +4188,7 @@ end
% ..., but we might end up with active ones in the argument if
% we're called from @code, as @code{@value{foo-bar_}}, though.
% So \let them to their normal equivalents.
- \let-\realdash \let_\normalunderscore
+ \let-\normaldash \let_\normalunderscore
}
}
@@ -4020,7 +4228,7 @@ end
}
\def\ifsetfail{\doignore{ifset}}
-% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% @ifclear VAR ... @end executes the `...' iff VAR has never been
% defined with @set, or has been undefined with @clear.
%
% The `\else' inside the `\doifset' parameter is a trick to reuse the
@@ -4031,6 +4239,35 @@ end
\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
\def\ifclearfail{\doignore{ifclear}}
+% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
+% without the @) is in fact defined. We can only feasibly check at the
+% TeX level, so something like `mathcode' is going to considered
+% defined even though it is not a Texinfo command.
+%
+\makecond{ifcommanddefined}
+\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
+%
+\def\doifcmddefined#1#2{{%
+ \makevalueexpandable
+ \let\next=\empty
+ \expandafter\ifx\csname #2\endcsname\relax
+ #1% If not defined, \let\next as above.
+ \fi
+ \expandafter
+ }\next
+}
+\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
+
+% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
+\makecond{ifcommandnotdefined}
+\def\ifcommandnotdefined{%
+ \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
+\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
+
+% Set the `txicommandconditionals' variable, so documents have a way to
+% test if the @ifcommand...defined conditionals are available.
+\set txicommandconditionals
+
% @dircategory CATEGORY -- specify a category of the dir file
% which this file should belong to. Ignore this in TeX.
\let\dircategory=\comment
@@ -4134,11 +4371,14 @@ end
\def\@{@}% change to @@ when we switch to @ as escape char in index files.
\def\ {\realbackslash\space }%
%
- % Need these in case \tex is in effect and \{ is a \delimiter again.
- % But can't use \lbracecmd and \rbracecmd because texindex assumes
- % braces and backslashes are used only as delimiters.
- \let\{ = \mylbrace
- \let\} = \myrbrace
+ % Need these unexpandable (because we define \tt as a dummy)
+ % definitions when @{ or @} appear in index entry text. Also, more
+ % complicated, when \tex is in effect and \{ is a \delimiter again.
+ % We can't use \lbracecmd and \rbracecmd because texindex assumes
+ % braces and backslashes are used only as delimiters. Perhaps we
+ % should define @lbrace and @rbrace commands a la @comma.
+ \def\{{{\tt\char123}}%
+ \def\}{{\tt\char125}}%
%
% I don't entirely understand this, but when an index entry is
% generated from a macro call, the \endinput which \scanmacro inserts
@@ -4191,7 +4431,7 @@ end
\def\commondummies{%
%
% \definedummyword defines \#1 as \string\#1\space, thus effectively
- % preventing its expansion. This is used only for control% words,
+ % preventing its expansion. This is used only for control words,
% not control letters, because the \space would be incorrect for
% control characters, but is needed to separate the control word
% from whatever follows.
@@ -4210,6 +4450,7 @@ end
\commondummiesnofonts
%
\definedummyletter\_%
+ \definedummyletter\-%
%
% Non-English letters.
\definedummyword\AA
@@ -4246,20 +4487,25 @@ end
\definedummyword\TeX
%
% Assorted special characters.
+ \definedummyword\arrow
\definedummyword\bullet
\definedummyword\comma
\definedummyword\copyright
\definedummyword\registeredsymbol
\definedummyword\dots
\definedummyword\enddots
+ \definedummyword\entrybreak
\definedummyword\equiv
\definedummyword\error
\definedummyword\euro
+ \definedummyword\expansion
+ \definedummyword\geq
\definedummyword\guillemetleft
\definedummyword\guillemetright
\definedummyword\guilsinglleft
\definedummyword\guilsinglright
- \definedummyword\expansion
+ \definedummyword\lbracechar
+ \definedummyword\leq
\definedummyword\minus
\definedummyword\ogonek
\definedummyword\pounds
@@ -4271,6 +4517,7 @@ end
\definedummyword\quoteleft
\definedummyword\quoteright
\definedummyword\quotesinglbase
+ \definedummyword\rbracechar
\definedummyword\result
\definedummyword\textdegree
%
@@ -4316,19 +4563,27 @@ end
\definedummyword\b
\definedummyword\i
\definedummyword\r
+ \definedummyword\sansserif
\definedummyword\sc
+ \definedummyword\slanted
\definedummyword\t
%
% Commands that take arguments.
+ \definedummyword\abbr
\definedummyword\acronym
+ \definedummyword\anchor
\definedummyword\cite
\definedummyword\code
\definedummyword\command
\definedummyword\dfn
+ \definedummyword\dmn
\definedummyword\email
\definedummyword\emph
\definedummyword\env
\definedummyword\file
+ \definedummyword\image
+ \definedummyword\indicateurl
+ \definedummyword\inforef
\definedummyword\kbd
\definedummyword\key
\definedummyword\math
@@ -4356,7 +4611,7 @@ end
\def\definedummyaccent##1{\let##1\asis}%
% We can just ignore other control letters.
\def\definedummyletter##1{\let##1\empty}%
- % Hopefully, all control words can become @asis.
+ % All control words become @asis by default; overrides below.
\let\definedummyword\definedummyaccent
%
\commondummiesnofonts
@@ -4368,8 +4623,17 @@ end
%
\def\ { }%
\def\@{@}%
- % how to handle braces?
\def\_{\normalunderscore}%
+ \def\-{}% @- shouldn't affect sorting
+ %
+ % Unfortunately, texindex is not prepared to handle braces in the
+ % content at all. So for index sorting, we map @{ and @} to strings
+ % starting with |, since that ASCII character is between ASCII { and }.
+ \def\{{|a}%
+ \def\lbracechar{|a}%
+ %
+ \def\}{|b}%
+ \def\rbracechar{|b}%
%
% Non-English letters.
\def\AA{AA}%
@@ -4397,6 +4661,7 @@ end
%
% Assorted special characters.
% (The following {} will end up in the sort string, but that's ok.)
+ \def\arrow{->}%
\def\bullet{bullet}%
\def\comma{,}%
\def\copyright{copyright}%
@@ -4406,10 +4671,12 @@ end
\def\error{error}%
\def\euro{euro}%
\def\expansion{==>}%
+ \def\geq{>=}%
\def\guillemetleft{<<}%
\def\guillemetright{>>}%
\def\guilsinglleft{<}%
\def\guilsinglright{>}%
+ \def\leq{<=}%
\def\minus{-}%
\def\point{.}%
\def\pounds{pounds}%
@@ -4424,6 +4691,9 @@ end
\def\result{=>}%
\def\textdegree{o}%
%
+ \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
+ \else \indexlquoteignore \fi
+ %
% We need to get rid of all macros, leaving only the arguments (if present).
% Of course this is not nearly correct, but it is the best we can do for now.
% makeinfo does not expand macros in the argument to @deffn, which ends up
@@ -4437,6 +4707,11 @@ end
\macrolist
}
+% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
+% ignore left quotes in the sort term.
+{\catcode`\`=\active
+ \gdef\indexlquoteignore{\let`=\empty}}
+
\let\indexbackslash=0 %overridden during \printindex.
\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
@@ -4534,10 +4809,9 @@ end
%
% ..., ready, GO:
%
-\def\safewhatsit#1{%
-\ifhmode
+\def\safewhatsit#1{\ifhmode
#1%
-\else
+ \else
% \lastskip and \lastpenalty cannot both be nonzero simultaneously.
\whatsitskip = \lastskip
\edef\lastskipmacro{\the\lastskip}%
@@ -4561,7 +4835,6 @@ end
% to re-insert the same penalty (values >10000 are used for various
% signals); since we just inserted a non-discardable item, any
% following glue (such as a \parskip) would be a breakpoint. For example:
- %
% @deffn deffn-whatever
% @vindex index-whatever
% Description.
@@ -4574,8 +4847,7 @@ end
% (the whatsit from the \write), so we must insert a \nobreak.
\nobreak\vskip\whatsitskip
\fi
-\fi
-}
+\fi}
% The index entry written in the file actually looks like
% \entry {sortstring}{page}{topic}
@@ -4694,7 +4966,6 @@ end
% But this freezes the catcodes in the argument, and can cause problems to
% @code, which sets - active. This problem was fixed by a kludge---
% ``-'' was active throughout whole index, but this isn't really right.
-%
% The right solution is to prevent \entry from swallowing the whole text.
% --kasal, 21nov03
\def\entry{%
@@ -4731,10 +5002,17 @@ end
% columns.
\vskip 0pt plus1pt
%
+ % When reading the text of entry, convert explicit line breaks
+ % from @* into spaces. The user might give these in long section
+ % titles, for instance.
+ \def\*{\unskip\space\ignorespaces}%
+ \def\entrybreak{\hfil\break}%
+ %
% Swallow the left brace of the text (first parameter):
\afterassignment\doentry
\let\temp =
}
+\def\entrybreak{\unskip\space\ignorespaces}%
\def\doentry{%
\bgroup % Instead of the swallowed brace.
\noindent
@@ -4967,7 +5245,22 @@ end
\message{sectioning,}
% Chapters, sections, etc.
-% \unnumberedno is an oxymoron, of course. But we count the unnumbered
+% Let's start with @part.
+\outer\parseargdef\part{\partzzz{#1}}
+\def\partzzz#1{%
+ \chapoddpage
+ \null
+ \vskip.3\vsize % move it down on the page a bit
+ \begingroup
+ \noindent \titlefonts\rmisbold #1\par % the text
+ \let\lastnode=\empty % no node to associate with
+ \writetocentry{part}{#1}{}% but put it in the toc
+ \headingsoff % no headline or footline on the part page
+ \chapoddpage
+ \endgroup
+}
+
+% \unnumberedno is an oxymoron. But we count the unnumbered
% sections so that we can refer to them unambiguously in the pdf
% outlines by their "section number". We avoid collisions with chapter
% numbers by starting them at 10000. (If a document ever has 10000
@@ -5046,8 +5339,8 @@ end
\chardef\maxseclevel = 3
%
% A numbered section within an unnumbered changes to unnumbered too.
-% To achive this, remember the "biggest" unnum. sec. we are currently in:
-\chardef\unmlevel = \maxseclevel
+% To achieve this, remember the "biggest" unnum. sec. we are currently in:
+\chardef\unnlevel = \maxseclevel
%
% Trace whether the current chapter is an appendix or not:
% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
@@ -5072,8 +5365,8 @@ end
% The heading type:
\def\headtype{#1}%
\if \headtype U%
- \ifnum \absseclevel < \unmlevel
- \chardef\unmlevel = \absseclevel
+ \ifnum \absseclevel < \unnlevel
+ \chardef\unnlevel = \absseclevel
\fi
\else
% Check for appendix sections:
@@ -5085,10 +5378,10 @@ end
\fi\fi
\fi
% Check for numbered within unnumbered:
- \ifnum \absseclevel > \unmlevel
+ \ifnum \absseclevel > \unnlevel
\def\headtype{U}%
\else
- \chardef\unmlevel = 3
+ \chardef\unnlevel = 3
\fi
\fi
% Now print the heading:
@@ -5174,7 +5467,8 @@ end
\global\let\subsubsection = \appendixsubsubsec
}
-\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+% normally unnmhead0 calls unnumberedzzz:
+\outer\parseargdef\unnumbered{\unnmhead0{#1}}
\def\unnumberedzzz#1{%
\global\secno=0 \global\subsecno=0 \global\subsubsecno=0
\global\advance\unnumberedno by 1
@@ -5218,40 +5512,47 @@ end
\let\top\unnumbered
% Sections.
+%
\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
\def\seczzz#1{%
\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
\sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
}
-\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz
+% normally calls appendixsectionzzz:
+\outer\parseargdef\appendixsection{\apphead1{#1}}
\def\appendixsectionzzz#1{%
\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
\sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
}
\let\appendixsec\appendixsection
-\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz
+% normally calls unnumberedseczzz:
+\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
\def\unnumberedseczzz#1{%
\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
\sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
}
% Subsections.
-\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
+%
+% normally calls numberedsubseczzz:
+\outer\parseargdef\numberedsubsec{\numhead2{#1}}
\def\numberedsubseczzz#1{%
\global\subsubsecno=0 \global\advance\subsecno by 1
\sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
}
-\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz
+% normally calls appendixsubseczzz:
+\outer\parseargdef\appendixsubsec{\apphead2{#1}}
\def\appendixsubseczzz#1{%
\global\subsubsecno=0 \global\advance\subsecno by 1
\sectionheading{#1}{subsec}{Yappendix}%
{\appendixletter.\the\secno.\the\subsecno}%
}
-\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+% normally calls unnumberedsubseczzz:
+\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
\def\unnumberedsubseczzz#1{%
\global\subsubsecno=0 \global\advance\subsecno by 1
\sectionheading{#1}{subsec}{Ynothing}%
@@ -5259,21 +5560,25 @@ end
}
% Subsubsections.
-\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz
+%
+% normally numberedsubsubseczzz:
+\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
\def\numberedsubsubseczzz#1{%
\global\advance\subsubsecno by 1
\sectionheading{#1}{subsubsec}{Ynumbered}%
{\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
}
-\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz
+% normally appendixsubsubseczzz:
+\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
\def\appendixsubsubseczzz#1{%
\global\advance\subsubsecno by 1
\sectionheading{#1}{subsubsec}{Yappendix}%
{\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
}
-\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+% normally unnumberedsubsubseczzz:
+\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
\def\unnumberedsubsubseczzz#1{%
\global\advance\subsubsecno by 1
\sectionheading{#1}{subsubsec}{Ynothing}%
@@ -5289,14 +5594,6 @@ end
% Define @majorheading, @heading and @subheading
-% NOTE on use of \vbox for chapter headings, section headings, and such:
-% 1) We use \vbox rather than the earlier \line to permit
-% overlong headings to fold.
-% 2) \hyphenpenalty is set to 10000 because hyphenation in a
-% heading is obnoxious; this forbids it.
-% 3) Likewise, headings look best if no \parindent is used, and
-% if justification is not attempted. Hence \raggedright.
-
\def\majorheading{%
{\advance\chapheadingskip by 10pt \chapbreak }%
\parsearg\chapheadingzzz
@@ -5304,10 +5601,8 @@ end
\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
\def\chapheadingzzz#1{%
- {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\ptexraggedright
- \rmisbold #1\hfill}}%
- \bigskip \par\penalty 200\relax
+ \vbox{\chapfonts \raggedtitlesettings #1\par}%
+ \nobreak\bigskip \nobreak
\suppressfirstparagraphindent
}
@@ -5323,14 +5618,13 @@ end
% (including whitespace, linebreaking, etc. around it),
% given all the information in convenient, parsed form.
-%%% Args are the skip and penalty (usually negative)
+% Args are the skip and penalty (usually negative)
\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
-%%% Define plain chapter starts, and page on/off switching for it
% Parameter controlling skip before chapter headings (if needed)
-
\newskip\chapheadingskip
+% Define plain chapter starts, and page on/off switching for it.
\def\chapbreak{\dobreak \chapheadingskip {-4000}}
\def\chappager{\par\vfill\supereject}
% Because \domark is called before \chapoddpage, the filler page will
@@ -5340,9 +5634,8 @@ end
\chappager
\ifodd\pageno \else
\begingroup
- \evenheadline={\hfil}\evenfootline={\hfil}%
- \oddheadline={\hfil}\oddfootline={\hfil}%
- \hbox to 0pt{}%
+ \headingsoff
+ \null
\chappager
\endgroup
\fi
@@ -5468,8 +5761,7 @@ end
%
% Typeset the actual heading.
\nobreak % Avoid page breaks at the interline glue.
- \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
- \hangindent=\wd0 \centerparametersmaybe
+ \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
\unhbox0 #1\par}%
}%
\nobreak\bigskip % no page break after a chapter title
@@ -5491,18 +5783,18 @@ end
\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
%
\def\unnchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\ptexraggedright
- \rmisbold #1\hfill}}\bigskip \par\nobreak
+ \chapoddpage
+ \vbox{\chapfonts \raggedtitlesettings #1\par}%
+ \nobreak\bigskip\nobreak
}
\def\chfopen #1#2{\chapoddpage {\chapfonts
\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
\par\penalty 5000 %
}
\def\centerchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt
- \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
+ \chapoddpage
+ \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
+ \nobreak\bigskip \nobreak
}
\def\CHAPFopen{%
\global\let\chapmacro=\chfopen
@@ -5534,6 +5826,8 @@ end
%
\def\sectionheading#1#2#3#4{%
{%
+ \checkenv{}% should not be in an environment.
+ %
% Switch to the right set of fonts.
\csname #2fonts\endcsname \rmisbold
%
@@ -5645,15 +5939,15 @@ end
%
% We'll almost certainly start a paragraph next, so don't let that
% glue accumulate. (Not a breakpoint because it's preceded by a
- % discardable item.)
+ % discardable item.) However, when a paragraph is not started next
+ % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
+ % or the negative glue will cause weirdly wrong output, typically
+ % obscuring the section heading with something else.
\vskip-\parskip
%
- % This is purely so the last item on the list is a known \penalty >
- % 10000. This is so \startdefun can avoid allowing breakpoints after
- % section headings. Otherwise, it would insert a valid breakpoint between:
- %
- % @section sec-whatever
- % @deffn def-whatever
+ % This is so the last item on the main vertical list is a known
+ % \penalty > 10000, so \startdefun, etc., can recognize the situation
+ % and do the needful.
\penalty 10001
}
@@ -5785,6 +6079,7 @@ end
\def\summarycontents{%
\startcontents{\putwordShortTOC}%
%
+ \let\partentry = \shortpartentry
\let\numchapentry = \shortchapentry
\let\appentry = \shortchapentry
\let\unnchapentry = \shortunnchapentry
@@ -5840,6 +6135,19 @@ end
% The last argument is the page number.
% The arguments in between are the chapter number, section number, ...
+% Parts, in the main contents. Replace the part number, which doesn't
+% exist, with an empty box. Let's hope all the numbers have the same width.
+% Also ignore the page number, which is conventionally not printed.
+\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
+\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
+%
+% Parts, in the short toc.
+\def\shortpartentry#1#2#3#4{%
+ \penalty-300
+ \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
+ \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
+}
+
% Chapters, in the main contents.
\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
%
@@ -5929,9 +6237,9 @@ end
\message{environments,}
% @foo ... @end foo.
-% @tex ... @end tex escapes into raw Tex temporarily.
+% @tex ... @end tex escapes into raw TeX temporarily.
% One exception: @ is still an escape character, so that @end tex works.
-% But \@ or @@ will get a plain tex @ character.
+% But \@ or @@ will get a plain @ character.
\envdef\tex{%
\setupmarkupstyle{tex}%
@@ -5948,6 +6256,10 @@ end
\catcode`\'=\other
\escapechar=`\\
%
+ % ' is active in math mode (mathcode"8000). So reset it, and all our
+ % other math active characters (just in case), to plain's definitions.
+ \mathactive
+ %
\let\b=\ptexb
\let\bullet=\ptexbullet
\let\c=\ptexc
@@ -6051,6 +6363,12 @@ end
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
% Flag to tell @lisp, etc., not to narrow margin.
\let\nonarrowing = t%
+ %
+ % If this cartouche directly follows a sectioning command, we need the
+ % \parskip glue (backspaced over by default) or the cartouche can
+ % collide with the section heading.
+ \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
+ %
\vbox\bgroup
\baselineskip=0pt\parskip=0pt\lineskip=0pt
\carttop
@@ -6064,7 +6382,7 @@ end
\lineskip=\normlskip
\parskip=\normpskip
\vskip -\parskip
- \comment % For explanation, see the end of \def\group.
+ \comment % For explanation, see the end of def\group.
}
\def\Ecartouche{%
\ifhmode\par\fi
@@ -6150,41 +6468,42 @@ end
}
% We often define two environments, @foo and @smallfoo.
-% Let's do it by one command:
-\def\makedispenv #1#2{
- \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
- \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
+% Let's do it in one command. #1 is the env name, #2 the definition.
+\def\makedispenvdef#1#2{%
+ \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
+ \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
\expandafter\let\csname E#1\endcsname \afterenvbreak
\expandafter\let\csname Esmall#1\endcsname \afterenvbreak
}
-% Define two synonyms:
-\def\maketwodispenvs #1#2#3{
- \makedispenv{#1}{#3}
- \makedispenv{#2}{#3}
+% Define two environment synonyms (#1 and #2) for an environment.
+\def\maketwodispenvdef#1#2#3{%
+ \makedispenvdef{#1}{#3}%
+ \makedispenvdef{#2}{#3}%
}
-
-% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
+%
+% @lisp: indented, narrowed, typewriter font;
+% @example: same as @lisp.
%
% @smallexample and @smalllisp: use smaller fonts.
% Originally contributed by Pavel@xerox.
%
-\maketwodispenvs {lisp}{example}{%
+\maketwodispenvdef{lisp}{example}{%
\nonfillstart
\tt\setupmarkupstyle{example}%
\let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
- \gobble % eat return
+ \gobble % eat return
}
% @display/@smalldisplay: same as @lisp except keep current font.
%
-\makedispenv {display}{%
+\makedispenvdef{display}{%
\nonfillstart
\gobble
}
% @format/@smallformat: same as @display except don't narrow margins.
%
-\makedispenv{format}{%
+\makedispenvdef{format}{%
\let\nonarrowing = t%
\nonfillstart
\gobble
@@ -6203,7 +6522,7 @@ end
\envdef\flushright{%
\let\nonarrowing = t%
\nonfillstart
- \advance\leftskip by 0pt plus 1fill
+ \advance\leftskip by 0pt plus 1fill\relax
\gobble
}
\let\Eflushright = \afterenvbreak
@@ -6238,43 +6557,28 @@ end
% we're doing normal filling. So, when using \aboveenvbreak and
% \afterenvbreak, temporarily make \parskip 0.
%
+\makedispenvdef{quotation}{\quotationstart}
+%
\def\quotationstart{%
- {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
- \parindent=0pt
- %
- % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \indentedblockstart % same as \indentedblock, but increase right margin too.
\ifx\nonarrowing\relax
- \advance\leftskip by \lispnarrowing
\advance\rightskip by \lispnarrowing
- \exdentamount = \lispnarrowing
- \else
- \let\nonarrowing = \relax
\fi
\parsearg\quotationlabel
}
-\envdef\quotation{%
- \setnormaldispenv
- \quotationstart
-}
-
-\envdef\smallquotation{%
- \setsmalldispenv
- \quotationstart
-}
-\let\Esmallquotation = \Equotation
-
% We have retained a nonzero parskip for the environment, since we're
% doing normal filling.
%
\def\Equotation{%
\par
- \ifx\quotationauthor\undefined\else
+ \ifx\quotationauthor\thisisundefined\else
% indent a bit.
\leftline{\kern 2\leftskip \sl ---\quotationauthor}%
\fi
{\parskip=0pt \afterenvbreak}%
}
+\def\Esmallquotation{\Equotation}
% If we're given an argument, typeset it in bold with a colon after.
\def\quotationlabel#1{%
@@ -6284,6 +6588,32 @@ end
\fi
}
+% @indentedblock is like @quotation, but indents only on the left and
+% has no optional argument.
+%
+\makedispenvdef{indentedblock}{\indentedblockstart}
+%
+\def\indentedblockstart{%
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \parindent=0pt
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+}
+
+% Keep a nonzero parskip for the environment, since we're doing normal filling.
+%
+\def\Eindentedblock{%
+ \par
+ {\parskip=0pt \afterenvbreak}%
+}
+\def\Esmallindentedblock{\Eindentedblock}
+
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
% If we want to allow any <char> as delimiter,
@@ -6331,21 +6661,28 @@ end
% Setup for the @verbatim environment
%
-% Real tab expansion
+% Real tab expansion.
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
%
-\def\starttabbox{\setbox0=\hbox\bgroup}
+% We typeset each line of the verbatim in an \hbox, so we can handle
+% tabs. The \global is in case the verbatim line starts with an accent,
+% or some other command that starts with a begin-group. Otherwise, the
+% entire \verbbox would disappear at the corresponding end-group, before
+% it is typeset. Meanwhile, we can't have nested verbatim commands
+% (can we?), so the \global won't be overwriting itself.
+\newbox\verbbox
+\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
%
\begingroup
\catcode`\^^I=\active
\gdef\tabexpand{%
\catcode`\^^I=\active
\def^^I{\leavevmode\egroup
- \dimen0=\wd0 % the width so far, or since the previous tab
- \divide\dimen0 by\tabw
- \multiply\dimen0 by\tabw % compute previous multiple of \tabw
- \advance\dimen0 by\tabw % advance to next multiple of \tabw
- \wd0=\dimen0 \box0 \starttabbox
+ \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
+ \divide\dimen\verbbox by\tabw
+ \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
+ \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
+ \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
}%
}
\endgroup
@@ -6354,15 +6691,16 @@ end
\def\setupverbatim{%
\let\nonarrowing = t%
\nonfillstart
- % Easiest (and conventionally used) font for verbatim
- \tt
- \def\par{\leavevmode\egroup\box0\endgraf}%
+ \tt % easiest (and conventionally used) font for verbatim
+ % The \leavevmode here is for blank lines. Otherwise, we would
+ % never \starttabox and the \egroup would end verbatim mode.
+ \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
\tabexpand
\setupmarkupstyle{verbatim}%
% Respect line breaks,
% print special symbols as themselves, and
- % make each space count
- % must do in this order:
+ % make each space count.
+ % Must do in this order:
\obeylines \uncatcodespecials \sepspaces
\everypar{\starttabbox}%
}
@@ -6419,6 +6757,7 @@ end
\makevalueexpandable
\setupverbatim
\indexnofonts % Allow `@@' and other weird things in file names.
+ \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
\input #1
\afterenvbreak
}%
@@ -6468,7 +6807,7 @@ end
% commands also insert a nobreak penalty, and we don't want to allow
% a break between a section heading and a defun.
%
- % As a minor refinement, we avoid "club" headers by signalling
+ % As a further refinement, we avoid "club" headers by signalling
% with penalty of 10003 after the very first @deffn in the
% sequence (see above), and penalty of 10002 after any following
% @def command.
@@ -6505,7 +6844,7 @@ end
#1#2 \endheader
% common ending:
\interlinepenalty = 10000
- \advance\rightskip by 0pt plus 1fil
+ \advance\rightskip by 0pt plus 1fil\relax
\endgraf
\nobreak\vskip -\parskip
\penalty\defunpenalty % signal to \startdefun and \dodefunx
@@ -6535,13 +6874,36 @@ end
\def\domakedefun#1#2#3{%
\envdef#1{%
\startdefun
+ \doingtypefnfalse % distinguish typed functions from all else
\parseargusing\activeparens{\printdefunline#3}%
}%
\def#2{\dodefunx#1}%
\def#3%
}
-%%% Untyped functions:
+\newif\ifdoingtypefn % doing typed function?
+\newif\ifrettypeownline % typeset return type on its own line?
+
+% @deftypefnnewline on|off says whether the return type of typed functions
+% are printed on their own line. This affects @deftypefn, @deftypefun,
+% @deftypeop, and @deftypemethod.
+%
+\parseargdef\deftypefnnewline{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETtxideftypefnnl\endcsname
+ = \empty
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETtxideftypefnnl\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @txideftypefnnl value `\temp',
+ must be on|off}%
+ \fi\fi
+}
+
+% Untyped functions:
% @deffn category name args
\makedefun{deffn}{\deffngeneral{}}
@@ -6560,7 +6922,7 @@ end
\defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
}
-%%% Typed functions:
+% Typed functions:
% @deftypefn category type name args
\makedefun{deftypefn}{\deftypefngeneral{}}
@@ -6575,10 +6937,11 @@ end
%
\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
\dosubind{fn}{\code{#4}}{#1}%
+ \doingtypefntrue
\defname{#2}{#3}{#4}\defunargs{#5\unskip}%
}
-%%% Typed variables:
+% Typed variables:
% @deftypevr category type var args
\makedefun{deftypevr}{\deftypecvgeneral{}}
@@ -6596,7 +6959,7 @@ end
\defname{#2}{#3}{#4}\defunargs{#5\unskip}%
}
-%%% Untyped variables:
+% Untyped variables:
% @defvr category var args
\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
@@ -6607,7 +6970,8 @@ end
% \defcvof {category of}class var args
\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
-%%% Type:
+% Types:
+
% @deftp category name args
\makedefun{deftp}#1 #2 #3\endheader{%
\doind{tp}{\code{#2}}%
@@ -6635,25 +6999,49 @@ end
% We are followed by (but not passed) the arguments, if any.
%
\def\defname#1#2#3{%
+ \par
% Get the values of \leftskip and \rightskip as they were outside the @def...
\advance\leftskip by -\defbodyindent
%
- % How we'll format the type name. Putting it in brackets helps
+ % Determine if we are typesetting the return type of a typed function
+ % on a line by itself.
+ \rettypeownlinefalse
+ \ifdoingtypefn % doing a typed function specifically?
+ % then check user option for putting return type on its own line:
+ \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
+ \rettypeownlinetrue
+ \fi
+ \fi
+ %
+ % How we'll format the category name. Putting it in brackets helps
% distinguish it from the body text that may end up on the next line
% just below it.
\def\temp{#1}%
\setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
%
- % Figure out line sizes for the paragraph shape.
+ % Figure out line sizes for the paragraph shape. We'll always have at
+ % least two.
+ \tempnum = 2
+ %
% The first line needs space for \box0; but if \rightskip is nonzero,
% we need only space for the part of \box0 which exceeds it:
\dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
+ %
+ % If doing a return type on its own line, we'll have another line.
+ \ifrettypeownline
+ \advance\tempnum by 1
+ \def\maybeshapeline{0in \hsize}%
+ \else
+ \def\maybeshapeline{}%
+ \fi
+ %
% The continuations:
\dimen2=\hsize \advance\dimen2 by -\defargsindent
- % (plain.tex says that \dimen1 should be used only as global.)
- \parshape 2 0in \dimen0 \defargsindent \dimen2
%
- % Put the type name to the right margin.
+ % The final paragraph shape:
+ \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
+ %
+ % Put the category name at the right margin.
\noindent
\hbox to 0pt{%
\hfil\box0 \kern-\hsize
@@ -6675,8 +7063,16 @@ end
% . this still does not fix the ?` and !` ligatures, but so far no
% one has made identifiers using them :).
\df \tt
- \def\temp{#2}% return value type
- \ifx\temp\empty\else \tclose{\temp} \fi
+ \def\temp{#2}% text of the return type
+ \ifx\temp\empty\else
+ \tclose{\temp}% typeset the return type
+ \ifrettypeownline
+ % put return type on its own line; prohibit line break following:
+ \hfil\vadjust{\nobreak}\break
+ \else
+ \space % type on same line, so just followed by a space
+ \fi
+ \fi % no return type
#3% output function name
}%
{\rm\enskip}% hskip 0.5 em of \tenrm
@@ -6696,7 +7092,10 @@ end
\df \sl \hyphenchar\font=0
%
% On the other hand, if an argument has two dashes (for instance), we
- % want a way to get ttsl. Let's try @var for that.
+ % want a way to get ttsl. We used to recommend @var for that, so
+ % leave the code in, but it's strange for @var to lead to typewriter.
+ % Nowadays we recommend @code, since the difference between a ttsl hyphen
+ % and a tt hyphen is pretty tiny. @code also disables ?` !`.
\def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
#1%
\sl\hyphenchar\font=45
@@ -6794,7 +7193,7 @@ end
% To do this right we need a feature of e-TeX, \scantokens,
% which we arrange to emulate with a temporary file in ordinary TeX.
-\ifx\eTeXversion\undefined
+\ifx\eTeXversion\thisisundefined
\newwrite\macscribble
\def\scantokens#1{%
\toks0={#1}%
@@ -6805,25 +7204,30 @@ end
}
\fi
-\def\scanmacro#1{%
- \begingroup
- \newlinechar`\^^M
- \let\xeatspaces\eatspaces
- % Undo catcode changes of \startcontents and \doprintindex
- % When called from @insertcopying or (short)caption, we need active
- % backslash to get it printed correctly. Previously, we had
- % \catcode`\\=\other instead. We'll see whether a problem appears
- % with macro expansion. --kasal, 19aug04
- \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
- % ... and \example
- \spaceisspace
- %
- % Append \endinput to make sure that TeX does not see the ending newline.
- % I've verified that it is necessary both for e-TeX and for ordinary TeX
- % --kasal, 29nov03
- \scantokens{#1\endinput}%
- \endgroup
-}
+\def\scanmacro#1{\begingroup
+ \newlinechar`\^^M
+ \let\xeatspaces\eatspaces
+ %
+ % Undo catcode changes of \startcontents and \doprintindex
+ % When called from @insertcopying or (short)caption, we need active
+ % backslash to get it printed correctly. Previously, we had
+ % \catcode`\\=\other instead. We'll see whether a problem appears
+ % with macro expansion. --kasal, 19aug04
+ \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
+ %
+ % ... and for \example:
+ \spaceisspace
+ %
+ % The \empty here causes a following catcode 5 newline to be eaten as
+ % part of reading whitespace after a control sequence. It does not
+ % eat a catcode 13 newline. There's no good way to handle the two
+ % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
+ % would then have different behavior). See the Macro Details node in
+ % the manual for the workaround we recommend for macros and
+ % line-oriented commands.
+ %
+ \scantokens{#1\empty}%
+\endgroup}
\def\scanexp#1{%
\edef\temp{\noexpand\scanmacro{#1}}%
@@ -6877,17 +7281,18 @@ end
% Macro bodies are absorbed as an argument in a context where
% all characters are catcode 10, 11 or 12, except \ which is active
-% (as in normal texinfo). It is necessary to change the definition of \.
-
+% (as in normal texinfo). It is necessary to change the definition of \
+% to recognize macro arguments; this is the job of \mbodybackslash.
+%
% Non-ASCII encodings make 8-bit characters active, so un-activate
% them to avoid their expansion. Must do this non-globally, to
% confine the change to the current group.
-
+%
% It's necessary to have hard CRs when the macro is executed. This is
-% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
% body, and then making it the \newlinechar in \scanmacro.
-
-\def\scanctxt{%
+%
+\def\scanctxt{% used as subroutine
\catcode`\"=\other
\catcode`\+=\other
\catcode`\<=\other
@@ -6900,13 +7305,13 @@ end
\ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
}
-\def\scanargctxt{%
+\def\scanargctxt{% used for copying and captions, not macros.
\scanctxt
\catcode`\\=\other
\catcode`\^^M=\other
}
-\def\macrobodyctxt{%
+\def\macrobodyctxt{% used for @macro definitions
\scanctxt
\catcode`\{=\other
\catcode`\}=\other
@@ -6914,32 +7319,56 @@ end
\usembodybackslash
}
-\def\macroargctxt{%
+\def\macroargctxt{% used when scanning invocations
\scanctxt
- \catcode`\\=\other
+ \catcode`\\=0
}
+% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
+% for the single characters \ { }. Thus, we end up with the "commands"
+% that would be written @\ @{ @} in a Texinfo document.
+%
+% We already have @{ and @}. For @\, we define it here, and only for
+% this purpose, to produce a typewriter backslash (so, the @\ that we
+% define for @math can't be used with @macro calls):
+%
+\def\\{\normalbackslash}%
+%
+% We would like to do this for \, too, since that is what makeinfo does.
+% But it is not possible, because Texinfo already has a command @, for a
+% cedilla accent. Documents must use @comma{} instead.
+%
+% \anythingelse will almost certainly be an error of some kind.
+
% \mbodybackslash is the definition of \ in @macro bodies.
% It maps \foo\ => \csname macarg.foo\endcsname => #N
% where N is the macro parameter number.
% We define \csname macarg.\endcsname to be \realbackslash, so
% \\ in macro replacement text gets you a backslash.
-
+%
{\catcode`@=0 @catcode`@\=@active
@gdef@usembodybackslash{@let\=@mbodybackslash}
@gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
}
\expandafter\def\csname macarg.\endcsname{\realbackslash}
+\def\margbackslash#1{\char`\#1 }
+
\def\macro{\recursivefalse\parsearg\macroxxx}
\def\rmacro{\recursivetrue\parsearg\macroxxx}
\def\macroxxx#1{%
- \getargs{#1}% now \macname is the macname and \argl the arglist
+ \getargs{#1}% now \macname is the macname and \argl the arglist
\ifx\argl\empty % no arguments
- \paramno=0%
+ \paramno=0\relax
\else
\expandafter\parsemargdef \argl;%
+ \if\paramno>256\relax
+ \ifx\eTeXversion\thisisundefined
+ \errhelp = \EMsimple
+ \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
+ \fi
+ \fi
\fi
\if1\csname ismacro.\the\macname\endcsname
\message{Warning: redefining \the\macname}%
@@ -6986,46 +7415,269 @@ end
% an opening brace, and that opening brace is not consumed.
\def\getargs#1{\getargsxxx#1{}}
\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
-\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacname#1 #2\relax{\macname={#1}}
\def\getmacargs#1{\def\argl{#1}}
+% For macro processing make @ a letter so that we can make Texinfo private macro names.
+\edef\texiatcatcode{\the\catcode`\@}
+\catcode `@=11\relax
+
% Parse the optional {params} list. Set up \paramno and \paramlist
-% so \defmacro knows what to do. Define \macarg.blah for each blah
-% in the params list, to be ##N where N is the position in that list.
+% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
+% in the params list to some hook where the argument si to be expanded. If
+% there are less than 10 arguments that hook is to be replaced by ##N where N
+% is the position in that list, that is to say the macro arguments are to be
+% defined `a la TeX in the macro body.
+%
% That gets used by \mbodybackslash (above).
-
+%
% We need to get `macro parameter char #' into several definitions.
-% The technique used is stolen from LaTeX: let \hash be something
+% The technique used is stolen from LaTeX: let \hash be something
% unexpandable, insert that wherever you need a #, and then redefine
% it to # just before using the token list produced.
%
% The same technique is used to protect \eatspaces till just before
% the macro is used.
-
-\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
- \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+%
+% If there are 10 or more arguments, a different technique is used, where the
+% hook remains in the body, and when macro is to be expanded the body is
+% processed again to replace the arguments.
+%
+% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
+% argument N value and then \edef the body (nothing else will expand because of
+% the catcode regime underwhich the body was input).
+%
+% If you compile with TeX (not eTeX), and you have macros with 10 or more
+% arguments, you need that no macro has more than 256 arguments, otherwise an
+% error is produced.
+\def\parsemargdef#1;{%
+ \paramno=0\def\paramlist{}%
+ \let\hash\relax
+ \let\xeatspaces\relax
+ \parsemargdefxxx#1,;,%
+ % In case that there are 10 or more arguments we parse again the arguments
+ % list to set new definitions for the \macarg.BLAH macros corresponding to
+ % each BLAH argument. It was anyhow needed to parse already once this list
+ % in order to count the arguments, and as macros with at most 9 arguments
+ % are by far more frequent than macro with 10 or more arguments, defining
+ % twice the \macarg.BLAH macros does not cost too much processing power.
+ \ifnum\paramno<10\relax\else
+ \paramno0\relax
+ \parsemmanyargdef@@#1,;,% 10 or more arguments
+ \fi
+}
\def\parsemargdefxxx#1,{%
\if#1;\let\next=\relax
\else \let\next=\parsemargdefxxx
- \advance\paramno by 1%
+ \advance\paramno by 1
\expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
{\xeatspaces{\hash\the\paramno}}%
\edef\paramlist{\paramlist\hash\the\paramno,}%
\fi\next}
+\def\parsemmanyargdef@@#1,{%
+ \if#1;\let\next=\relax
+ \else
+ \let\next=\parsemmanyargdef@@
+ \edef\tempb{\eatspaces{#1}}%
+ \expandafter\def\expandafter\tempa
+ \expandafter{\csname macarg.\tempb\endcsname}%
+ % Note that we need some extra \noexpand\noexpand, this is because we
+ % don't want \the to be expanded in the \parsermacbody as it uses an
+ % \xdef .
+ \expandafter\edef\tempa
+ {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
+ \advance\paramno by 1\relax
+ \fi\next}
+
% These two commands read recursive and nonrecursive macro bodies.
% (They're different since rec and nonrec macros end differently.)
+%
+\catcode `\@\texiatcatcode
\long\def\parsemacbody#1@end macro%
{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
\long\def\parsermacbody#1@end rmacro%
{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\catcode `\@=11\relax
+
+\let\endargs@\relax
+\let\nil@\relax
+\def\nilm@{\nil@}%
+\long\def\nillm@{\nil@}%
+
+% This macro is expanded during the Texinfo macro expansion, not during its
+% definition. It gets all the arguments values and assigns them to macros
+% macarg.ARGNAME
+%
+% #1 is the macro name
+% #2 is the list of argument names
+% #3 is the list of argument values
+\def\getargvals@#1#2#3{%
+ \def\macargdeflist@{}%
+ \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
+ \def\paramlist{#2,\nil@}%
+ \def\macroname{#1}%
+ \begingroup
+ \macroargctxt
+ \def\argvaluelist{#3,\nil@}%
+ \def\@tempa{#3}%
+ \ifx\@tempa\empty
+ \setemptyargvalues@
+ \else
+ \getargvals@@
+ \fi
+}
-% This defines the macro itself. There are six cases: recursive and
-% nonrecursive macros of zero, one, and many arguments.
+%
+\def\getargvals@@{%
+ \ifx\paramlist\nilm@
+ % Some sanity check needed here that \argvaluelist is also empty.
+ \ifx\argvaluelist\nillm@
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Too many arguments in macro `\macroname'!}%
+ \fi
+ \let\next\macargexpandinbody@
+ \else
+ \ifx\argvaluelist\nillm@
+ % No more arguments values passed to macro. Set remaining named-arg
+ % macros to empty.
+ \let\next\setemptyargvalues@
+ \else
+ % pop current arg name into \@tempb
+ \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
+ \expandafter\@tempa\expandafter{\paramlist}%
+ % pop current argument value into \@tempc
+ \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
+ \expandafter\@tempa\expandafter{\argvaluelist}%
+ % Here \@tempb is the current arg name and \@tempc is the current arg value.
+ % First place the new argument macro definition into \@tempd
+ \expandafter\macname\expandafter{\@tempc}%
+ \expandafter\let\csname macarg.\@tempb\endcsname\relax
+ \expandafter\def\expandafter\@tempe\expandafter{%
+ \csname macarg.\@tempb\endcsname}%
+ \edef\@tempd{\long\def\@tempe{\the\macname}}%
+ \push@\@tempd\macargdeflist@
+ \let\next\getargvals@@
+ \fi
+ \fi
+ \next
+}
+
+\def\push@#1#2{%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter#2%
+ \expandafter\expandafter\expandafter{%
+ \expandafter#1#2}%
+}
+
+% Replace arguments by their values in the macro body, and place the result
+% in macro \@tempa
+\def\macvalstoargs@{%
+ % To do this we use the property that token registers that are \the'ed
+ % within an \edef expand only once. So we are going to place all argument
+ % values into respective token registers.
+ %
+ % First we save the token context, and initialize argument numbering.
+ \begingroup
+ \paramno0\relax
+ % Then, for each argument number #N, we place the corresponding argument
+ % value into a new token list register \toks#N
+ \expandafter\putargsintokens@\saveparamlist@,;,%
+ % Then, we expand the body so that argument are replaced by their
+ % values. The trick for values not to be expanded themselves is that they
+ % are within tokens and that tokens expand only once in an \edef .
+ \edef\@tempc{\csname mac.\macroname .body\endcsname}%
+ % Now we restore the token stack pointer to free the token list registers
+ % which we have used, but we make sure that expanded body is saved after
+ % group.
+ \expandafter
+ \endgroup
+ \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
+ }
+
+\def\macargexpandinbody@{%
+ %% Define the named-macro outside of this group and then close this group.
+ \expandafter
+ \endgroup
+ \macargdeflist@
+ % First the replace in body the macro arguments by their values, the result
+ % is in \@tempa .
+ \macvalstoargs@
+ % Then we point at the \norecurse or \gobble (for recursive) macro value
+ % with \@tempb .
+ \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
+ % Depending on whether it is recursive or not, we need some tailing
+ % \egroup .
+ \ifx\@tempb\gobble
+ \let\@tempc\relax
+ \else
+ \let\@tempc\egroup
+ \fi
+ % And now we do the real job:
+ \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
+ \@tempd
+}
+
+\def\putargsintokens@#1,{%
+ \if#1;\let\next\relax
+ \else
+ \let\next\putargsintokens@
+ % First we allocate the new token list register, and give it a temporary
+ % alias \@tempb .
+ \toksdef\@tempb\the\paramno
+ % Then we place the argument value into that token list register.
+ \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
+ \expandafter\@tempb\expandafter{\@tempa}%
+ \advance\paramno by 1\relax
+ \fi
+ \next
+}
+
+% Save the token stack pointer into macro #1
+\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
+% Restore the token stack pointer from number in macro #1
+\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
+% newtoks that can be used non \outer .
+\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
+
+% Tailing missing arguments are set to empty
+\def\setemptyargvalues@{%
+ \ifx\paramlist\nilm@
+ \let\next\macargexpandinbody@
+ \else
+ \expandafter\setemptyargvaluesparser@\paramlist\endargs@
+ \let\next\setemptyargvalues@
+ \fi
+ \next
+}
+
+\def\setemptyargvaluesparser@#1,#2\endargs@{%
+ \expandafter\def\expandafter\@tempa\expandafter{%
+ \expandafter\def\csname macarg.#1\endcsname{}}%
+ \push@\@tempa\macargdeflist@
+ \def\paramlist{#2}%
+}
+
+% #1 is the element target macro
+% #2 is the list macro
+% #3,#4\endargs@ is the list value
+\def\pop@#1#2#3,#4\endargs@{%
+ \def#1{#3}%
+ \def#2{#4}%
+}
+\long\def\longpop@#1#2#3,#4\endargs@{%
+ \long\def#1{#3}%
+ \long\def#2{#4}%
+}
+
+% This defines a Texinfo @macro. There are eight cases: recursive and
+% nonrecursive macros of zero, one, up to nine, and many arguments.
% Much magic with \expandafter here.
% \xdef is used so that macro definitions will survive the file
% they're defined in; @include reads the file inside a group.
+%
\def\defmacro{%
\let\hash=##% convert placeholders to macro parameter chars
\ifrecursive
@@ -7040,17 +7692,25 @@ end
\expandafter\noexpand\csname\the\macname xxx\endcsname}%
\expandafter\xdef\csname\the\macname xxx\endcsname##1{%
\egroup\noexpand\scanmacro{\temp}}%
- \else % many
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \noexpand\csname\the\macname xx\endcsname}%
- \expandafter\xdef\csname\the\macname xx\endcsname##1{%
- \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
- \expandafter\expandafter
- \expandafter\xdef
- \expandafter\expandafter
- \csname\the\macname xxx\endcsname
- \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \else
+ \ifnum\paramno<10\relax % at most 9
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \else % 10 or more
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\getargvals@{\the\macname}{\argl}%
+ }%
+ \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
+ \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
+ \fi
\fi
\else
\ifcase\paramno
@@ -7067,29 +7727,40 @@ end
\egroup
\noexpand\norecurse{\the\macname}%
\noexpand\scanmacro{\temp}\egroup}%
- \else % many
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \expandafter\noexpand\csname\the\macname xx\endcsname}%
- \expandafter\xdef\csname\the\macname xx\endcsname##1{%
- \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
- \expandafter\expandafter
- \expandafter\xdef
- \expandafter\expandafter
- \csname\the\macname xxx\endcsname
- \paramlist{%
- \egroup
- \noexpand\norecurse{\the\macname}%
- \noexpand\scanmacro{\temp}\egroup}%
+ \else % at most 9
+ \ifnum\paramno<10\relax
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \expandafter\noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % 10 or more:
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\getargvals@{\the\macname}{\argl}%
+ }%
+ \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
+ \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
+ \fi
\fi
\fi}
+\catcode `\@\texiatcatcode\relax
+
\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
% \braceorline decides whether the next nonwhitespace character is a
% {. If so it reads up to the closing }, if not, it reads the whole
% line. Whatever was read is then fed to the next control sequence
-% as an argument (by \parsebrace or \parsearg)
+% as an argument (by \parsebrace or \parsearg).
+%
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
\def\braceorlinexxx{%
\ifx\nchar\bgroup\else
@@ -7099,7 +7770,8 @@ end
% @alias.
% We need some trickery to remove the optional spaces around the equal
-% sign. Just make them active and then expand them all to nothing.
+% sign. Make them active and then expand them all to nothing.
+%
\def\alias{\parseargusing\obeyspaces\aliasxxx}
\def\aliasxxx #1{\aliasyyy#1\relax}
\def\aliasyyy #1=#2\relax{%
@@ -7120,7 +7792,8 @@ end
% @inforef is relatively simple.
\def\inforef #1{\inforefzzz #1,,,,**}
-\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+\def\inforefzzz #1,#2,#3,#4**{%
+ \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
node \samp{\ignorespaces#1{}}}
% @node's only job in TeX is to define \lastnode, which is used in
@@ -7181,11 +7854,32 @@ end
\toks0 = \expandafter{\lastsection}%
\immediate \writexrdef{title}{\the\toks0 }%
\immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
- \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout
+ \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
}%
\fi
}
+% @xrefautosectiontitle on|off says whether @section(ing) names are used
+% automatically in xrefs, if the third arg is not explicitly specified.
+% This was provided as a "secret" @set xref-automatic-section-title
+% variable, now it's official.
+%
+\parseargdef\xrefautomaticsectiontitle{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETxref-automatic-section-title\endcsname
+ = \empty
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETxref-automatic-section-title\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
+ must be on|off}%
+ \fi\fi
+}
+
+%
% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
% the node name, #2 the name of the Info cross-reference, #3 the printed
% node name, #4 the name of the Info file, #5 the name of the printed
@@ -7194,26 +7888,41 @@ end
\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
\def\ref#1{\xrefX[#1,,,,,,,]}
+%
+\newbox\toprefbox
+\newbox\printedrefnamebox
+\newbox\infofilenamebox
+\newbox\printedmanualbox
+%
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
\unsepspaces
- \def\printedmanual{\ignorespaces #5}%
+ %
+ % Get args without leading/trailing spaces.
\def\printedrefname{\ignorespaces #3}%
- \setbox1=\hbox{\printedmanual\unskip}%
- \setbox0=\hbox{\printedrefname\unskip}%
- \ifdim \wd0 = 0pt
+ \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
+ %
+ \def\infofilename{\ignorespaces #4}%
+ \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
+ %
+ \def\printedmanual{\ignorespaces #5}%
+ \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
+ %
+ % If the printed reference name (arg #3) was not explicitly given in
+ % the @xref, figure out what we want to use.
+ \ifdim \wd\printedrefnamebox = 0pt
% No printed node name was explicitly given.
- \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
- % Use the node name inside the square brackets.
+ \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
+ % Not auto section-title: use node name inside the square brackets.
\def\printedrefname{\ignorespaces #1}%
\else
- % Use the actual chapter/section title appear inside
- % the square brackets. Use the real section title if we have it.
- \ifdim \wd1 > 0pt
- % It is in another manual, so we don't have it.
+ % Auto section-title: use chapter/section title inside
+ % the square brackets if we have it.
+ \ifdim \wd\printedmanualbox > 0pt
+ % It is in another manual, so we don't have it; use node name.
\def\printedrefname{\ignorespaces #1}%
\else
\ifhavexrefs
- % We know the real title if we have the xref values.
+ % We (should) know the real title if we have the xref values.
\def\printedrefname{\refx{#1-title}{}}%
\else
% Otherwise just copy the Info node name.
@@ -7227,13 +7936,20 @@ end
\ifpdf
{\indexnofonts
\turnoffactive
+ \makevalueexpandable
% This expands tokens, so do it after making catcode changes, so _
- % etc. don't get their TeX definitions.
+ % etc. don't get their TeX definitions. This ignores all spaces in
+ % #4, including (wrongly) those in the middle of the filename.
\getfilename{#4}%
%
- % See comments at \activebackslashdouble.
- {\activebackslashdouble \xdef\pdfxrefdest{#1}%
- \backslashparens\pdfxrefdest}%
+ % This (wrongly) does not take account of leading or trailing
+ % spaces in #1, which should be ignored.
+ \edef\pdfxrefdest{#1}%
+ \ifx\pdfxrefdest\empty
+ \def\pdfxrefdest{Top}% no empty targets
+ \else
+ \txiescapepdf\pdfxrefdest % escape PDF special chars
+ \fi
%
\leavevmode
\startlink attr{/Border [0 0 0]}%
@@ -7260,29 +7976,42 @@ end
\iffloat\Xthisreftitle
% If the user specified the print name (third arg) to the ref,
% print it instead of our usual "Figure 1.2".
- \ifdim\wd0 = 0pt
+ \ifdim\wd\printedrefnamebox = 0pt
\refx{#1-snt}{}%
\else
\printedrefname
\fi
%
- % if the user also gave the printed manual name (fifth arg), append
+ % If the user also gave the printed manual name (fifth arg), append
% "in MANUALNAME".
- \ifdim \wd1 > 0pt
+ \ifdim \wd\printedmanualbox > 0pt
\space \putwordin{} \cite{\printedmanual}%
\fi
\else
% node/anchor (non-float) references.
+ %
+ % If we use \unhbox to print the node names, TeX does not insert
+ % empty discretionaries after hyphens, which means that it will not
+ % find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens,
+ % this is a loss. Therefore, we give the text of the node name
+ % again, so it is as if TeX is seeing it for the first time.
+ %
+ \ifdim \wd\printedmanualbox > 0pt
+ % Cross-manual reference with a printed manual name.
+ %
+ \crossmanualxref{\cite{\printedmanual\unskip}}%
+ %
+ \else\ifdim \wd\infofilenamebox > 0pt
+ % Cross-manual reference with only an info filename (arg 4), no
+ % printed manual name (arg 5). This is essentially the same as
+ % the case above; we output the filename, since we have nothing else.
+ %
+ \crossmanualxref{\code{\infofilename\unskip}}%
%
- % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
- % insert empty discretionaries after hyphens, which means that it will
- % not find a line break at a hyphen in a node names. Since some manuals
- % are best written with fairly long node names, containing hyphens, this
- % is a loss. Therefore, we give the text of the node name again, so it
- % is as if TeX is seeing it for the first time.
- \ifdim \wd1 > 0pt
- \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
\else
+ % Reference within this manual.
+ %
% _ (for example) has to be the character _ for the purposes of the
% control sequence corresponding to the node, but it has to expand
% into the usual \leavevmode...\vrule stuff for purposes of
@@ -7294,7 +8023,7 @@ end
\setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
\ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
}%
- % output the `[mynode]' via a macro so it can be overridden.
+ % output the `[mynode]' via the macro below so it can be overridden.
\xrefprintnodename\printedrefname
%
% But we always want a comma and a space:
@@ -7302,11 +8031,37 @@ end
%
% output the `page 3'.
\turnoffactive \putwordpage\tie\refx{#1-pg}{}%
- \fi
+ \fi\fi
\fi
\endlink
\endgroup}
+% Output a cross-manual xref to #1. Used just above (twice).
+%
+% Only include the text "Section ``foo'' in" if the foo is neither
+% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
+% "see The Foo Manual", the idea being to refer to the whole manual.
+%
+% But, this being TeX, we can't easily compare our node name against the
+% string "Top" while ignoring the possible spaces before and after in
+% the input. By adding the arbitrary 7sp below, we make it much less
+% likely that a real node name would have the same width as "Top" (e.g.,
+% in a monospaced font). Hopefully it will never happen in practice.
+%
+% For the same basic reason, we retypeset the "Top" at every
+% reference, since the current font is indeterminate.
+%
+\def\crossmanualxref#1{%
+ \setbox\toprefbox = \hbox{Top\kern7sp}%
+ \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
+ \ifdim \wd2 > 7sp % nonempty?
+ \ifdim \wd2 = \wd\toprefbox \else % same as Top?
+ \putwordSection{} ``\printedrefname'' \putwordin{}\space
+ \fi
+ \fi
+ #1%
+}
+
% This macro is called from \xrefX for the `[nodename]' part of xref
% output. It's a separate macro only so it can be changed more easily,
% since square brackets don't work well in some documents. Particularly
@@ -7357,7 +8112,8 @@ end
\angleleft un\-de\-fined\angleright
\iflinks
\ifhavexrefs
- \message{\linenumber Undefined cross reference `#1'.}%
+ {\toks0 = {#1}% avoid expansion of possibly-complex value
+ \message{\linenumber Undefined cross reference `\the\toks0'.}}%
\else
\ifwarnedxrefs\else
\global\warnedxrefstrue
@@ -7521,7 +8277,7 @@ end
% space to prevent strange expansion errors.)
\def\supereject{\par\penalty -20000\footnoteno =0 }
-% @footnotestyle is meaningful for info output only.
+% @footnotestyle is meaningful for Info output only.
\let\footnotestyle=\comment
{\catcode `\@=11
@@ -7584,6 +8340,8 @@ end
% expands into a box, it must come within the paragraph, lest it
% provide a place where TeX can split the footnote.
\footstrut
+ %
+ % Invoke rest of plain TeX footnote routine.
\futurelet\next\fo@t
}
}%end \catcode `\@=11
@@ -7671,7 +8429,7 @@ end
it from ftp://tug.org/tex/epsf.tex.}
%
\def\image#1{%
- \ifx\epsfbox\undefined
+ \ifx\epsfbox\thisisundefined
\ifwarnednoepsf \else
\errhelp = \noepsfhelp
\errmessage{epsf.tex not found, images will be ignored}%
@@ -7687,7 +8445,7 @@ end
% #2 is (optional) width, #3 is (optional) height.
% #4 is (ignored optional) html alt text.
% #5 is (ignored optional) extension.
-% #6 is just the usual extra ignored arg for parsing this stuff.
+% #6 is just the usual extra ignored arg for parsing stuff.
\newif\ifimagevmode
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
\catcode`\^^M = 5 % in case we're inside an example
@@ -7695,6 +8453,13 @@ end
% If the image is by itself, center it.
\ifvmode
\imagevmodetrue
+ \else \ifx\centersub\centerV
+ % for @center @image, we need a vbox so we can have our vertical space
+ \imagevmodetrue
+ \vbox\bgroup % vbox has better behavior than vtop herev
+ \fi\fi
+ %
+ \ifimagevmode
\nobreak\medskip
% Usually we'll have text after the image which will insert
% \parskip glue, so insert it here too to equalize the space
@@ -7704,9 +8469,13 @@ end
\fi
%
% Leave vertical mode so that indentation from an enclosing
- % environment such as @quotation is respected. On the other hand, if
- % it's at the top level, we don't want the normal paragraph indentation.
- \noindent
+ % environment such as @quotation is respected.
+ % However, if we're at the top level, we don't want the
+ % normal paragraph indentation.
+ % On the other hand, if we are in the case of @center @image, we don't
+ % want to start a paragraph, which will create a hsize-width box and
+ % eradicate the centering.
+ \ifx\centersub\centerV\else \noindent \fi
%
% Output the image.
\ifpdf
@@ -7718,7 +8487,10 @@ end
\epsfbox{#1.eps}%
\fi
%
- \ifimagevmode \medskip \fi % space after the standalone image
+ \ifimagevmode
+ \medskip % space after a standalone image
+ \fi
+ \ifx\centersub\centerV \egroup \fi
\endgroup}
@@ -8136,7 +8908,7 @@ directory should work if nowhere else does.}
%
% Latin1 (ISO-8859-1) character definitions.
\def\latonechardefs{%
- \gdef^^a0{~}
+ \gdef^^a0{\tie}
\gdef^^a1{\exclamdown}
\gdef^^a2{\missingcharmsg{CENT SIGN}}
\gdef^^a3{{\pounds}}
@@ -8166,7 +8938,7 @@ directory should work if nowhere else does.}
\gdef^^b9{$^1$}
\gdef^^ba{\ordm}
%
- \gdef^^bb{\guilletright}
+ \gdef^^bb{\guillemetright}
\gdef^^bc{$1\over4$}
\gdef^^bd{$1\over2$}
\gdef^^be{$3\over4$}
@@ -8258,7 +9030,7 @@ directory should work if nowhere else does.}
% Latin2 (ISO-8859-2) character definitions.
\def\lattwochardefs{%
- \gdef^^a0{~}
+ \gdef^^a0{\tie}
\gdef^^a1{\ogonek{A}}
\gdef^^a2{\u{}}
\gdef^^a3{\L}
@@ -8339,8 +9111,8 @@ directory should work if nowhere else does.}
\gdef^^ea{\ogonek{e}}
\gdef^^eb{\"e}
\gdef^^ec{\v e}
- \gdef^^ed{\'\i}
- \gdef^^ee{\^\i}
+ \gdef^^ed{\'{\dotless{i}}}
+ \gdef^^ee{\^{\dotless{i}}}
\gdef^^ef{\v d}
%
\gdef^^f0{\dh}
@@ -8431,7 +9203,7 @@ directory should work if nowhere else does.}
\gdef\DeclareUnicodeCharacter#1#2{%
\countUTFz = "#1\relax
- \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
+ %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
\begingroup
\parseXMLCharref
\def\UTFviiiTwoOctets##1##2{%
@@ -8899,8 +9671,8 @@ directory should work if nowhere else does.}
% Prevent underfull vbox error messages.
\vbadness = 10000
-% Don't be so finicky about underfull hboxes, either.
-\hbadness = 2000
+% Don't be very finicky about underfull hboxes, either.
+\hbadness = 6666
% Following George Bush, get rid of widows and orphans.
\widowpenalty=10000
@@ -9107,28 +9879,21 @@ directory should work if nowhere else does.}
\message{and turning on texinfo input format.}
+\def^^L{\par} % remove \outer, so ^L can appear in an @comment
+
% DEL is a comment character, in case @c does not suffice.
\catcode`\^^? = 14
% Define macros to output various characters with catcode for normal text.
-\catcode`\"=\other
-\catcode`\~=\other
-\catcode`\^=\other
-\catcode`\_=\other
-\catcode`\|=\other
-\catcode`\<=\other
-\catcode`\>=\other
-\catcode`\+=\other
-\catcode`\$=\other
-\def\normaldoublequote{"}
-\def\normaltilde{~}
-\def\normalcaret{^}
-\def\normalunderscore{_}
-\def\normalverticalbar{|}
-\def\normalless{<}
-\def\normalgreater{>}
-\def\normalplus{+}
-\def\normaldollar{$}%$ font-lock fix
+\catcode`\"=\other \def\normaldoublequote{"}
+\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
+\catcode`\+=\other \def\normalplus{+}
+\catcode`\<=\other \def\normalless{<}
+\catcode`\>=\other \def\normalgreater{>}
+\catcode`\^=\other \def\normalcaret{^}
+\catcode`\_=\other \def\normalunderscore{_}
+\catcode`\|=\other \def\normalverticalbar{|}
+\catcode`\~=\other \def\normaltilde{~}
% This macro is used to make a character print one way in \tt
% (where it can probably be output as-is), and another way in other fonts,
@@ -9206,34 +9971,48 @@ directory should work if nowhere else does.}
% In texinfo, backslash is an active character; it prints the backslash
% in fixed width font.
-\catcode`\\=\active
-@def@normalbackslash{{@tt@backslashcurfont}}
+\catcode`\\=\active % @ for escape char from now on.
+
+% The story here is that in math mode, the \char of \backslashcurfont
+% ends up printing the roman \ from the math symbol font (because \char
+% in math mode uses the \mathcode, and plain.tex sets
+% \mathcode`\\="026E). It seems better for @backslashchar{} to always
+% print a typewriter backslash, hence we use an explicit \mathchar,
+% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
+% ignored family value; char position "5C). We can't use " for the
+% usual hex value because it has already been made active.
+@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
+@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
+
% On startup, @fixbackslash assigns:
% @let \ = @normalbackslash
-
% \rawbackslash defines an active \ to do \backslashcurfont.
% \otherbackslash defines an active \ to be a literal `\' character with
-% catcode other.
+% catcode other. We switch back and forth between these.
@gdef@rawbackslash{@let\=@backslashcurfont}
@gdef@otherbackslash{@let\=@realbackslash}
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
-% the literal character `\'.
-%
-@def@normalturnoffactive{%
- @let\=@normalbackslash
- @let"=@normaldoublequote
- @let~=@normaltilde
- @let^=@normalcaret
- @let_=@normalunderscore
- @let|=@normalverticalbar
- @let<=@normalless
- @let>=@normalgreater
- @let+=@normalplus
- @let$=@normaldollar %$ font-lock fix
- @markupsetuplqdefault
- @markupsetuprqdefault
- @unsepspaces
+% the literal character `\'. Also revert - to its normal character, in
+% case the active - from code has slipped in.
+%
+{@catcode`- = @active
+ @gdef@normalturnoffactive{%
+ @let-=@normaldash
+ @let"=@normaldoublequote
+ @let$=@normaldollar %$ font-lock fix
+ @let+=@normalplus
+ @let<=@normalless
+ @let>=@normalgreater
+ @let\=@normalbackslash
+ @let^=@normalcaret
+ @let_=@normalunderscore
+ @let|=@normalverticalbar
+ @let~=@normaltilde
+ @markupsetuplqdefault
+ @markupsetuprqdefault
+ @unsepspaces
+ }
}
% Make _ and + \other characters, temporarily.
@@ -9262,10 +10041,19 @@ directory should work if nowhere else does.}
% Say @foo, not \foo, in error messages.
@escapechar = `@@
+% These (along with & and #) are made active for url-breaking, so need
+% active definitions as the normal characters.
+@def@normaldot{.}
+@def@normalquest{?}
+@def@normalslash{/}
+
% These look ok in all fonts, so just make them not special.
-@catcode`@& = @other
-@catcode`@# = @other
-@catcode`@% = @other
+% @hashchar{} gets its own user-level command, because of #line.
+@catcode`@& = @other @def@normalamp{&}
+@catcode`@# = @other @def@normalhash{#}
+@catcode`@% = @other @def@normalpercent{%}
+
+@let @hashchar = @normalhash
@c Finally, make ` and ' active, so that txicodequoteundirected and
@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we