aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
AgeCommit message (Collapse)AuthorFilesLines
12 daysupdated all links to the new "Knowledge Base" and mention mailing listsRobin Haberkorn2-5/+4
* The Knowledge Base replaces the Github wiki. * The mailing lists replace the Github bug tracker, discussions and pull requests.
2025-09-21moved most resources to fmsbw.deRobin Haberkorn6-6/+6
* The new official homepage is https://sciteco.fmsbw.de/ * My new contact address is rhaberkorn AT fmsbw.de. * The scintilla-mirror is now also on https://git.fmsbw.de/scintilla-mirror/ * Added CI script for my server on fmsbw.de that builds the website. It's run in a FreeBSD container, but does not currently distribute FreeBSD binaries.
2025-09-02build woman-pages via templates since pattern rules with grouped targets ↵Robin Haberkorn1-3/+12
appear to be broken in some versions of GNU Make Hopefully fixes the Mac OS CI and nightly builds.
2025-09-02fixed parallel builds of the woman pagesRobin Haberkorn1-2/+2
* There were two rules with independent targets, which could result in `.woman.tec` files to actually contain plain text. Practically all parallel builds were affected, among other things OBS-built packages where tutorial.woman.tec would usually be broken. * Now use the `&:` syntax for grouped targets.
2025-08-30the computed go-to command (O) is now 0-indexed and all invalid indexes and ↵Robin Haberkorn1-7/+9
empty labels are ignored * This has long been a TECO-11 incompatibility. * The first label in a list has index 0, i.e. `1Ofoo,bar$` jumps to label `!bar!`. Consequently 0 is also implied, so `Olabel$` continues to do what you expect. * `0Ofoo$` was previously also jumping to `!foo!` which was inconsistent: All invalid indexes should do nothing, i.e. execution continues after the go-to command. * Fixed handling of empty labels as in `1Ofoo,,bar$` - execution should also continue after the command. This eases writing "default" clauses immediately after the go-to. * The ED hook values now also begin at 0, so most existing ED hook macros should continue to work. * Similarily, the mouse events returned by -EJ also begin at 0 now, so fnkeys.tes continues to work as expected. * It's still very possible of course that this breaks existing code.
2025-08-21support Groff v1.19.2 as still used by default on NetBSD 10Robin Haberkorn2-5/+5
* They have a newer version in pkgsrc, but it's not even available as a binary package on the arm6. * Has some glitches, e.g. does accept the ASCII 27 in tutorial.ms, but it's probably not worth to work around.
2025-08-18sciteco(7): clarified SciTECO's policy with regards to TECO-11 and Video ↵Robin Haberkorn1-5/+7
TECO compatibility
2025-08-14fix up hash-bang lines only of the scripts really installed by the current ↵Robin Haberkorn1-3/+18
`make install` invocation * The previous way of fixing up all `*.tes` scripts had the disadvantage of touching unrelated scripts or grosciteco/tedoc of a previous invocation. E.g. installing a Gtk build after the ncurses build would overwrite all hash-bang lines of the curses-version scripts as well with gsciteco. * This caused problems with the RPM package where both variants were installed into the same buildroot and introduced a dependency from sciteco-curses to sciteco-gtk. This is worked around in sciteco.spec with a manual sed call. * It would be better to get rid of the install-exec-hook altogether as it causes problems with FreeBSD/Poudriere (FIXME).
2025-08-08don't install the standalone scripts from lib/ as actual scripts: should fix ↵Robin Haberkorn1-0/+4
CI and nightlies * They would get the --program-prefix. * If they aren't installed as real scripts, there is no point in fixing up their hash-bang lines. * The hash-bang line fix won't work on Windows anyway, so they are now disabled for grosciteco and tedoc as well.
2025-08-06command-line arguments are no longer passed via the unnamed buffer, but via ↵Robin Haberkorn6-73/+89
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.
2025-08-03simplified the htbl.tes preprocessor and the SUBST_MACRO using new --quiet, ↵Robin Haberkorn2-16/+10
--stdin and --stdout options * htbl.tes now reads from stdin and writes to stdout. Allows avoiding temporary `*.htbl` files * grosciteco.tes still cannot be simplified since --stdin cannot be combined with passing command-line arguments (FIXME).
2025-08-03added --quiet, --stdin and --stdout for easier integration into UNIX pipelinesRobin Haberkorn1-7/+55
* In principle --stdin and --stdout could have been done in pure TECO code using the <^T> command. Having built-in command-line arguments however has several advantages: * Significantly faster than reading byte-wise with ^T. * Performs EOL normalization unless specifying --8bit of course. * Significantly shortens command-lines. `sciteco -qio` and `sciteco -qi` can be real replacements for sed and awk. * You can even place SciTECO into the middle of a pipeline while editing interactively: foo | sciteco -qio --no-profile | bar Unfortunately, this will not currently work when munging the profile as command-line parameters are also transmitted via the unnamed buffer. This should be changed to use special Q-registers (FIXME). * --quiet can help to improve the test suite (TODO). Should probably be the default in TE_CHECK(). * --stdin and --stdout allow to simplify many SciTECO scripts, avoiding temporary files, especially for womenpage generation (TODO). * For processing potentially infinite streams, you will still have to read using ^T.
2025-08-02fixed serious bug with certain alternative string termination chars in ↵Robin Haberkorn1-8/+22
commands with multiple string arguments * When `@`-modifying a command with several string arguments and choosing `{` as the alternative string termination character, the parser would get totally confused. Any sequence of `{` would be ignored and only the first non-`{` would become the termination character. Consequently you also couldn't choose a new terminator after the closing `}`. So even a documented code example from sciteco(7) wouldn't work. The same was true when using $ (escape) or ^A as the alternative termination character. * We can now correctly parse e.g. `@FR{foo}{bar}` or `@FR$foo$bar$` (even though the latter one is quite pointless). * has probably been broken forever (has been broken even before v2.0). * Whitespace is now ignored in front of alternative termination characters as in TECO-64, so we can also write `@S /foo/` or even ``` @^Um { !* blabla *! } ``` I wanted to disallow whitespace termination characters, so the alternative would have been to throw an error. The new implementation at least adds some functionality. * Avoid redundancies when parsing no-op characters via teco_is_noop(). I assume that this is inlined and drawn into any jump-table what would be generated for the switch-statement in teco_state_start_input(). * Alternative termination characters are still case-folded, even if they are Unicode glyphs, so `@IЖfooж` would work and insert `foo`. This should perhaps be restricted to ANSI characters?
2025-08-01implemented the ^W command for refreshing the screen in loops, for sleeping ↵Robin Haberkorn1-0/+10
and also the CTRL+L immediate editing command * ^W can be added to loops in order to view progress in interactive mode. It also sleeps for a given number of milliseconds (10ms by default). * In batch mode it is therefore the sleep command. * Since CTRL+W is an immediate editing command, you will usually type it Caret+W. ASCII 23 however will also be accepted. * While ^W only updates the screen, you can force a complete redraw by pressing CTRL+L. This is what most terminal applications use for redrawing. It will make it harder to insert ASCII 12, but this is seldom necessary since it is a form feed. ^L (ASCII 12 and the upcaret variant ) is still a whitespace character and therefore treated as a NOP. * DEC TECO had CTRL+W as the refresh immediate editing command. Video TECO uses <ET> as a regular command for refreshign in loops. I'd rather keep ET reserved as a potential terminal configuration command as in DEC TECO, though.
2025-07-31added -v/--version and <EO> commandRobin Haberkorn1-0/+5
* DEC TECO had an <EO> command. In contrast to DEC TECO's implementation, the value reported by <EO> encodes a major.minor.micro semantic version.
2025-07-26implemented <:Gq> for printing the Q-Register string as a message instead of ↵Robin Haberkorn1-0/+12
inserting it
2025-07-21support <==> and <===> for printing octal and hexadecimal numbersRobin Haberkorn1-0/+4
* These are famously in DEC TECO-11, but also in Video TECO. * The implementation is tricky. They need to use lookahead states, but this would be inacceptable during interactive execution. Therefore only if executing from the end of the command line `==` and `===` are allowed to print multiple values. The number is therefore also not popped form the stack immediately but only peeked. It's popped only when it has been decided that the command has ended. * This may break existing macros that use multiple `=` in a row to print multiple values from the stack. You will now e.g. have to insert whitespace to separate such `=` commands.
2025-07-19special Q-registers `$` (working directory) and the clipboard registers now ↵Robin Haberkorn1-1/+0
support the append operation (:Xq, :^Uq...) Works via a default implementation in the "external" Q-register "class" by first querying the string, appending and re-setting it.
2025-07-16the primary clipboard is now chosen by the 10th bit in the ED flagsRobin Haberkorn1-8/+6
* `[q]~` was broken and resulted in crashes since it reset the clipboard character to 0. In fact, if we don't want to break the `[a]b` idiom we cannot use the numeric cell of register `~`. * Therefore we no longer use the numeric part of register `~`. Once the clipboard registers are initialized they completely replace any existing register with the same name that may have been set in the profile. So we still don't leak any memory. (But perhaps it would now be better to fail with an error if one of the clipboard registers already exist?) * Instead, bit 10 (1024) of ED is now used to change the default clipboard to the primary selection. The alternative might have been an EJ flag or even a special register containing the name of the default clipboard register. * partially reverses 8c6de6cc718debf44f6056a4c34c4fbb13bc5020
2025-07-13allow changing the default clipboard by setting the `~` integerRobin Haberkorn1-2/+9
* It continues to default to 67 (C), which is the system clipboard. But you can now overwrite it e.g. by adding `^^PU~` to the profile. * This fixes a minor memory leak: If you set one of the clipboard registers in the profile (initializing them as plain registers), the clipboard register had been leaked. The clipboard registers now replace any existing register, while at the same time preserving the numeric part. * All remaining Q-Reg table insertions use a new function teco_qreg_table_insert_unique() which adds an assertion, so that we notice any future possible memory leaks.
2025-07-11<EF> supports a numeric buffer id nowRobin Haberkorn1-2/+2
* ED hooks are not executed in this case * <EF> is now allowed even when editing a Q-Reg, unless you try to close the current buffer
2025-07-03implemented ^E<code> string building constructs for embedding bytes and ↵Robin Haberkorn1-0/+13
codepoints in a strtoul()-like manner
2025-06-27fixed an asterisk in the <EN> manpage entryRobin Haberkorn1-0/+1
* We have to avoid `/*` within comments, so one of the two characters will have to use a named glyph. \[**] is actually a special symbol, which wasn't noticed until supporting Unicode. There is no named glyph for the plain asterisk. Thus we now use \[sl] to escape the `/` character. `/\c*` might have also worked. * grosciteco now supports the `sl` glyph.
2025-05-24<EI> has been repurposed and is the macro file inclusion (indirect file) ↵Robin Haberkorn2-2/+2
command now * Improves DEC TECO-11 compatibility. * <EM> is still supported as a synonym, but considered deprecated and is no longer documented. A warning is printed when invoked. It can be repurposed at any time in the future. * `EI$` is not yet supported. I am unsure whether this makes any sense.
2025-05-24new string building construct ^P disables all further string building magicRobin Haberkorn1-0/+6
* Now, `I^P` can replace `EI`. EI is therefore now free to be repurposed as the new "mung file" command for improved TECO-11 compatibility. * On the downside when inserting large blocks of TECO code, you will have to write something like `@I{^P !...! }` * The construct is also useful when searching for carets as in `S^P^Q^`.
2025-05-18allow process exit status to be determined by macrosRobin Haberkorn1-1/+6
* Any value left on the numeric stack now determines the exit code. This ensures you can call n^C as the SciTECO version of exit(n). It will also work with n$$ in the top level macro. But you don't necessarily need any of these commands. * Could be useful in shell scripting as in `sciteco -e "@EB/file/ :@S/foo/\"F1'"` to fail `foo` is not found.
2025-05-18sciteco(7): added a help topic for booleansRobin Haberkorn1-0/+1
So you can lookup `?bool$` for instance.
2025-05-02grosciteco: folding in woman pagesRobin Haberkorn3-0/+64
* Support fold level configuration using `.SCITECO_FOLDLEVEL`. This sets the current output line as the fold header and all subsequent lines with the given fold level (until another `.SCITECO_FOLDLEVEL` instruction is encountered). * This is now done automatically for man's SH and SS macros, so the man-page based woman pages provide folding. * The folding margin is therefore now always enabled in fallback.teco_ini.
2025-04-23fixup: fixed monospace sections in womanpages when lexer.font is not ↵Robin Haberkorn1-2/+2
customized (refs #34) * In the grosciteco-generated .woman.tec files, the fonts were only set on the monospaced styles if lexer.font was set since it was undefined by default. We'd need a lare IF-ELSE statement to handle that in womanpages since woman.tes changes the default font to a variable-width font. Just leaving the default font, therefore won't work. * We now always initialize lexer.font in lexer.tes. You no longer have to check for its existance. * Consequently, you can no longer set lexer.font *before* munging lexer.tes because it will be overwritten. At least not without additional checks. Such a design is not suggested by fallback.teco_ini, though. * Fixes monospaced sections in the tutorial and other womanpages on Gtk.
2025-04-22Gtk: monospaced sections in womanpages now respect lexer.font and ↵Robin Haberkorn1-2/+2
variable-width font is configurable via lexer.woman.font (refs #34) * grosciteco was just hardcoding "Monospace", regardless of what was configured via lexer.font in ~/.teco_ini * The variable-width font used for ordinary "womanpage" body texts was hardcoded to "Serif". It is now configurable via the lexer.woman.font register. * There is a difference, though: lexer.font has no default value and must therefore be checked everywhere. This is so you can set it even before munging lexer.tes. lexer.woman.font however has a default (Serif), so it can only be overridden after munging lexer.tes. Perhaps it would be easier and more consistent to have a default for lexer.font as well.
2025-04-14sciteco(1): added EXAMPLES sectionRobin Haberkorn1-0/+49
2025-04-10testsuite: check whether comparisons for equality really work with the ↵Robin Haberkorn1-12/+16
`a-b"=` idiom * There might theoretically be problems with the uncommon one's complement or magnitude representation of negative integers, but it's practically impossible to meet those in the wild. * Still, we do some checks now, so we will at least notice any exotic architectures. * Also, documented the `a^#b"=` idiom for checking for equality. It's longer to type, but faster and will also work for floats. For floats it will be the only permissible idiom for checking for bitwise equality as `a-b` can be 0 even if a!=b (if the difference is very small). Changing the `-` semantics is out of the question.
2025-04-09tightened rules for specifying modifiersRobin Haberkorn1-3/+5
* Instead of separate stand-alone commands, they are now allowed only immediately in front of the commands that accept them. * The order is still insignificant if both `@` and `:` are accepted. * The number of colon modifiers is now also checked. We basically get this for free. * `@` has syntactic significance, so it could not be set conditionally anyway. Still, it was possible to provoke bugs were `@` was interpreted conditionally as in `@ 2<I/foo/$>`. * Even when not causing bugs, a mistyped `@` would often influence the __next__ command, causing unexpected behavior, for instance when typing `@(233C)W`. * While it was theoretically possible to set `:` conditionally, it could also be "passed through" accidentally to some command where it wasn't expected as in `:Ifoo$ C`. I do not know of any real useful application or idiom of a conditionally set `:`. If there would happen to be some kind of useful application, `:'` and `:|` could be re-allowed easily, though. * I was condidering introducing a common parser state for modified commands, but that would have been tricky and introduce a lot of redundant command lists. So instead, we now simply everywhere check for excess modifiers. To simplify this task, teco_machine_main_transition_t now contains flags signaling whether the transition is allowed with `@` or `:` modifiers set. It currently only has to be checked in the start state, after `E` and `F`.
2025-04-08improved rubbing out commands with modifiersRobin Haberkorn1-0/+2
* This was actually broken if the command is preceded by `@` and `:` characters, which are __not__ modifiers. E.g. `Q:@I/foo^W` would have rubbed out the `:` register as well. * Also, since it was all done in teco_state_process_edit_cmd(), it would also rub out modifier characters from within string arguments, E.g. `@I/::^EQ^W` * Real commands now have their own ^W rubout implementation, while the generic fallback just rubs out until the start state is re-established. This fails to rub out modifiers as in `@I/^W`, though. * Real command characters now use the common TECO_DEFINE_STATE_COMMAND(). * Added test cases for CTRL+W rub out. A few control characters are now portably available to tests via environment variables `$ESCAPE`, `$RUBOUT` and `$RUBOUT_WORD`.
2025-04-04avoid legacy implict rules in doc/Makefile.am: should fix clean buildsRobin Haberkorn1-3/+2
For some strange reason, Make wouldn't know how to get tutorial.ms. Replacing it with an equivalent `%` works flawlessly, though.
2025-04-04scroll caret __almost__ always automatically after key pressesRobin Haberkorn1-0/+4
* The old heuristics - scroll if dot changes after key press - turned out to be too simplistic. They broke the clang-format macro (M#cf), which left the view at the top of the document since the entire document is temporarily erased. Other simplified examples of this bug would be: @^Um{[: HECcat$ ]:} Mm Or even: @^Um{[: H@X.aG.a ]:} Mm * Actually, the heuristics could be tricked even without deleting any significant amount of text from the buffer. The following test case replaces the previous character with a linefeed in a single key press: @^Um{-DI^J$} Mm If executed on the last visible line, dot wouldn't be scrolled into the view since it did not change. * At the same time, we'd like to keep the existing mouse scroll behavior from fnkeys.tes, which is allowed to scroll dot outside of the visible area. Therefore, dot is scrolled into view always, except after mouse events. You may have to call SCI_SCROLLCARET manually in the ^KMOUSE macro, which is arguably not always straight forward. * Some macros like M#cf may still leave the vertical scrolling position in unexpected positions. This could either be fixed by eradicating all remaining automatic scrolling from Scintilla or by explicitly restoring the vertical position from the macro (FIXME). * This was broken since the introduction of mouse support, so it wasn't in v2.3.0.
2025-04-03the tutorial is now built along with all other HTML documents if ↵Robin Haberkorn1-2/+5
--enable-html-docs * `--enable-html-manual` renamed to `--enable-html-docs`. * It's also uploaded to the website and linked to in README.
2025-04-03tutorial: fixed excess space after example display blocks in some versions ↵Robin Haberkorn1-0/+6
of Groff
2025-03-31fixup: `make clean` removes tutorial.ms nowRobin Haberkorn1-6/+5
Fixes `make distcheck` and CI builds.
2025-03-31grosciteco: added the `oq` and `cq` glyphsRobin Haberkorn1-0/+2
This fixes building of the new tutorial.woman on Ubuntu.
2025-03-31fixup: actually distribute the new tutorial.ms.in fileRobin Haberkorn1-14/+7
2025-03-31added tutorial document, which is automatically loaded on the first invocationRobin Haberkorn3-0/+328
* This is rendered with ms, so we now need the entire groff on Debian. This is not a big deal as it just adds a few kilobytes of build-time dependencies. Most platforms do not allow installation of some "groff-base" package anyway and always draw in the entire package. * sciteco.tmac has been extended to disable page breaks on ms. * The tutorial is installed like any other woman page and can be invoked interactively with ?tutorial$. * It is optimized to be still usable on a plain 80x24 terminal.
2025-03-29^W also rubs out/in `@` and `:` modifiersRobin Haberkorn1-0/+3
* It makes little sense to e.g. rub out until `I` in `@I/foo/`, but leave the `@` modifier. Modifiers have to be considered part of the command, even though the state machine is not currently modelled like that.
2025-03-29added `@W`, `@P`, `@V` and `@Y` command variantsRobin Haberkorn1-2/+2
* They swap the default order of skipping characters. For positive arguments: first non-word chars, then word chars. * This is especially useful after executing the non-at-modified versions. For instance, at the beginning of a word, `@W` jumps to its end. `@V` would delete the remainder of the word. * Since they have to evaluate the at-modifier, which has syntactic significance, the command implementations can no longer use transition tables, so they are in the switch-statements instead.
2025-03-23grosciteco: fixed topic collectionRobin Haberkorn1-1/+1
* regression from 867d22e419afe769f05ad26b61c6ea5ea1432c3c
2025-03-23sciteco(7): fixed formatting of some tablesRobin Haberkorn1-4/+4
This was changed ages ago for some old version of Groff. These workarounds should no longer be necessary.
2025-03-23the ^W immediate editing command now mimics `Y` more closely and also rubs ↵Robin Haberkorn1-5/+3
out no-op commands (whitespace) * In string arguments, ^W first rubs out non-word chars (usually whitespace), so it makes sense if ^W would work analogously at the command level. A non-command would be one of the no-ops.
2025-03-22added `P` command as a reverse form of `W`Robin Haberkorn1-3/+10
* All the movement commands have shortcuts for their negative forms: `R` instead of `-C`, `B` instead of `-L`. Therefore there was always the need for a `-W` shortcut as well. * `P` is a good choice because it is a file IO command in TECO-11, that does not make sense supporting. In Video TECO it toggles between display windows (ie. split screens) and I do not plan to support multiple windows in SciTECO. * Added to the cheat sheet.
2025-03-22harmonized all word-movement and deletion commands: they move/delete until ↵Robin Haberkorn2-4/+5
the beginning of words now * All commands and their documentations were inconsistent. * ^W rubbed out to the beginning of words. * Shift+Right (fnkeys.tes) moved to the beginning of the next word if invoked at the beginning of a word and to the end of the next word otherwise. * <W> (and <V> and <Y> by extension) moved to the end of the next word. * The cheat sheet would claim that <W> moves to the beginning of the next word. * Video TECO's <W> command would differ again from everything else. With positive arguments, it moved to the beginning of words, while with negative it moved to end of words. I decided not to copy this behavior. * It has been decided to adopt a consistent beginning-of-words policy. -W therefore differs from Video TECO in moving to the beginning of the current or previous word. * teco_find_words() is now based on parsing the document pointer, instead of relying on SCI_WORDENDPOSITION, since the latter cannot actually be used to skip strictly non-word characters. This requires a constant amount of Scintilla messages but will require fewer messages only when moving for more than 3 words. * The semantics of <W> are therefore now consistent with Vim and Emacs as well. * Shift+Right/Left is still based on SCI_WORDENDPOSITION, so it's behavior differs slightly from <W> for instance at the end of lines, as it will stop at linebreaks. * Unfortunately, these changes will break lots of macros, among others the M#rf, M#sp and git.blame macros ("Useful macros" from the wiki).
2025-03-04grosciteco(1): fixed the exampleRobin Haberkorn1-2/+1
We don't need to specify the "woman.tec" output file as the default is sufficient. If it has to be specified, it's now done with `-t`.