<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sciteco/src/cmdline.h, branch v2.5.2</title>
<subtitle>Scintilla-based Text Editor and COrrector</subtitle>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/'/>
<entry>
<title>updated copyright to 2026</title>
<updated>2026-01-01T06:59:49+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2026-01-01T06:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=c2feb2a6f71fc9adb20226fb3c2260c236e974e0'/>
<id>c2feb2a6f71fc9adb20226fb3c2260c236e974e0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>TECO_DEFINE_STATE() no longer constructs callback names for mandatory callbacks, but tries to use static assertions</title>
<updated>2025-12-26T17:10:42+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2025-12-26T17:10:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=c2114fa0af73b42bc1ef302f7511ef87690cc0b1'/>
<id>c2114fa0af73b42bc1ef302f7511ef87690cc0b1</id>
<content type='text'>
* Requiring state callbacks by generating their names (e.g. NAME##_input) has several disadvantages:
  * The callback is not explicitly referenced when the state is defined.
    So an unintroduced reader will see some static function, which is nowhere referenced and still
    doesn't cause "unused" warnings.
  * You cannot choose the name of function that implements the callback freely.
  * In "substates" you need to generate a callback function if you want to provide a default.
    You also need to provide dummy wrapper functions whenever you want to reuse some existing
    function as the implementation.
* Instead, we are now using static assertions to check whether certain callbacks have been
  implemented.
  Unfortunately, this does not work on all compilers. In particular GCC won't consider
  references to state objects fully constant (even though they are) and does not allow
  them in _Static_assert (G_STATIC_ASSERT). This could only be made to work in newer GCC
  with -std=c2x or -std=gnu23 in combination with constexpr.
  It does work on Clang, though.
  So I introduced TECO_ASSERT_SAFE() which also passes if the expression is *not* constant.
  These static assertions are not crucial - they do not check anything that can differ between
  systems. So we can always rely on the checks performed by FreeBSD CI for instance.
  Also, you will of course quickly notice missing callbacks at runtime - with and without
  additional runtime assertions.
* All mandatory callbacks must still be explicitly initialized in the TECO_DEFINE_STATE calls.
* After getting rid of generated callback implementations, the TECO_DEFINE_STATE macros
  can finally be qualified with `static`.
* The TECO_DECLARE_STATE() macro has been removed. It no longer abstracts anything
  and cannot be used to declare static teco_state_t anyway.
  Also TECO_DEFINE_UNDO_CALL() also doesn't have a DECLARE counterpart.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Requiring state callbacks by generating their names (e.g. NAME##_input) has several disadvantages:
  * The callback is not explicitly referenced when the state is defined.
    So an unintroduced reader will see some static function, which is nowhere referenced and still
    doesn't cause "unused" warnings.
  * You cannot choose the name of function that implements the callback freely.
  * In "substates" you need to generate a callback function if you want to provide a default.
    You also need to provide dummy wrapper functions whenever you want to reuse some existing
    function as the implementation.
* Instead, we are now using static assertions to check whether certain callbacks have been
  implemented.
  Unfortunately, this does not work on all compilers. In particular GCC won't consider
  references to state objects fully constant (even though they are) and does not allow
  them in _Static_assert (G_STATIC_ASSERT). This could only be made to work in newer GCC
  with -std=c2x or -std=gnu23 in combination with constexpr.
  It does work on Clang, though.
  So I introduced TECO_ASSERT_SAFE() which also passes if the expression is *not* constant.
  These static assertions are not crucial - they do not check anything that can differ between
  systems. So we can always rely on the checks performed by FreeBSD CI for instance.
  Also, you will of course quickly notice missing callbacks at runtime - with and without
  additional runtime assertions.
* All mandatory callbacks must still be explicitly initialized in the TECO_DEFINE_STATE calls.
* After getting rid of generated callback implementations, the TECO_DEFINE_STATE macros
  can finally be qualified with `static`.
* The TECO_DECLARE_STATE() macro has been removed. It no longer abstracts anything
  and cannot be used to declare static teco_state_t anyway.
  Also TECO_DEFINE_UNDO_CALL() also doesn't have a DECLARE counterpart.
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed scrolling the command line after clicking in the popup</title>
<updated>2025-11-21T21:39:01+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2025-11-21T21:39:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=4aaff7294131552be8c731e2f4d230106a1149f7'/>
<id>4aaff7294131552be8c731e2f4d230106a1149f7</id>
<content type='text'>
We cannot rely on the central teco_cmdline_update() call per keypress
in this case.
The analogous call was removed in 4e6ddd6c329d56055a732c6344df019f0d997aaf,
so this was a recent regression.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We cannot rely on the central teco_cmdline_update() call per keypress
in this case.
The analogous call was removed in 4e6ddd6c329d56055a732c6344df019f0d997aaf,
so this was a recent regression.
</pre>
</div>
</content>
</entry>
<entry>
<title>allow configuring the command line height using h,5EJ</title>
<updated>2025-11-09T18:26:37+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2025-11-09T18:26:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=5d7e8df952b2e51c28fad3443d7c9973659fc2ed'/>
<id>5d7e8df952b2e51c28fad3443d7c9973659fc2ed</id>
<content type='text'>
* This allows for several customizations.
  * You can simply increase the visible command line history.
    For that you must also set SCI_SETWRAPMODE(SC_WRAP_CHAR).
    An example was added to fallback.teco_ini.
  * You could also set SCI_SETLINEENDTYPESALLOWED(SC_LINE_END_TYPE_DEFAULT)
    to see the structure of inserted text.
* Alternatively we could have introduced a new command like EP or FW
  and also overload it to replace the current ED&amp;2048 (e.g. -EP and EP).
  In DEC TECO `W` comes closest to what 5EJ now does.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* This allows for several customizations.
  * You can simply increase the visible command line history.
    For that you must also set SCI_SETWRAPMODE(SC_WRAP_CHAR).
    An example was added to fallback.teco_ini.
  * You could also set SCI_SETLINEENDTYPESALLOWED(SC_LINE_END_TYPE_DEFAULT)
    to see the structure of inserted text.
* Alternatively we could have introduced a new command like EP or FW
  and also overload it to replace the current ED&amp;2048 (e.g. -EP and EP).
  In DEC TECO `W` comes closest to what 5EJ now does.
</pre>
</div>
</content>
</entry>
<entry>
<title>the command line macro is now managed by a Scintilla view</title>
<updated>2025-11-08T12:00:47+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2025-11-07T20:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=4e6ddd6c329d56055a732c6344df019f0d997aaf'/>
<id>4e6ddd6c329d56055a732c6344df019f0d997aaf</id>
<content type='text'>
* Instead of rendering a teco_string_t into a Scintilla view (GTK)
  and an ncurses window (Curses), it is now a Scintilla view and document
  that is modified directly.
* Reduces redundancies between GTK and Curses UIs.
* It will be more efficient on very large command lines, especially on GTK.
* We can now redirect Scintilla messages to the command line view in order
  to configure syntax highlighting, the margin, rubout indicator style and
  scroll behavior (TODO).
* This will also simplify the configuration of multi-line command lines (TODO).
* Since INDIC_PLAIN is not supported by Scinterm, rubbed out command lines
  are now styled with INDIC_STRAIGHTBOX (background color).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Instead of rendering a teco_string_t into a Scintilla view (GTK)
  and an ncurses window (Curses), it is now a Scintilla view and document
  that is modified directly.
* Reduces redundancies between GTK and Curses UIs.
* It will be more efficient on very large command lines, especially on GTK.
* We can now redirect Scintilla messages to the command line view in order
  to configure syntax highlighting, the margin, rubout indicator style and
  scroll behavior (TODO).
* This will also simplify the configuration of multi-line command lines (TODO).
* Since INDIC_PLAIN is not supported by Scinterm, rubbed out command lines
  are now styled with INDIC_STRAIGHTBOX (background color).
</pre>
</div>
</content>
</entry>
<entry>
<title>`ED&amp;2` can be used to access the program termination flag now</title>
<updated>2025-07-27T23:41:33+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-07-27T23:41:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=86fbf212de71a83e7bb4d83a4b33e54bed52dff9'/>
<id>86fbf212de71a83e7bb4d83a4b33e54bed52dff9</id>
<content type='text'>
* `0,2ED` is roughly equivalent to `-EX`
* `ED&amp;2` can be used to query whether EX has been run.
  This is useful if macros can run EX.
* `2,0ED` could be used to cancel the effect of EX.
* But the real motivation is for implementing a REPL script.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* `0,2ED` is roughly equivalent to `-EX`
* `ED&amp;2` can be used to query whether EX has been run.
  This is useful if macros can run EX.
* `2,0ED` could be used to cancel the effect of EX.
* But the real motivation is for implementing a REPL script.
</pre>
</div>
</content>
</entry>
<entry>
<title>=/==/===: fixed detection of execution from the end of the command-line</title>
<updated>2025-07-27T22:35:42+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-07-27T22:35:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=afc50684cdb38815573fdff0f4fff47cc4eb00a8'/>
<id>afc50684cdb38815573fdff0f4fff47cc4eb00a8</id>
<content type='text'>
In particular, fixes the test case `3&lt;255=&gt;` which would print
only one number in interactive mode.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In particular, fixes the test case `3&lt;255=&gt;` which would print
only one number in interactive mode.
</pre>
</div>
</content>
</entry>
<entry>
<title>discriminate against interactive-only codepaths in the imlementation of =/==/===</title>
<updated>2025-07-21T14:15:58+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-07-21T14:08:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=dd8f6f3fe80fc8d59a9d8b2927cfb443912eee6c'/>
<id>dd8f6f3fe80fc8d59a9d8b2927cfb443912eee6c</id>
<content type='text'>
Small slow downs will not be noticable for interactively executed commands,
so we can well discriminate (G_UNLIKELY) against such code paths.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Small slow downs will not be noticable for interactively executed commands,
so we can well discriminate (G_UNLIKELY) against such code paths.
</pre>
</div>
</content>
</entry>
<entry>
<title>support &lt;==&gt; and &lt;===&gt; for printing octal and hexadecimal numbers</title>
<updated>2025-07-20T21:33:13+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-07-20T21:19:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=48dcfd22f9c2db5cf6745eaec0ff28895858c638'/>
<id>48dcfd22f9c2db5cf6745eaec0ff28895858c638</id>
<content type='text'>
* 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>updated copyright to 2025</title>
<updated>2025-01-12T23:39:34+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-01-12T23:39:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=d842eaee19e2723f845d4b8314a230cf68e82653'/>
<id>d842eaee19e2723f845d4b8314a230cf68e82653</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
