aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/grosciteco.tes
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-08-06 16:46:37 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-08-06 16:46:37 +0300
commit280cb9da39fc7b5357f6071926d511394f6d0152 (patch)
treecdca852694fd3e4cc9293c374d16ac69d9be01ea /doc/grosciteco.tes
parentc5510d684e4879ab9a5295b4a1981888a4268627 (diff)
downloadsciteco-280cb9da39fc7b5357f6071926d511394f6d0152.tar.gz
command-line arguments are no longer passed via the unnamed buffer, but via special Q-registers ^Ax
* The unnamed buffer is also used for reading from --stdin, so you couldn't practically combine --stdin with passing command-line arguments to macros. * The old approach of passing command-line arguments via lines in the unnamed buffer was flawed anyway as it wouldn't work with filenames containing LF. This is just a very ancient feature, written when there weren't even long Q-reg names in SciTECO. * You can now e.g. pipe into SciTECO and edit what was read interactively, e.g. `dmesg | sciteco -i`. You can practically use SciTECO as a pager. * htbl.tes is now a command-line filter (uses -qio). * grosciteco.tes reads Troff intermediate code from stdin, so we no longer need "*.intermediate" temporary files. * added a getopt.tes test case to the testsuite. * This change unfortunately breaks most macros accepting command-line arguments, even if they used getopt.tes. It also requires updating ~/.teco_ini - see fallback.teco_ini.
Diffstat (limited to 'doc/grosciteco.tes')
-rwxr-xr-xdoc/grosciteco.tes38
1 files changed, 20 insertions, 18 deletions
diff --git a/doc/grosciteco.tes b/doc/grosciteco.tes
index cbe0e61..a724a5f 100755
--- a/doc/grosciteco.tes
+++ b/doc/grosciteco.tes
@@ -1,16 +1,18 @@
-#!/usr/local/bin/sciteco -m
-!* grosciteco.tes [-t <output-tec>] [--] <output-woman> <input> *!
+#!/usr/local/bin/sciteco -mi
+!* grosciteco.tes [-t <output-tec>] [--] <output> <input *!
0,2EJ !* FIXME: Memory limiting is too slow *!
:EIQ[$SCITECOPATH]/getopt.tes
!* Process command-line options *!
-[optstring]t: M[getopt]"F (0/0) '
-LR 0X[output-woman] 2LR 0X[input] HK
+[optstring]t:
+M[getopt]U[output-woman] Q[output-woman]"< Invalid command-line^J 1 '
+EU[output-woman]Q[\[output-woman]]
:Q[getopt.t]"< EU[getopt.t]Q[output-woman].tec '
-EBN[input]
+EBN[output-woman] HK 1EB
+
0EE !* Groff intermediate code is always ASCII *!
!* skip whitespace characters *!
@@ -54,7 +56,7 @@ EBN[input]
!* FIXME: Works only for straight lines *!
@[line]{ U.[to.v] U.[to.h]
Q.[to.h]-Q[pos.h]"= Q.[to.v]-Q[pos.v]"=  ' '
- [* EB
+ [* EBN[output-woman]
Q.[to.h]-Q[pos.h]"=
!* vertical line *!
Q.[to.v]-Q[pos.v]"< Q[pos.v]U.v Q.[to.v]U[pos.v] | Q.[to.v]U.v '
@@ -147,32 +149,32 @@ EBN[input]
* a table). Only the line+column should no longer change.
* Either store line+column or use markers.
*!
- [* EB 0:M[move] U.d ]*
+ [* EBN[output-woman] 0:M[move] U.d ]*
:EU[topics]\.d:
C :X[topics]
L F<
!cmd.xXsciteco_tt!
- [* EB 0:M[move] U[ttstart] ]*
+ [* EBN[output-woman] 0:M[move] U[ttstart] ]*
L F<
!cmd.xXsciteco_tt_end!
- [* EB 0:M[move]
+ [* EBN[output-woman] 0:M[move]
-Q[ttstart]<
Q[ttstart]ESSTARTSTYLING Q[ttstart]ESGETSTYLEAT+16,1ESSETSTYLING
%[ttstart]>
]*
L F<
!cmd.xXsciteco_startstyling!
- [* EB 0:M[move] U[stylestart] ]*
+ [* EBN[output-woman] 0:M[move] U[stylestart] ]*
L F<
!cmd.xXsciteco_setstyling!
C :M#giU.s
- [* EB 0:M[move]
+ [* EBN[output-woman] 0:M[move]
Q[stylestart]ESSTARTSTYLING Q.s,(-Q[stylestart])ESSETSTYLING
]*
L F<
!cmd.xXsciteco_foldlevel!
C :M#giU.[foldlevel]
- [* EB 0:M[move]
+ [* EBN[output-woman] 0:M[move]
Q.[foldlevel],(ESLINEFROMPOSITION)ESSETLINESTATE
]*
L F<
@@ -274,7 +276,7 @@ EBN[input]
!cmd.t!
:M#sw .(:M#sa).X.w
- [* EB :Q.w:M[move]
+ [* EBN[output-woman] :Q.w:M[move]
G.w :Q.w:M[style] ]*
:Q.w%[pos.h] :M#sc F<
@@ -285,17 +287,17 @@ EBN[input]
|
.(:M#sa).X.w 0Q[glyphs.Q.w]U.w
'
- [* EB 1:M[move]
+ [* EBN[output-woman] 1:M[move]
Q.wI 1:M[style] ]* :M#sc F<
!cmd.c!
:M#sw 0AU.w C
- [* EB 1:M[move]
+ [* EBN[output-woman] 1:M[move]
G[glyphs.U.w] 1:M[style] ]* :M#sc F<
!cmd.N!
:M#sw :M#giU.w
- [* EB 1:M[move]
+ [* EBN[output-woman] 1:M[move]
Q.wI 1:M[style] ]* :M#sc F<
!cmd.n!
@@ -336,7 +338,7 @@ Q*U*
* TODO: The size can still be improved by using SCI_SETSTYLINGEX
* if appropriate.
*!
-EB 0EE !* operate in single-byte mode *!
+EBN[output-woman] 0EE !* operate in single-byte mode *!
J 0U#cs 0U#cd
<
.ESGETSTYLEATUs Qs"< Qs= '
@@ -375,7 +377,7 @@ Q[cur.fl]"N
!*
* Save the clear-text part of the document into <output-woman>
*!
-2EL EWQ[output-woman]
+2EL EW
EQ[styles]