<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sciteco/src/qreg.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>the computed go-to command (O) is now 0-indexed and all invalid indexes and empty labels are ignored</title>
<updated>2025-08-30T17:51:39+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-08-30T17:38:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=e82dc6639e829490cb11267fa4a49ef97c6459ae'/>
<id>e82dc6639e829490cb11267fa4a49ef97c6459ae</id>
<content type='text'>
* 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>implemented the &lt;^A&gt; command for printing arbitrary strings</title>
<updated>2025-07-25T21:42:15+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-07-24T22:41:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=eee669a76b3c0b1928475d55d9e1333b3d15bb8c'/>
<id>eee669a76b3c0b1928475d55d9e1333b3d15bb8c</id>
<content type='text'>
* Greatly improved usability as a scripting language.
* The command is in DEC TECO, but in contrast to DEC TECO, we also
  support string building constructs in ^A.
* Required some refactoring: As we want it to write everything verbatim
  to stdout, the per-interface method is now teco_interface_msg_literal()
  and it has to deal with unprintable characters.
  When displaying in the UI, we use teco_curses_format_str() and TecoGtkLabel
  functions/widgets to deal with possible control codes.
* Numbers printed with `=` have to be written with a trailing linefeed,
  which would also be visible as a reverse "LF" in the UI.
  Not sure whether this is acceptable - the alternative would be to strip
  the strings before displaying them.
* Messages written to stdout are also auto-flushed at the moment.
  In the future we might want to put flushing under control of the language.
  Perhaps :^A could inhibit the flushing.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Greatly improved usability as a scripting language.
* The command is in DEC TECO, but in contrast to DEC TECO, we also
  support string building constructs in ^A.
* Required some refactoring: As we want it to write everything verbatim
  to stdout, the per-interface method is now teco_interface_msg_literal()
  and it has to deal with unprintable characters.
  When displaying in the UI, we use teco_curses_format_str() and TecoGtkLabel
  functions/widgets to deal with possible control codes.
* Numbers printed with `=` have to be written with a trailing linefeed,
  which would also be visible as a reverse "LF" in the UI.
  Not sure whether this is acceptable - the alternative would be to strip
  the strings before displaying them.
* Messages written to stdout are also auto-flushed at the moment.
  In the future we might want to put flushing under control of the language.
  Perhaps :^A could inhibit the flushing.
</pre>
</div>
</content>
</entry>
<entry>
<title>the primary clipboard is now chosen by the 10th bit in the ED flags</title>
<updated>2025-07-15T21:15:33+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-07-15T21:15:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=4794367ce0c31f820bf2bd72d44c886984e3f7ed'/>
<id>4794367ce0c31f820bf2bd72d44c886984e3f7ed</id>
<content type='text'>
* `[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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* `[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
</pre>
</div>
</content>
</entry>
<entry>
<title>allow changing the default clipboard by setting the `~` integer</title>
<updated>2025-07-12T21:53:58+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-07-12T21:53:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=8c6de6cc718debf44f6056a4c34c4fbb13bc5020'/>
<id>8c6de6cc718debf44f6056a4c34c4fbb13bc5020</id>
<content type='text'>
* 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed rubout of Q-Register specifications</title>
<updated>2025-03-21T10:40:52+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-03-21T10:26:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=33f71654136014bac094babaaa81d91245fdd24c'/>
<id>33f71654136014bac094babaaa81d91245fdd24c</id>
<content type='text'>
* This was a regression introduced by 257a0bf128e109442dce91c4aaa1d97fed17ad1a.
* The undo token that frees newly allocated teco_machine_qregspec_t must actually
  reset the pointer as well since any subsequent token, pushed by teco_undo_qregspec_own(),
  will expect a valid pointer.
* Could have been done via
  ctx-&gt;expectqreg = NULL;
  teco_undo_qregspec_own(ctx-&gt;expectqreg);
  but using a special clear function requires less memory and is easier to understand.
* Added test case. This wouldn't always crash, but should definitely show up in Valgrind.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* This was a regression introduced by 257a0bf128e109442dce91c4aaa1d97fed17ad1a.
* The undo token that frees newly allocated teco_machine_qregspec_t must actually
  reset the pointer as well since any subsequent token, pushed by teco_undo_qregspec_own(),
  will expect a valid pointer.
* Could have been done via
  ctx-&gt;expectqreg = NULL;
  teco_undo_qregspec_own(ctx-&gt;expectqreg);
  but using a special clear function requires less memory and is easier to understand.
* Added test case. This wouldn't always crash, but should definitely show up in Valgrind.
</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>
<entry>
<title>added special Q-Register ":" for accessing dot</title>
<updated>2024-11-24T01:51:34+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-11-24T01:38:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=23c90e37ff48707c4aabdb8b1460df382a600d7a'/>
<id>23c90e37ff48707c4aabdb8b1460df382a600d7a</id>
<content type='text'>
* We cannot call it "." since that introduces a local register
  and we don't want to add an unnecessary syntactic exception.
* Allows the idiom [: ... ]: to temporarily move around.
  Also, you can now write ^E\: without having to store dot in a register first.
* In the future we might add an ^E register as well for byte offsets.
  However, there are much fewer useful applications.
* Of course, you can now also write nU: instead of nJ, Q: instead of "." and
  n%: instead of "nC.". However it's all not really useful.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* We cannot call it "." since that introduces a local register
  and we don't want to add an unnecessary syntactic exception.
* Allows the idiom [: ... ]: to temporarily move around.
  Also, you can now write ^E\: without having to store dot in a register first.
* In the future we might add an ^E register as well for byte offsets.
  However, there are much fewer useful applications.
* Of course, you can now also write nU: instead of nJ, Q: instead of "." and
  n%: instead of "nC.". However it's all not really useful.
</pre>
</div>
</content>
</entry>
<entry>
<title>the search mode and current radix are mapped to __local__ Q-Registers ^X and ^R now (refs #17)</title>
<updated>2024-11-22T23:33:49+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-11-22T13:59:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=1cfe37610253c20a4fcb0d937c29e70894ecc4f5'/>
<id>1cfe37610253c20a4fcb0d937c29e70894ecc4f5</id>
<content type='text'>
* This way the search mode and radix are local to the current macro frame,
  unless the macro was invoked with :Mq.
  If colon-modified, you can reproduce the same effect by calling
  [.^X 0^X ... ].^X
* The radix register is cached in the Q-Reg table as an optimization.
  This could be done with the other "special" registers as well, but at the
  cost of larger stack frames.
* In order to allow constructs like [.^X typed with upcarets,
  the Q-Register specification syntax has been extended:
  ^c is the corresponding control code instead of the register "^".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* This way the search mode and radix are local to the current macro frame,
  unless the macro was invoked with :Mq.
  If colon-modified, you can reproduce the same effect by calling
  [.^X 0^X ... ].^X
* The radix register is cached in the Q-Reg table as an optimization.
  This could be done with the other "special" registers as well, but at the
  cost of larger stack frames.
* In order to allow constructs like [.^X typed with upcarets,
  the Q-Register specification syntax has been extended:
  ^c is the corresponding control code instead of the register "^".
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed the Q-Reg spec machine used for implementing S^EGq$ (match one of characters in Q-Register)</title>
<updated>2024-11-06T20:50:09+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-11-06T20:50:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=5f141848b88237959bd01603b427b792828d73ad'/>
<id>5f141848b88237959bd01603b427b792828d73ad</id>
<content type='text'>
* It was initialized only once, so it could inherit the wrong local Q-Register table.
  A test case has been added for this particular bug.
* Also, if starting from the profile (batch mode), the state machine could be initialized
  without undo, which then later cause problems on rubout in interactive mode.
  For instance, if S^EG[a] fails and you would repeatedly type `]`, the Q-Reg name could
  grow indefinitely. There were probably other issues as well.
  Even crashes should have been possible, although I couldn't reproduce them.
* Since the state machine is required only for the pattern to regexp translation
  and is performed anew for every character in interactive mode,
  we now create a fresh state machine for every call and don't attempt
  any undo.
  There might be more efficient ways, like reusing the string building's
  Q-Reg parser state machine.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* It was initialized only once, so it could inherit the wrong local Q-Register table.
  A test case has been added for this particular bug.
* Also, if starting from the profile (batch mode), the state machine could be initialized
  without undo, which then later cause problems on rubout in interactive mode.
  For instance, if S^EG[a] fails and you would repeatedly type `]`, the Q-Reg name could
  grow indefinitely. There were probably other issues as well.
  Even crashes should have been possible, although I couldn't reproduce them.
* Since the state machine is required only for the pattern to regexp translation
  and is performed anew for every character in interactive mode,
  we now create a fresh state machine for every call and don't attempt
  any undo.
  There might be more efficient ways, like reusing the string building's
  Q-Reg parser state machine.
</pre>
</div>
</content>
</entry>
</feed>
