aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
AgeCommit message (Collapse)AuthorFilesLines
2024-11-10updated grosciteco.tes(1): mention new macros, changed command lines and ↵Robin Haberkorn1-1/+15
restrictions
2024-11-10updated TODORobin Haberkorn1-0/+1
2024-11-10grosciteco: basic support for GNU pic graphicsRobin Haberkorn1-26/+52
* The line drawing algorithm currently works only with tbl, though. * Also only straight lines are currently supported. * This was meant for rendering presentations in SciTECO - it's not currently used or planned to be used in the manpages. Although we might well add pic graphics to the manpages in the future.
2024-11-10grosciteco: support .SCITECO_STARTSTYLING and .SCITECO_SETSTYLING macrosRobin Haberkorn2-1/+21
This could theoretically be used to apply Scintilla styles not natively and easily supported by grosciteco, eg. different fonts and font sizes.
2024-11-10grosciteco: added some more quote glyphsRobin Haberkorn1-0/+2
2024-11-07grosciteco: fixed the CuXXXX postprocessor command, ie. insertion of ↵Robin Haberkorn1-1/+1
characters by unicode, ie. typesetting of most non-latin text * This was broken at least for characters that happened to contain hexadecimal digits > 9 since "D does not detect hexadecimal digits.
2024-11-07grosciteco: fixed styling of multi-byte text (ie. non-latin characters)Robin Haberkorn1-1/+1
* We just passed the length in glyphs to SCI_SETSTYLING.
2024-10-16grosciteco: support glyphs.pcRobin Haberkorn1-0/+1
* This might fix builds on Ubuntu Bionic. I would have to make another minor release in order to try that out and push another Ubuntu PPA release. * Since the PPA is practically not used by anybody, it's not worth it.
2024-10-12grosciteco: added the "ti" glyph (refs #22)Robin Haberkorn1-0/+1
2024-10-11grosciteco: added the "ha" glyph (refs #22)Robin Haberkorn1-0/+1
2024-10-11grosciteco: added the "aq" glyph (refs #22)Robin Haberkorn1-0/+1
2024-10-08htbl.tes: fixed searching for caretRobin Haberkorn1-1/+1
* Due to recent changes, you now have to type S^Q^Q^^$ since the ASCII caret (94) is interpreted as a pattern match character.
2024-10-04pattern match characters support ^Q/^R now as wellRobin Haberkorn1-0/+8
* makes it possible, albeit cumbersome, to escape pattern match characters * For instance, to search for ^Q, you now have to type S^Q^Q^Q^Q$. To search for ^E you have to type S^Q^Q^Q^E$. But the last character cannot be typed with carets currently (FIXME?). For pattern-only characters, two ^Q should be sufficient as in S^Q^Q^X$. * Perhaps it would be more elegant to abolish the difference between string building and pattern matching characters to avoid double quoting. But then all string building constructs like ^EQq should operate at the pattern level as well (ie. match the contents of register q verbatim instead of being interpreted as a pattern). TECOC and TECO-64 don't do that either. If we leave everything as it is, at least a new string building construct should be added for auto-quoting patterns (analoguous to ^EN and ^E@).
2024-09-25inhibit some immediate editing commands after ^Q/^R string building constructsRobin Haberkorn1-0/+3
* This allows you to type ^Q^U (which would otherwise rub out the entire argument) and ^Q^W (which would otherwise rub out the ^Q). * ^Q^U coincidentally worked previously since the teco_state_stringbuilding_escaped state would default to teco_state_process_edit_cmd(). But it's better to make this feauture explicit. * This finally makes it possible to insert the ^W (23) char into a buffer. In interactive mode, you can still only type Caret+W as a string building construct. * ^G could also be inhibited after ^Q, but the control char is not used anywhere yet, so there is no point in doing that.
2024-09-23allow OSC-52 clipboards on all terminal emulatorsRobin Haberkorn1-7/+18
* The XTerm version is still checked if we detect running under XTerm. * Actually, the XTerm implementation is broken for Unicode clipboard contents. * Kitty supports OSC-52, but you __must__ enable read-clipboard. With read-clipboard-ask, there will be a timeout. But we cannot read without a timeout since otherwise we would hang indefinitely if the escape sequence turns out to not work. * For urxvt, I have hacked an existing extension: https://gist.github.com/rhaberkorn/d7406420b69841ebbcab97548e38b37d * st currently supports only setting the clipboard, but not querying it.
2024-09-20^W^W and ^V^V can be typed completely with upcarets now and they case fold ↵Robin Haberkorn1-1/+5
all expansions of ^EQq, ^EUq and so on * Previously, there was no way to enter upper-case mode in interactive commands since the Ctrl+W immediate editing command is interpreted everywhere. * Without the case folding of ^EQq/^EUq results, the upper and lower case modes are actually pretty useless considering that modern keyboards have caps lock. So it was clear we need this, regardless of what the classic TECOs did. The TECO-11 manual is not very clear on this. tecoc apparently does not case-fold ^EQq results. * This opens up new idioms, for instance `EUq^W^W^EQq$` in order to upper case register q. It's also the only way you can currently upper-case Unicode codepoints.
2024-09-19Ctrl+^ is no longer translated to a single caret in string building (refs #20)Robin Haberkorn1-1/+3
* Ctrl+^ (30) and Caret+caret (^^) were both translated to a single caret. While there might be some reason to keep this behavior for double-caret, it is certainly pointless for Ctrl+^. * That gives you an easy way to insert Ctrl+^ (code 30) into documents with <I>. Perviously, you either had to insert a double-caret, typing 4 carets in a row, or you had to use <EI> or 30I$. * The special handling of double-caret could perhaps be abolished altogether, as we also have ^Q^ to escape plain carets. The double-caret syntax is very archaic from the time that there was no proper ^Q as far as I recall correctly.
2024-09-17sciteco(7): mentioned "[a]b" idiomRobin Haberkorn1-1/+2
2024-09-17updated cheat sheetRobin Haberkorn1-8/+17
* character-based model, avoid mentioning "ASCII code" * added "0EE" example * should be built with pdfmom, so it's built with gropdf
2024-09-16updated lists of external links in sciteco(1) and sciteco(7)Robin Haberkorn2-18/+9
* Unfortunately, the list in sciteco(7) does not format with FreeBSD's man or within SciTECO. * Removed references to the old sciteco.sf.net. We don't have a proper "homepage" for the time being.
2024-09-16Curses: added support for cool Unicode icons (refs #5)Robin Haberkorn1-0/+6
* Practically requires one of the "Nerd Font" fonts, so it's disabled by default. Add 0,512ED to the profile to enable them. * The new ED flag could be used to control Gtk icons as well, but they are left always-enabled for the time being. Is there any reason anybody would like to disable icons in Gtk? * The list of icons has been adapted and extended from exa: https://github.com/ogham/exa/blob/master/src/output/icons.rs * The icons are hardcoded as presorted lists, so we can binary search them. This could change in the future. If there is any demand, they could be made configurable via Q-Registers as well.
2024-09-12function key macros have been reworked into a more generic key macro featureRobin Haberkorn1-99/+133
* ALL keypresses (the UTF-8 sequences resulting from key presses) can now be remapped. * This is especially useful with Unicode support, as you might want to alias international characters to their corresponding latin form in the start state, so you don't have to change keyboard layouts so often. This is done automatically in Gtk, where we have hardware key press information, but has to be done with key macros in Curses. There is a new key mask 4 (bit 3) for that purpose now. * Also, you might want to define non-ANSI letters to perform special functions in the start state where it won't be accepted by the parser anyway. Suppose you have a macro M→, you could define @^U[^K→]{m→} 1^_U[^K→] This effectively "extends" the parser and allow you to call macro "→" by a single key press. See also #5. * The register prefix has been changed from ^F (for function) to ^K (for key). This is the only thing you have to change in order to migrate existing function key macros. * Key macros are enabled by default. There is no longer any way to disable function key handling in curses, as I never found any reason or need to disable it. Theoretically, the default ESCDELAY could turn out to be too small and function keys don't get through. I doubt that's possible unless on extremely slow serial lines. Even then, you'd have to increase ESCDELAY and instead of disabling function keys simply define an escape surrogate. * The ED flag has been removed and its place is reserved for a future mouse support flag (which does make sense to disable in curses sometimes). fnkeys.tes is consequently also enabled by default in sample.teco_ini. * Key macros are handled as an unit. If one character results in an error, the entire string is rubbed out. This fixes the "CLOSE" key on Gtk. It also makes sure that the original error message is preserved and not overwritten by some subsequent syntax error. It was never useful that we kept inserting characters after the first error.
2024-09-11the SciTECO parser is Unicode-based now (refs #5)Robin Haberkorn1-6/+14
The following rules apply: * All SciTECO macros __must__ be in valid UTF-8, regardless of the the register's configured encoding. This is checked against before execution, so we can use glib's non-validating UTF-8 API afterwards. * Things will inevitably get slower as we have to validate all macros first and convert to gunichar for each and every character passed into the parser. As an optimization, it may make sense to have our own inlineable version of g_utf8_get_char() (TODO). Also, Unicode glyphs in syntactically significant positions may be case-folded - just like ASCII chars were. This is is of course slower than case folding ASCII. The impact of this should be measured and perhaps we should restrict case folding to a-z via teco_ascii_toupper(). * The language itself does not use any non-ANSI characters, so you don't have to use UTF-8 characters. * Wherever the parser expects a single character, it will now accept an arbitrary Unicode/UTF-8 glyph as well. In other words, you can call macros like M§ instead of having to write M[§]. You can also get the codepoint of any Unicode character with ^^x. Pressing an Unicode character in the start state or in Ex and Fx will now give a sane error message. * When pressing a key which produces a multi-byte UTF-8 sequence, the character gets translated back and forth multiple times: 1. It's converted to an UTF-8 string, either buffered or by IME methods (Gtk). On Curses we could directly get a wide char using wget_wch(), but it's not currently used, so we don't depend on widechar curses. 2. Parsed into gunichar for passing into the edit command callbacks. This also validates the codepoint - everything later on can assume valid codepoints and valid UTF-8 strings. 3. Once the edit command handling decides to insert the key into the command line, it is serialized back into an UTF-8 string as the command line macro has to be in UTF-8 (like all other macros). 4. The parser reads back gunichars without validation for passing into the parser callbacks. * Flickering in the Curses UI and Pango warnings in Gtk, due to incompletely inserted and displayed UTF-8 sequences, are now fixed.
2024-09-09grosciteco.tes manpage: fixed formatting of list of troff macrosRobin Haberkorn1-1/+0
2024-09-09added raw ANSI mode to facilitate 8-bit clean editing (refs #5)Robin Haberkorn2-1/+13
* When enabled with bit 2 in the ED flags (0,4ED), all registers and buffers will get the raw ANSI encoding (as if 0EE had been called on them). You can still manually change the encoding, eg. by calling 65001EE afterwards. * Also the ANSI mode sets up character representations for all bytes >= 0x80. This is currently done only depending on the ED flag, not when setting 0EE. * Since setting 16,4ED for 8-bit clean editing in a macro can be tricky - the default unnamed buffer will still be at UTF-8 and at least a bunch of environment registers as well - we added the command line option `--8bit` (short `-8`) which configures the ED flags very early on. As another advantage you can mung the profile in 8-bit mode as well when using SciTECO as a sort of interactive hex editor. * Disable UTF-8 checks in 8-bit clean mode (sample.teco_ini).
2024-09-09updated README and sciteco(7) with information about Unicode support (refs #5)Robin Haberkorn1-8/+28
2024-09-09the ^EUq string building escape now respects the encoding (can insert bytes ↵Robin Haberkorn1-0/+6
or codepoints) (refs #5) * This is trickier than it sounds because there isn't one single place to consult. It depends on the context. If the string argument relates to buffer contents - as in <I>, <S>, <FR> etc. - the buffer's encoding is consulted. If it goes into a register (EU), the register's encoding is consulted. Everything else (O, EN, EC, ES...) expects only Unicode codepoints. * This is communicated through a new field teco_machine_stringbuilding_t::codepage which must be set in the states' initial callback. * Seems overkill just for ^EUq, but it can be used for context-sensitive processing of all the other string building constructs as well. * ^V and ^W cannot be supported for Unicode characters for the time being without an Unicode-aware parser
2024-09-09conditionals now check for Unicode codepoints (refs #5)Robin Haberkorn1-6/+6
* This will naturally work with both ASCII characters and various non-English scripts. * Unfortunately, it cannot work with the other non-ANSI single-byte codepages. * If we'd like to support scripts working with all sorts of codepoints, we'd have to introduce a new command for translating individual codepoints from the current codepage (as reported by EE) to Unicode.
2024-09-09grosciteco: support Unicode (refs #5)Robin Haberkorn2-28/+46
* All manpages are processed with the "utf8" device and with preconv. Manpage sources can contain Unicode glyphs now. * grosciteco supports CuXXXX and N commands now * Lines are drawn with Unicode box characters now. This works at least with tbl and -Tutf8. It's probably still too simplistic for pic graphics. * The topic list at the top of .woman.tec contain byte offsets, so that we don't need glyphs2bytes conversion when looking up topics.
2024-02-06avoid Groff warnings due to `\` escapesRobin Haberkorn1-1/+1
* It's generally a bad idea to pass backslashes as a glyph in macro arguments, even as `\\` since this could easily be interpreted as an escape. * Instead we now always use `\[rs]`.
2024-02-03GTK: allow disabling client-side decorations by setting $GTK_CSD=0Robin Haberkorn1-0/+4
* This is the same variable used by gtk3-nocsd, but we will now work even without preloading any libraries. Also, it turns out that gtk3-nocsd does not ship as a FreeBSD port and hasn't been updated in a long time. * Setting this in .teco_ini wouldn't have been easy since the teco_interface_init() is called before any TECO code. Also, you might not even want disable this globally but depending on the window manager. * Therefore, you are advised to `export GTK_CSD=0` in ~/.xsession. * The --no-csd command line option is kept for the time being, but probably serves no more purpose.
2024-01-20removed nonsensical line from sciteco(7) man pageRobin Haberkorn1-1/+0
* was introduced in e7867fb0
2023-07-02cheat-sheet.mm: minor improvementsRobin Haberkorn1-3/+2
2023-06-28added cheat sheetRobin Haberkorn2-0/+817
* This is supposed to allow new users without any prior exposure to SciTECO to pick up the basics of practical usage of SciTECO as an editor. It almost does not elaborate on scripting-side of things. * This requires a full Groff installation, so the document is not built by default.
2023-06-19the SciTECO data installation path is now configurable via --with-scitecodatadirRobin Haberkorn4-7/+7
* This is also the base of $SCITECOPATH. * Changing it is useful for packaging where it is not possible to factor out the common files between Curses and Gtk builds into a "sciteco-common" package. As an alternative, you can now create disjunct sciteco-curses and sciteco-gtk packages. * You will most likely want to use this for Gtk builds as in: --with-interface=gtk --program-prefix=g --with-scitecodatadir=/usr/local/share/gsciteco.
2023-04-05Troff documents: fixed monospaced example blocksRobin Haberkorn3-15/+15
* .SCITECO_TT should be before .EX, so that the indent is already monospaced. .SCITECO_TT_END still needs to be before .EE however, so that the next non-monospaced line is not "typeset" with a monospaced indent. * naturally only affects the Gtk UI
2023-04-05default font is now "Monospace" instead of CourierRobin Haberkorn1-2/+2
* Courier has the quirk that letter sequences like "fi" are turned into ligatures which breaks the monospaced nature of the display. * We assume that "Monospace" is also more portable, although it hasn't yet been tested on Windows. * only relevant for the Gtk UI of course * It might be a good idea to set SCI_STYLESETCHECKMONOSPACED as well (FIXME?)
2023-04-05sciteco.tmac: also set the LL register (refs #11)Robin Haberkorn1-1/+5
* Hopefully disables paragraph breaking in newer Groff versions, but needs to be tested.
2023-04-05fixed grosciteco for newer Groff versions (refs #11)Robin Haberkorn1-0/+1
* The intermediate output of Groff will contain `t` commands before the font 1 is defined which we interpret as the default font. We therefore hardcode the default-font position to 1 by default - it won't change anyway.
2022-12-10fixed pass-through loops: especially :> and :F<Robin Haberkorn1-5/+5
* fixes test cases like 3<%a:> * you can now use :F< in pass-through loops as well * F> outside of loops will now exit the current macro level. This is analogous to what TECO-11 did. In interactive mode, F> is currently also equivalent to $$ (terminates command line).
2022-12-01sciteco(1) manpage: All UIs support ^C interruptions nowRobin Haberkorn1-2/+1
2021-06-08all SciTECO scripts used during the build process now always write files ↵Robin Haberkorn3-4/+4
with Unix linebreaks * when hosted on Windows, the default is DOS linebreaks * Unix linebreaks are in many cases more consistent as all other sources use Unix linebreaks * woman pages with Unix linebreaks are slightly faster to load due to EOL conversion * especially Groff input must not contain CR as it will otherwise log lots of warnings (affects htbl.tes and tedoc.tes).
2021-06-08Windows: normalize $COMSPECRobin Haberkorn1-3/+7
* Environment variables are case insensitive on Windows while SciTECO variables are case sensitive. We must therefore make sure that we first unset any $COMSPEC or $ComSpec from the environment before resetting it, thereby fixing its case. * Fixes command execution via <EC> on systems where the variable was not called $ComSpec.
2021-05-30updated Doxyfile.in with Doxygen 1.8.17Robin Haberkorn1-77/+186
* There are currently build errors with the message "fatal: ambiguous argument 'graph_legend.dox': unknown revision or path not in the working tree." But it does not seem to affect the overall result and "make devdoc" does not fail.
2021-05-30THE GREAT CEEIFICATION EVENTRobin Haberkorn4-46/+40
This is a total conversion of SciTECO to plain C (GNU C11). The chance was taken to improve a lot of internal datastructures, fix fundamental bugs and lay the foundations of future features. The GTK user interface is now in an useable state! All changes have been squashed together. The language itself has almost not changed at all, except for: * Detection of string terminators (usually Escape) now takes the string building characters into account. A string is only terminated outside of string building characters. In other words, you can now for instance write I^EQ[Hello$world]$ This removes one of the last bits of shellisms which is out of place in SciTECO where no tokenization/lexing is performed. Consequently, the current termination character can also be escaped using ^Q/^R. This is used by auto completions to make sure that strings are inserted verbatim and without unwanted sideeffects. * All strings can now safely contain null-characters (see also: 8-bit cleanliness). The null-character itself (^@) is not (yet) a valid SciTECO command, though. An incomplete list of changes: * We got rid of the BSD headers for RB trees and lists/queues. The problem with them was that they used a form of metaprogramming only to gain a bit of type safety. It also resulted in less readble code. This was a C++ desease. The new code avoids metaprogramming only to gain type safety. The BSD tree.h has been replaced by rb3ptr by Jens Stimpfle (https://github.com/jstimpfle/rb3ptr). This implementation is also more memory efficient than BSD's. The BSD list.h and queue.h has been replaced with a custom src/list.h. * Fixed crashes, performance issues and compatibility issues with the Gtk 3 User Interface. It is now more or less ready for general use. The GDK lock is no longer used to avoid using deprecated functions. On the downside, the new implementation (driving the Gtk event loop stepwise) is even slower than the old one. A few glitches remain (see TODO), but it is hoped that they will be resolved by the Scintilla update which will be performed soon. * A lot of program units have been split up, so they are shorter and easier to maintain: core-commands.c, qreg-commands.c, goto-commands.c, file-utils.h. * Parser states are simply structs of callbacks now. They still use a kind of polymorphy using a preprocessor trick. TECO_DEFINE_STATE() takes an initializer list that will be merged with the default list of field initializers. To "subclass" states, you can simply define new macros that add initializers to existing macros. * Parsers no longer have a "transitions" table but the input_cb() may use switch-case statements. There are also teco_machine_main_transition_t now which can be used to implement simple transitions. Additionally, you can specify functions to execute during transitions. This largely avoids long switch-case-statements. * Parsers are embeddable/reusable now, at least in parse-only mode. This does not currently bring any advantages but may later be used to write a Scintilla lexer for TECO syntax highlighting. Once parsers are fully embeddable, it will also be possible to run TECO macros in a kind of coroutine which would allow them to process string arguments in real time. * undo.[ch] still uses metaprogramming extensively but via the C preprocessor of course. On the downside, most undo token generators must be initiated explicitly (theoretically we could have used embedded functions / trampolines to instantiate automatically but this has turned out to be dangereous). There is a TECO_DEFINE_UNDO_CALL() to generate closures for arbitrary functions now (ie. to call an arbitrary function at undo-time). This simplified a lot of code and is much shorter than manually pushing undo tokens in many cases. * Instead of the ridiculous C++ Curiously Recurring Template Pattern to achieve static polymorphy for user interface implementations, we now simply declare all functions to implement in interface.h and link in the implementations. This is possible since we no longer hace to define interface subclasses (all state is static variables in the interface's *.c files). * Headers are now significantly shorter than in C++ since we can often hide more of our "class" implementations. * Memory counting is based on dlmalloc for most platforms now. Unfortunately, there is no malloc implementation that provides an efficient constant-time memory counter that is guaranteed to decrease when freeing memory. But since we use a defined malloc implementation now, malloc_usable_size() can be used safely for tracking memory use. malloc() replacement is very tricky on Windows, so we use a poll thread on Windows. This can also be enabled on other supported platforms using --disable-malloc-replacement. All in all, I'm still not pleased with the state of memory limiting. It is a mess. * Error handling uses GError now. This has the advantage that the GError codes can be reused once we support error catching in the SciTECO language. * Added a few more test suite cases. * Haiku is no longer supported as builds are instable and I did not manage to debug them - quite possibly Haiku bugs were responsible. * Glib v2.44 or later are now required. The GTK UI requires Gtk+ v3.12 or later now. The GtkFlowBox fallback and sciteco-wrapper workaround are no longer required. * We now extensively use the GCC/Clang-specific g_auto feature (automatic deallocations when leaving the current code block). * Updated copyright to 2021. SciTECO has been in continuous development, even though there have been no commits since 2018. * Since these changes are so significant, the target release has been set to v2.0. It is planned that beginning with v3.0, the language will be kept stable.
2017-03-25some minor Doxygen documentation improvementsRobin Haberkorn1-1/+1
* avoid warnings * make sure Doxygen finds RBEntryOwnString * it would be nice to strip the top level `SciTECO` namespace but this is not supported without some macro magic that ommit the namespace declaration when processing with Doxygen.
2017-03-25updated Doxyfile to suppress some Doxygen warningsRobin Haberkorn1-148/+261
* automatic conversion with `doxygen -u`
2017-03-250,8ED: Automatic case-folding of commandsRobin Haberkorn1-0/+17
* when enabled, it will automatically upper-case all one or two letter commands (which are case insensitive). * also affects the up-carret control commands, so they when inserted they look more like real control commands. * specifically does not affect case-insensitive Q-Register specifications * the result are command lines that are better readable and conform to the coding style used in SciTECO's standard library. This eases reusing command lines as well. * Consequently, string-building and pattern match characters should be case-folded as well, but they aren't currently since State::process_edit_cmd() does not have sufficient insight into the MicroStateMachines. Also, it could not be delegated to the MicroStateMachines. Perhaps they should be abandoned in favour of embeddedable regular state machines; or regular state machines with a stack of return states?
2017-03-03build system portability fixesRobin Haberkorn1-11/+11
* especially to improve building on FreeBSD 11 * We need GNU Make, yet alone because Scintilla/Scinterm needs it. We now document that dependency and added an Autoconf check from the autoconf-archive. We make sure that the build process is invoked with GNU make by generating only GNUmakefiles. The Makefile.am files have not been renamed, so this change can be rolled back easily. * Some GNU-Make-specific autoreconf warnings have still been resolved. But not all of them, as this would have been unelegant and we need GNU Make anyway. * Declare ACLOCAL_AMFLAGS to appease autoreconf * Added an explicit check for C++11 from the autoconf-archives. In general we should support building with every C++11 compiler that is sufficiently GNU-like. * Do not use `sed` for inplace editing, as different sed-implementations have mutually incompatible syntax for this. Instead of declaring and checking a dependency on GNU sed, we simply use SciTECO for the editing task. This improves code portability on BSDs. * Similarily, BSD/POSIX `cmp` is supported now. This fixes the test suite on BSD without declaring a dependency on the GNU coreutils. * Simplified sciteco-wrapper generation.
2017-02-26more fixes for groff v1.19Robin Haberkorn2-5/+5
* fixes manpages, Groff warnings and building womanpages for older Groff versions. Groff v1.19 is in use eg. on FreeBSD 11. * tbl v1.19 has different column specifiers than on later versions. `X` cannot be used for expanded columns in these Groff versions.