aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--TODO6
-rw-r--r--doc/Makefile.am40
-rwxr-xr-xdoc/generate-docs.tes153
-rw-r--r--doc/grosciteco.tes.1.in3
-rw-r--r--doc/sciteco.1.in6
-rw-r--r--doc/sciteco.7.template3
-rwxr-xr-xdoc/tedoc.tes129
-rw-r--r--doc/tedoc.tes.1.in130
-rw-r--r--src/cmdline.cpp2
-rw-r--r--src/glob.cpp2
-rw-r--r--src/goto.cpp2
-rw-r--r--src/help.cpp2
-rw-r--r--src/parser.cpp84
-rw-r--r--src/qregisters.cpp26
-rw-r--r--src/ring.cpp4
-rw-r--r--src/search.cpp12
-rw-r--r--src/spawn.cpp4
17 files changed, 366 insertions, 242 deletions
diff --git a/TODO b/TODO
index 9e92ab5..e37de87 100644
--- a/TODO
+++ b/TODO
@@ -276,9 +276,3 @@ Optimizations:
Documentation:
* Code docs (Doxygen). It's slowly getting better...
- * clean up/fix generate-docs.tes
- generate-docs.tes could be turned into a general purpose script to
- extract command and macro documentation from C and SciTECO code
- (tedoc?).
- It should then be installed so it may be used by third-party macro
- library authors as well.
diff --git a/doc/Makefile.am b/doc/Makefile.am
index fed0ebb..97619b2 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -2,10 +2,21 @@
# substitutor is available.
include $(top_srcdir)/bootstrap.am
+# tedoc is a code documentation tool for SciTECO commands
+# and macros, extracting comments from SciTECO and C/C++
+# code.
+# It generates Troff manpage markup and acts as a Troff
+# preprocessor to manpage templates.
+dist_bin_SCRIPTS = tedoc.tes
+
+%.in : %.template tedoc.tes $(SOURCES)
+ $(SCITECO_FULL) -m -- @srcdir@/tedoc.tes \
+ -C $@ $< $(SOURCES)
+
# grosciteco is a troff postprocessor similar to grotty
# which can be used to produce SciTECO-friendly output
# (woman pages).
-dist_bin_SCRIPTS = grosciteco.tes
+dist_bin_SCRIPTS += grosciteco.tes
# grosciteco, like many other postprocessors, works
# best with its own macro package.
# Unfortunately, there is no way to query the built-in
@@ -16,18 +27,23 @@ dist_bin_SCRIPTS = grosciteco.tes
# the directory via `groff -M`.
dist_pkgdata_DATA = sciteco.tmac
-# Fix up the hash-bang line of grosciteco upon installation
-# to refer to the installed sciteco binary.
+# Fix up the hash-bang line of installed SciTECO scripts upon
+# installation to refer to the installed sciteco binary.
# This takes --program-prefix into account.
install-exec-hook:
- @SED@ -i "1s,#!.*sciteco,#!$(bindir)/`echo sciteco | @SED@ '$(transform)'`$(EXEEXT)," \
- $(DESTDIR)$(bindir)/grosciteco.tes
+ for script in $(DESTDIR)$(bindir)/*.tes; do \
+ @SED@ -i "1s,#!.*sciteco,#!$(libexecdir)/`echo sciteco-wrapper | @SED@ '$(transform)'`$(EXEEXT)," \
+ $$script; \
+ done
womendir = $(scitecolibdir)/women
women_DATA = grosciteco.tes.1.woman grosciteco.tes.1.woman.tec
CLEANFILES = grosciteco.tes.1.intermediate
+women_DATA += tedoc.tes.1.woman tedoc.tes.1.woman.tec
+CLEANFILES += tedoc.tes.1.intermediate
+
women_DATA += sciteco.1.woman sciteco.1.woman.tec
CLEANFILES += sciteco.1.intermediate
@@ -49,6 +65,9 @@ CLEANFILES += $(women_DATA)
man_MANS = grosciteco.tes.1
EXTRA_DIST = grosciteco.tes.1.in
+man_MANS += tedoc.tes.1
+EXTRA_DIST += tedoc.tes.1.in
+
man_MANS += sciteco.1
EXTRA_DIST += sciteco.1.in
@@ -59,21 +78,18 @@ SOURCES = $(wildcard @top_srcdir@/src/*.cpp)
CLEANFILES += $(man_MANS)
-dist_noinst_SCRIPTS = generate-docs.tes htbl.tes
-
-%.in : %.template generate-docs.tes $(SOURCES)
- $(SCITECO_FULL) -m @srcdir@/generate-docs.tes \
- $@ $< $(SOURCES)
+dist_noinst_SCRIPTS = htbl.tes
if BUILD_HTMLMAN
-html_DATA = grosciteco.1.html sciteco.1.html sciteco.7.html
+html_DATA = grosciteco.tes.1.html tedoc.tes.1.html \
+ sciteco.1.html sciteco.7.html
CLEANFILES += $(html_DATA)
endif
# NOTE: The *.htbl files are only generated since SciTECO
# scripts cannot be integrated into pipelines easily yet.
%.htbl : % htbl.tes
- $(SCITECO_FULL) -m @srcdir@/htbl.tes $< $@
+ $(SCITECO_FULL) -m -- @srcdir@/htbl.tes $< $@
%.html : %.htbl
@GROFF@ -Thtml -man $< >$@
diff --git a/doc/generate-docs.tes b/doc/generate-docs.tes
deleted file mode 100755
index ee4820c..0000000
--- a/doc/generate-docs.tes
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/sciteco -m
-! ./generate-docs.tes <output> <input> <sources> !
-
-!
- Preprocess a manpage template, inserting a SciTECO command reference.
-
- The .COMMANDS request is replaced with Troff markup generated from code
- comments in <sources>.
-
- The comments support a small but powerful markup for documenting
- TECO commands:
- * comments start with /*$
- * all lines until first empty line are command syntax descriptions
- * text followed by "--" is a short description
- * variable values and characters of syntactic significance should be
- detected automatically
- * alternatives are denoted by "|"
- * every line is an alternative
- * return values may be specified after "->"
- * the remaining text is the verbose command description
- * <name> denotes a variable from the syntax description
- * empty lines introduce paragraphs
- * lines beginning with "-" are unordered lists
- * lines beginning with numbers and dot ("1.", "2.", etc.) are
- ordered lists
- * the above transformations are only preprocessing, so that
- Troff requests, escapes and tman macros may also be used.
-!
-
-@[format_header]{
- fd--S .U.f :L"S.|Z'U.t Q.f,Q.tXa Q.f,Q.tD I
-
- ebQ#tm I\# GENERATED FROM Q.#sc (\.#sc):
-.SS Qa -a-10"N I
- ' eq.[header]
-j<fr
-
-.br
-;>
-j<sMA;.u.t 1ua<."=1;'-a"A|1;'-a"V-1ua1;'r> qa"Sq.tj|.,q.txa.,q.td i
-.SCITECO_TOPIC "Qa"
-.B Qa
-'>
-j<s[MC];.u.t-s[.,q.t-1xa .-1,q.td i
-.RI [ Qa ]
->
-j<fr->\(->;>
-j<sMCM[|MC];.u.t <-a"C|-a-|"N1;''r> .,q.txa .,q.td eqa<fr| | ;> eq.[header]i
-.IR Qa
->
-j<frS
-
-;>j<fr
-S
-;>j<fs
-
-
-;>
-j 0a-10"=d'
-zj-a-10"=-d'
- ebQ#tm g.[header]i
-.
-
-}
-
-@[format_body]{
- i.LP
-<fr
-
-
-.
-.LP
-;>
- j<fs
--S
-.IP \(bu 4
-;>j<s
-MD.S; 0L I.IP  FSS 4
->
- ! set margin for list paragraphs !
- j 0U.n<
- Z-.-3"<1;'
- .,.+3:S.LP"S Q.n">0L I.RE
- 0U.n' | .,.+3:S.IP"S Q.n"=0L I.RS
- %.n' ' '
- :L;
- > Q.n"> ZJ I
-.RE '
- j<s<MC>;-di
--s<-di
-.I >
- j<frS
-
-;>j<fr
-S
-;>
- ebQ#tm g.ci
-.
-.
-
-}
-
-! process command-line options !
-LR 0X#ou 2LR 0X#tm EBQ#tm EB L
-[.f
- <:L;R 0X.f EBQ.f EB L>
-].f
--EF
-
-I\#
-\# AUTOGENERATED FROM Q#tm
-\# DO NOT EDIT MANUALLY!!!
-\#
-
-
-! find insertion point !
-FS
-.COMMANDS
-
-
-
-<
-<
- ! extract comment !
- 2EB EQ* HX.#sc 2EB
- s/*$; .-3u.#sc s*/ q.#sc+3,.-2x.ceq.c
- ! q.#sc= !
- <fs
-
-
-;>
- j<fs
-[S,]*[M[ , ],]
-;>
- j<0a-13"=df>'0a-10"=df>'0a- "=df>'0a- "=df>';>
- zj<-a-13"=-df>'-a-10"=-df>'-a- "=-df>'-a- "=-df>';>
-
- ! extract header !
- h:fd
-
-"Fzj'0,.x.[header]0,.d
-
- eq.[header]
- :M[format_header]
- eq.c
- :M[format_body]
->
-EF
-Q*-1"=1;'
->
-
-EWQ#ou
-EX
diff --git a/doc/grosciteco.tes.1.in b/doc/grosciteco.tes.1.in
index 0aac8dc..3e21f8a 100644
--- a/doc/grosciteco.tes.1.in
+++ b/doc/grosciteco.tes.1.in
@@ -186,6 +186,9 @@ to make the files accessible in \*(ST's online-help system.
Language reference including additional information on the \fB?\fP command:
.BR sciteco (7)
.TP
+A documentation tool generating man-page markup:
+.BR tedoc.tes (1)
+.TP
The \fBGNU roff\fP front end program:
.BR groff (1)
.TP
diff --git a/doc/sciteco.1.in b/doc/sciteco.1.in
index ed3892f..ead8337 100644
--- a/doc/sciteco.1.in
+++ b/doc/sciteco.1.in
@@ -402,7 +402,11 @@ Language reference:
.TP
The \fBtroff\fP post-processor for \*(ST, including
information on how to write \(lqwomanpages\(rq:
-.BR grosciteco (1)
+.BR grosciteco.tes (1)
+.TP
+A \fBtroff\fP pre-processor commonly used to generate
+man-pages:
+.BR tedoc.tes (1)
.TP
Homepage:
.UR @PACKAGE_URL@
diff --git a/doc/sciteco.7.template b/doc/sciteco.7.template
index f3f5b48..9ce5bf8 100644
--- a/doc/sciteco.7.template
+++ b/doc/sciteco.7.template
@@ -2135,7 +2135,8 @@ by \*(ST.
.LP
The same conventions are used elsewhere in this manual.
.
-.COMMANDS
+.\" Expanded with the command reference:
+.TEDOC
.
.
.SH COMPATIBILITY
diff --git a/doc/tedoc.tes b/doc/tedoc.tes
new file mode 100755
index 0000000..623be3a
--- /dev/null
+++ b/doc/tedoc.tes
@@ -0,0 +1,129 @@
+#!/usr/local/bin/sciteco -m
+!* tedoc.tes [-C] [--] <output> <input> <sources> *!
+
+:EMQ[$SCITECOPATH]/getopt.tes
+
+@[format_header]{
+ FD--S .U.f :L"S.|Z'U.t Q.f,Q.tXa Q.f,Q.tD I^J
+
+ EBQ#tm
+ I\# GENERATED FROM Q.#sc (\.#sc):^J
+ I.SS  Ga -A-10"N I^J '
+ :Q.[topics]">
+ I.SCITECO_TOPIC  G.[topics]
+ '
+
+ EQ.[header]
+ J <FR^J^J.br^J;>
+ J <
+ SMA; .U.t
+ 1Ua <."=1;' -A"A|1;' -A"V -1Ua 1;' R>
+ Qa"S
+ Q.tJ
+ |
+ .,Q.tXa .,Q.tD
+ I^J.B Qa^J
+ '
+ >
+ J <
+ S[MC]; .U.t -S[ .,Q.t-1Xa .-1,Q.tD
+ I^J.RI [ Qa ]^J
+ >
+ J <FR->\(->;>
+ J <
+ SMCM[|MC];
+ .U.t <-A"C|-A-|"N1;'' R>
+ .,Q.tXa .,Q.tD EQa
+ <FR| | ;>
+ EQ.[header]
+ I^J.IR Qa^J
+ >
+ J <FRS^J^J;>
+ J <FR^JS^J;>
+ J <FR^J^J^J;>
+ J 0A-10"=D'
+ ZJ -A-10"=-D'
+ EBQ#tm
+ G.[header]
+ I^J.^J
+}
+
+@[format_body]{
+ I.LP^J
+ <FR^J^J^J.^J.LP^J;>
+ J <FS^J-S^J.IP \(bu 4^J;>
+ J <S^JMD.S; 0L I.IP  FSS 4^J>
+ !* set margin for list paragraphs *!
+ J 0U.n <
+ Z-.-3"<1;'
+ .,.+3:S.LP"S
+ Q.n">
+ 0L I.RE^J 0U.n
+ '
+ |
+ .,.+3:S.IP"S
+ Q.n"=0L I.RS^J %.n '
+ '
+ '
+ :L;
+ >
+ Q.n"> ZJ I^J.RE '
+ J <S<MC>; -D I^J -S< -D I^J.I >
+ J <FRS^J^J;>
+ J <FR^JS^J;>
+ EBN#tm
+ G.c I^J.^J.^J
+}
+
+!* process command-line options *!
+[optstring]C M[getopt]"F (0/0) '
+:Q[getopt.C]"<
+ [comment.start]!* [comment.end]*!
+|
+ [comment.start]/* [comment.end]*/
+'
+LR 0X#ou
+2LR 0X#tm EBN#tm EB L
+[.f
+ <:L;R 0X.f EBQ.f EB L>
+].f
+-EF
+
+I\#
+\# AUTOGENERATED FROM Q#tm
+\# DO NOT EDIT MANUALLY!!!
+\#^J
+
+!* find insertion point *!
+FS^J.TEDOC^J^J
+
+EJ-1<
+ <
+ 2U* EU.#scQ*
+
+ !* extract comment *!
+ SQ[comment.start]$;
+ .-:Q[comment.start]-1U.#sc
+ SQ[comment.end]
+ Q.#sc+:Q[comment.start]+1,.-:Q[comment.end]X.c
+ EQ.c
+ <FS^J^J ^J ;>
+ J <FS^J[S,]*[M[ , ],]^J;>
+ J 0A-10"N X.[topics] K '
+ <0A-10"N 0A- "N 0A-9"N 1; ' ' ' D>
+ ZJ <-A-10"N -A- "N -A-9"N 1; ' ' ' -D>
+
+ !* extract header *!
+ H:FD^J^J"F ZJ '
+ 0,.X.[header] 0,.D
+
+ EQ.[header]
+ :M[format_header]
+ EQ.c
+ :M[format_body]
+ >
+ EF
+>
+
+EWQ#ou
+EX
diff --git a/doc/tedoc.tes.1.in b/doc/tedoc.tes.1.in
new file mode 100644
index 0000000..77b67d1
--- /dev/null
+++ b/doc/tedoc.tes.1.in
@@ -0,0 +1,130 @@
+.ds ST \\fB@PACKAGE_NAME@\\fP
+.
+.
+.TH "tedoc.tes" 1 \
+ "@DATE@" \
+ "@PACKAGE_NAME@ Version @PACKAGE_VERSION@"
+.
+.
+.SCITECO_TOPIC tedoc tedoc.tes
+.SH NAME
+tedoc \-\-
+Source code documentation tool for \*(ST
+.
+.
+.SH SYNOPSIS
+.
+.SY tedoc.tes
+.OP "-C"
+.OP "--"
+.I output
+.I template
+.I sources...
+.YS
+.
+.
+.SH DESCRIPTION
+.
+.
+\fBtedoc\fP is a tool for extracting documentation from \*(ST macros
+and C/C++ code.
+It is used to document \*(ST's internal commands as well as macro
+packages.
+.SCITECO_TOPIC .TEDOC
+It processes special \*(ST comment blocks from the \fIsources\fP,
+generating \fBtroff\fP man-page markup and inserts them into
+a man-page \fItemplate\fP at the position of the \fBTEDOC\fP
+pseudo-request.
+The result is written to an \fIoutput\fP file.
+\fBtedoc\fP can thus be understood as a \fBtroff\fP preprocessor.
+.
+.SH OPTIONS
+.
+.IP "\fB-C\fP"
+Instruct \fBtedoc\fP to extract C/C++ comments instead of
+\*(ST comments.
+The C comments begin with \(lq/*$\(rq and end with \(lq*/\(rq.
+The \*(ST comments in contrast begin with \(lq!*$\(rq and end
+with \(lq*!\(rq.
+.IP "\fIoutput\fP"
+The resulting man-page file.
+.IP "\fItemplate\fP"
+A man-page template, i.e. a man-page with the \fBTEDOC\fP
+request.
+.IP "\fIsources...\fP"
+An arbitrary number of source code files to scan through.
+The comments are extracted in document order, ie. from the
+first comment in the first source file to the last comment
+in the last source file specified.
+.
+.
+.SH TEDOC COMMENTS
+.\" FIXME: !*$ cannot be indexed since it terminates the
+.\" header comment in *.woman.tec files.
+.SCITECO_TOPIC "/*$"
+.
+The \fBtedoc\fP source code comments support a small but powerful
+semantic markup for documenting \*(ST commands and macros:
+.IP \(bu 4
+Comments start with \(lq!*$\(rq (or \(lq/*$\(rq in C/C++ mode).
+.IP \(bu
+The first line (immediately after the starting comment) may
+contain \fItopic\fP keywords for \*(ST's online help system that
+will point to the beginning of the section generated for this
+\fBtedoc\fP comment.
+This generates \fBSCITECO_TOPIC\fP macro calls defined
+in \fBsciteco.tmac\fP (see \fBgrosciteco.tes\fP(1).
+.IP \(bu
+All lines until first empty line are syntax descriptions.
+.IP \(bu
+Text followed by \(lq--\(rq is a short description.
+.IP \(bu
+Variable values and characters of syntactic significance should be
+detected automatically.
+.IP \(bu
+Alternatives are denoted by \(lq|\(rq.
+.IP \(bu
+Every line is an alternative (e.g. different calling forms of the
+same command or macro).
+.IP \(bu
+Return values may be specified after \(lq->\(rq.
+.IP \(bu
+The remaining text is the verbose command description.
+.RS
+. IP \(bu
+\(lq<name>\(rq denotes a variable from the syntax description.
+. IP \(bu
+Empty lines introduce paragraphs.
+. IP \(bu
+Lines beginning with \(lq-\(rq are unordered lists.
+. IP \(bu
+Lines beginning with numbers and dot (\(lq1.\(rq, \(lq2.\(rq, etc.) are
+ordered lists.
+. IP \(bu
+These transformations are only preprocessing, so that
+\fBtroff\fP requests, macros and escapes may also be used freely.
+.RE
+.
+.
+.SH SEE ALSO
+.
+.TP
+\*(ST invocation and help on its environment variables:
+.BR sciteco (1)
+.TP
+A \fBGNU roff\fP post-processor for rendering \fBtroff\fP
+markup into \(lqwomanpages\(rq for \*(ST's online help system
+\(em also documents special \fBtroff\fP macros in \fBsciteco.tmac\fP:
+.BR grosciteco.tes (1)
+.TP
+The \fBGNU roff\fP \(lqman\(rq macros for writing man pages:
+.BR groff_man (7)
+.
+.
+.SH AUTHOR
+.
+This manpage and the \*(ST program was written by
+.MT robin.haberkorn@googlemail.com
+Robin Haberkorn
+.ME .
+\# EOF \ No newline at end of file
diff --git a/src/cmdline.cpp b/src/cmdline.cpp
index 19a3c66..042cd6f 100644
--- a/src/cmdline.cpp
+++ b/src/cmdline.cpp
@@ -800,7 +800,7 @@ symbol_complete(SymbolList &list, const gchar *symbol, gchar completed)
* Command states
*/
-/*$
+/*$ *q
* *q -- Save last command line
*
* Only at the very beginning of a command-line, this command
diff --git a/src/glob.cpp b/src/glob.cpp
index cb9633f..66a640f 100644
--- a/src/glob.cpp
+++ b/src/glob.cpp
@@ -294,7 +294,7 @@ Globber::compile_pattern(const gchar *pattern)
* Command States
*/
-/*$
+/*$ EN glob
* [type]EN[pattern]$[filename]$ -- Glob files or match filename and check file type
* [type]:EN[pattern]$[filename]$ -> Success|Failure
*
diff --git a/src/goto.cpp b/src/goto.cpp
index d53c209..c5fda9a 100644
--- a/src/goto.cpp
+++ b/src/goto.cpp
@@ -142,7 +142,7 @@ StateLabel::custom(gchar chr)
return this;
}
-/*$
+/*$ O
* Olabel$ -- Go to label
* [n]Olabel1[,label2,...]$
*
diff --git a/src/help.cpp b/src/help.cpp
index 9553f76..0205cf1 100644
--- a/src/help.cpp
+++ b/src/help.cpp
@@ -205,7 +205,7 @@ HelpIndex::set(const gchar *name, const gchar *filename, tecoInt pos)
* Command states
*/
-/*$
+/*$ "?" help
* ?[topic]$ -- Get help for topic
*
* Look up <topic> in the help index, opening
diff --git a/src/parser.cpp b/src/parser.cpp
index 00ebaee..dd936f6 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -844,7 +844,7 @@ StateStart::custom(gchar chr)
/*
* arithmetics
*/
- /*$
+ /*$ 0 1 2 3 4 5 6 7 8 9 digit number
* [n]0|1|2|3|4|5|6|7|8|9 -> n*Radix+X -- Append digit
*
* Integer constants in \*(ST may be thought of and are
@@ -927,7 +927,7 @@ StateStart::custom(gchar chr)
expressions.push(Expressions::OP_NEW);
break;
- /*$
+ /*$ "." dot
* \&. -> dot -- Return buffer position
*
* \(lq.\(rq pushes onto the stack, the current
@@ -940,7 +940,7 @@ StateStart::custom(gchar chr)
expressions.push(interface.ssm(SCI_GETCURRENTPOS));
break;
- /*$
+ /*$ Z size
* Z -> size -- Return buffer size
*
* Pushes onto the stack, the size of the currently selected
@@ -954,7 +954,7 @@ StateStart::custom(gchar chr)
expressions.push(interface.ssm(SCI_GETLENGTH));
break;
- /*$
+ /*$ H
* H -> 0,Z -- Return range for entire buffer
*
* Pushes onto the stack the integer 0 (position of buffer
@@ -969,7 +969,7 @@ StateStart::custom(gchar chr)
expressions.push(interface.ssm(SCI_GETLENGTH));
break;
- /*$
+ /*$ "\\"
* n\\ -- Insert or read ASCII numbers
* \\ -> n
*
@@ -1080,7 +1080,7 @@ StateStart::custom(gchar chr)
}
break;
- /*$
+ /*$ ";" break
* [bool]; -- Conditionally break from loop
* [bool]:;
*
@@ -1161,7 +1161,7 @@ StateStart::custom(gchar chr)
/*
* Command-line editing
*/
- /*$
+ /*$ "{" "}"
* { -- Edit command line
* }
*
@@ -1273,7 +1273,7 @@ StateStart::custom(gchar chr)
/*
* commands
*/
- /*$
+ /*$ J jump
* [position]J -- Go to position in buffer
* [position]:J -> Success|Failure
*
@@ -1305,7 +1305,7 @@ StateStart::custom(gchar chr)
}
break;
- /*$
+ /*$ C move
* [n]C -- Move dot <n> characters
* -C
* [n]:C -> Success|Failure
@@ -1324,7 +1324,7 @@ StateStart::custom(gchar chr)
throw MoveError("C");
break;
- /*$
+ /*$ R reverse
* [n]R -- Move dot <n> characters backwards
* -R
* [n]:R -> Success|Failure
@@ -1341,7 +1341,7 @@ StateStart::custom(gchar chr)
throw MoveError("R");
break;
- /*$
+ /*$ L line
* [n]L -- Move dot <n> lines forwards
* -L
* [n]:L -> Success|Failure
@@ -1368,7 +1368,7 @@ StateStart::custom(gchar chr)
throw MoveError("L");
break;
- /*$
+ /*$ B backwards
* [n]B -- Move dot <n> lines backwards
* -B
* [n]:B -> Success|Failure
@@ -1386,7 +1386,7 @@ StateStart::custom(gchar chr)
throw MoveError("B");
break;
- /*$
+ /*$ W word
* [n]W -- Move dot by words
* -W
* [n]:W -> Success|Failure
@@ -1444,7 +1444,7 @@ StateStart::custom(gchar chr)
break;
}
- /*$
+ /*$ V
* [n]V -- Delete words forward
* -V
* [n]:V -> Success|Failure
@@ -1474,7 +1474,7 @@ StateStart::custom(gchar chr)
throw Error("Not enough words to delete with <V>");
break;
- /*$
+ /*$ Y
* [n]Y -- Delete word backwards
* -Y
* [n]:Y -> Success|Failure
@@ -1491,7 +1491,7 @@ StateStart::custom(gchar chr)
throw Error("Not enough words to delete with <Y>");
break;
- /*$
+ /*$ "=" print
* <n>= -- Show value as message
*
* Shows integer <n> as a message in the message line and/or
@@ -1514,7 +1514,7 @@ StateStart::custom(gchar chr)
expressions.pop_num_calc());
break;
- /*$
+ /*$ K kill
* [n]K -- Kill lines
* -K
* from,to K
@@ -1537,7 +1537,7 @@ StateStart::custom(gchar chr)
* command is synonymous to <from>,<to>D.
*/
case 'K':
- /*$
+ /*$ D delete
* [n]D -- Delete characters
* -D
* from,to D
@@ -1610,7 +1610,7 @@ StateStart::custom(gchar chr)
break;
}
- /*$
+ /*$ A
* [n]A -> code -- Get character code from buffer
* -A -> code
*
@@ -1668,7 +1668,7 @@ StateFCommand::custom(gchar chr)
/*
* loop flow control
*/
- /*$
+ /*$ F<
* F< -- Go to loop start or jump to beginning of macro
*
* Immediately jumps to the current loop's start.
@@ -1686,7 +1686,7 @@ StateFCommand::custom(gchar chr)
? loop_stack.peek().pc : -1;
break;
- /*$
+ /*$ F> continue
* F> -- Go to loop end
* :F>
*
@@ -1749,7 +1749,7 @@ StateFCommand::custom(gchar chr)
/*
* conditional flow control
*/
- /*$
+ /*$ "F'"
* F\' -- Jump to end of conditional
*/
case '\'':
@@ -1761,7 +1761,7 @@ StateFCommand::custom(gchar chr)
skip_else = true;
break;
- /*$
+ /*$ F|
* F| -- Jump to else-part of conditional
*
* Jump to else-part of conditional or end of
@@ -1792,7 +1792,7 @@ UndoTokenChangeDir::run(void)
g_chdir(dir);
}
-/*$
+/*$ FG cd change-dir folder-go
* FG[directory]$ -- Change working directory
*
* Changes the process' current working directory
@@ -1964,7 +1964,7 @@ State *
StateControl::custom(gchar chr)
{
switch (String::toupper(chr)) {
- /*$
+ /*$ ^C exit
* ^C -- Exit program immediately
*
* Lets the top-level macro return immediately
@@ -1987,7 +1987,7 @@ StateControl::custom(gchar chr)
quit_requested = true;
throw Quit();
- /*$
+ /*$ ^O octal
* ^O -- Set radix to 8 (octal)
*/
case 'O':
@@ -1995,7 +1995,7 @@ StateControl::custom(gchar chr)
expressions.set_radix(8);
break;
- /*$
+ /*$ ^D decimal
* ^D -- Set radix to 10 (decimal)
*/
case 'D':
@@ -2003,7 +2003,7 @@ StateControl::custom(gchar chr)
expressions.set_radix(10);
break;
- /*$
+ /*$ ^R radix
* radix^R -- Set and get radix
* ^R -> radix
*
@@ -2023,7 +2023,7 @@ StateControl::custom(gchar chr)
/*
* Additional numeric operations
*/
- /*$
+ /*$ ^_ negate
* n^_ -> ~n -- Binary negation
*
* Binary negates (complements) <n> and returns
@@ -2058,7 +2058,7 @@ StateControl::custom(gchar chr)
return &States::start;
}
-/*$
+/*$ ^^ ^^c
* ^^c -> n -- Get ASCII code of character
*
* Returns the ASCII code of the character <c>
@@ -2087,7 +2087,7 @@ StateASCII::custom(gchar chr)
/*
* The Escape state is special, as it implements
- * a kind of "lookahead" for the ^[ command (dicard all
+ * a kind of "lookahead" for the ^[ command (discard all
* arguments).
* It is not executed immediately as usual in SciTECO
* but only if not followed by an escape character.
@@ -2106,7 +2106,7 @@ StateEscape::StateEscape()
State *
StateEscape::custom(gchar chr)
{
- /*$
+ /*$ ^[^[ terminate return
* [a1,a2,...]$$ -- Terminate command line or return from macro
* [a1,a2,...]^[$
*
@@ -2149,7 +2149,7 @@ StateEscape::custom(gchar chr)
/*
* Alternatives: ^[, <CTRL/[>, <ESC>
*/
- /*$
+ /*$ ^[ escape discard
* $ -- Discard all arguments
* ^[
*
@@ -2191,7 +2191,7 @@ State *
StateECommand::custom(gchar chr)
{
switch (String::toupper(chr)) {
- /*$
+ /*$ EF close
* [bool]EF -- Remove buffer from ring
* -EF
*
@@ -2225,7 +2225,7 @@ StateECommand::custom(gchar chr)
ring.close();
break;
- /*$
+ /*$ ED flags
* flags ED -- Set and get ED-flags
* [off,]on ED
* ED -> flags
@@ -2277,7 +2277,7 @@ StateECommand::custom(gchar chr)
}
break;
- /*$
+ /*$ EJ properties
* [key]EJ -> value -- Get and set system properties
* -EJ -> value
* value,keyEJ
@@ -2430,7 +2430,7 @@ StateECommand::custom(gchar chr)
break;
}
- /*$
+ /*$ EL eol
* 0EL -- Set or get End of Line mode
* 13,10:EL
* 1EL
@@ -2519,7 +2519,7 @@ StateECommand::custom(gchar chr)
}
break;
- /*$
+ /*$ EX exit
* [bool]EX -- Exit program
* -EX
* :EX
@@ -2583,7 +2583,7 @@ static struct ScintillaMessage {
sptr_t lParam;
} scintilla_message = {0, 0, 0};
-/*$
+/*$ ES scintilla message
* -- Send Scintilla message
* [lParam[,wParam]]ESmessage[,wParam]$[lParam]$ -> result
*
@@ -2712,7 +2712,7 @@ StateScintilla_lParam::done(const gchar *str)
* beginning and end of strings must be determined
* syntactically
*/
-/*$
+/*$ I insert
* [c1,c2,...]I[text]$ -- Insert text with string building characters
*
* First inserts characters for all the values
@@ -2728,7 +2728,7 @@ StateScintilla_lParam::done(const gchar *str)
* may be better, since it has string building characters
* disabled.
*/
-/*$
+/*$ EI
* [c1,c2,...]EI[text]$ -- Insert text without string building characters
*
* Inserts text at the current position in the current
@@ -2787,7 +2787,7 @@ StateInsert::done(const gchar *str)
/*
* Alternatives: ^i, ^I, <CTRL/I>, <TAB>
*/
-/*$
+/*$ ^I indent
* [char,...]^I[text]$ -- Insert with leading indention
*
* ^I (usually typed using the Tab key), first inserts
diff --git a/src/qregisters.cpp b/src/qregisters.cpp
index b6fa472..c4c164f 100644
--- a/src/qregisters.cpp
+++ b/src/qregisters.cpp
@@ -1097,7 +1097,7 @@ StateExpectQReg::custom(gchar chr)
return got_register(reg);
}
-/*$
+/*$ "[" "[q" push
* [q -- Save Q-Register
*
* Save Q-Register <q> contents on the global Q-Register push-down
@@ -1113,7 +1113,7 @@ StatePushQReg::got_register(QRegister *reg)
return &States::start;
}
-/*$
+/*$ "]" "]q" pop
* ]q -- Restore Q-Register
*
* Restore Q-Register <q> by replacing its contents
@@ -1137,7 +1137,7 @@ StatePopQReg::got_register(QRegister *reg)
return &States::start;
}
-/*$
+/*$ EQ EQq
* EQq$ -- Edit or load Q-Register
* EQq[file]$
*
@@ -1177,7 +1177,7 @@ StateLoadQReg::got_file(const gchar *filename)
return &States::start;
}
-/*$
+/*$ E% E%q
* E%q<file>$ -- Save Q-Register string to file
*
* Saves the string contents of Q-Register <q> to
@@ -1208,7 +1208,7 @@ StateSaveQReg::got_file(const gchar *filename)
return &States::start;
}
-/*$
+/*$ Q Qq query
* Qq -> n -- Query Q-Register existence, its integer or string characters
* <position>Qq -> character
* :Qq -> -1 | size
@@ -1298,7 +1298,7 @@ reset:
return &States::start;
}
-/*$
+/*$ ^Uq
* [c1,c2,...]^Uq[string]$ -- Set or append to Q-Register string without string building
* [c1,c2,...]:^Uq[string]$
*
@@ -1332,7 +1332,7 @@ StateCtlUCommand::got_register(QRegister *reg)
return &States::setqregstring_nobuilding;
}
-/*$
+/*$ EU EUq
* [c1,c2,...]EUq[string]$ -- Set or append to Q-Register string with string building characters
* [c1,c2,...]:EUq[string]$
*
@@ -1402,7 +1402,7 @@ StateSetQRegString::done(const gchar *str)
return &States::start;
}
-/*$
+/*$ G Gq get
* Gq -- Insert Q-Register string
*
* Inserts the string of Q-Register <q> into the buffer
@@ -1431,7 +1431,7 @@ StateGetQRegString::got_register(QRegister *reg)
return &States::start;
}
-/*$
+/*$ U Uq
* nUq -- Set Q-Register integer
* -Uq
* [n]:Uq -> Success|Failure
@@ -1468,7 +1468,7 @@ StateSetQRegInteger::got_register(QRegister *reg)
return &States::start;
}
-/*$
+/*$ % %q increment
* [n]%q -> q+n -- Increase Q-Register integer
*
* Add <n> to the integer part of register <q>, returning
@@ -1489,7 +1489,7 @@ StateIncreaseQReg::got_register(QRegister *reg)
return &States::start;
}
-/*$
+/*$ M Mq eval
* Mq -- Execute macro
* :Mq
*
@@ -1522,7 +1522,7 @@ StateMacro::got_register(QRegister *reg)
return &States::start;
}
-/*$
+/*$ EM
* EMfile$ -- Execute macro from file
* :EMfile$
*
@@ -1543,7 +1543,7 @@ StateMacroFile::got_file(const gchar *filename)
return &States::start;
}
-/*$
+/*$ X Xq
* [lines]Xq -- Copy into or append to Q-Register
* -Xq
* from,toXq
diff --git a/src/ring.cpp b/src/ring.cpp
index 077c58d..6e520f9 100644
--- a/src/ring.cpp
+++ b/src/ring.cpp
@@ -299,7 +299,7 @@ StateEditFile::do_edit(tecoInt id)
throw Error("Invalid buffer id %" TECO_INTEGER_FORMAT, id);
}
-/*$
+/*$ EB edit
* [n]EB[file]$ -- Open or edit file
* nEB$
*
@@ -395,7 +395,7 @@ StateEditFile::got_file(const gchar *filename)
return &States::start;
}
-/*$
+/*$ EW write save
* EW$ -- Save current buffer or Q-Register
* EWfile$
*
diff --git a/src/search.cpp b/src/search.cpp
index d5b314b..5040a2f 100644
--- a/src/search.cpp
+++ b/src/search.cpp
@@ -55,7 +55,7 @@ namespace States {
* Command states
*/
-/*$
+/*$ S search pattern
* S[pattern]$ -- Search for pattern
* [n]S[pattern]$
* -S[pattern]$
@@ -648,7 +648,7 @@ StateSearch::done(const gchar *str)
return &States::start;
}
-/*$
+/*$ N
* [n]N[pattern]$ -- Search over buffer-boundaries
* -N[pattern]$
* from,toN[pattern]$
@@ -740,7 +740,7 @@ StateSearchAll::done(const gchar *str)
return &States::start;
}
-/*$
+/*$ FK
* FK[pattern]$ -- Delete up to occurrence of pattern
* [n]FK[pattern]$
* -FK[pattern]$
@@ -799,7 +799,7 @@ StateSearchKill::done(const gchar *str)
return &States::start;
}
-/*$
+/*$ FD
* FD[pattern]$ -- Delete occurrence of pattern
* [n]FD[pattern]$
* -FD[pattern]$
@@ -834,7 +834,7 @@ StateSearchDelete::done(const gchar *str)
return &States::start;
}
-/*$
+/*$ FS
* FS[pattern]$[string]$ -- Search and replace
* [n]FS[pattern]$[string]$
* -FS[pattern]$[string]$
@@ -875,7 +875,7 @@ StateReplace_ignore::done(const gchar *str)
return &States::start;
}
-/*$
+/*$ FR
* FR[pattern]$[string]$ -- Search and replace with default
* [n]FR[pattern]$[string]$
* -FR[pattern]$[string]$
diff --git a/src/spawn.cpp b/src/spawn.cpp
index ee35a03..f99d689 100644
--- a/src/spawn.cpp
+++ b/src/spawn.cpp
@@ -124,7 +124,7 @@ parse_shell_command_line(const gchar *cmdline, GError **error)
return argv;
}
-/*$
+/*$ EC pipe filter
* EC[command]$ -- Execute operating system command and filter buffer contents
* linesEC[command]$
* -EC[command]$
@@ -499,7 +499,7 @@ cleanup:
return &States::start;
}
-/*$
+/*$ EG EGq
* EGq[command]$ -- Set Q-Register to output of operating system command
* linesEGq[command]$
* -EGq[command]$