<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sciteco/src/ring.c, 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>GTK: SIGTERM/SIGHUP always terminates the program and dumps recovery files</title>
<updated>2026-04-12T21:00:40+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2026-04-12T19:47:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=0a8770ac7d382df8976b2448fccc6cfe434cd4d1'/>
<id>0a8770ac7d382df8976b2448fccc6cfe434cd4d1</id>
<content type='text'>
* SIGTERM used to insert the ^KCLOSE key macro.
  However with the default ^KCLOSE macro, which inserts `EX`,
  this may fail to terminate the editor if buffers are modified.
  If the process is consequently killed by a non-ignorable signal,
  we may still loose data.
* SIGTERM is used to gracefully shut down, so we now always terminate.
  Since we have recovery files, they are now dumped before terminating.
  This makes sure that recovery files are more up-to-date during
  unexpected but gracefull terminations.
* The same functionality is planned on Curses, but requires more fundamental
  changes (TODO).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* SIGTERM used to insert the ^KCLOSE key macro.
  However with the default ^KCLOSE macro, which inserts `EX`,
  this may fail to terminate the editor if buffers are modified.
  If the process is consequently killed by a non-ignorable signal,
  we may still loose data.
* SIGTERM is used to gracefully shut down, so we now always terminate.
  Since we have recovery files, they are now dumped before terminating.
  This makes sure that recovery files are more up-to-date during
  unexpected but gracefull terminations.
* The same functionality is planned on Curses, but requires more fundamental
  changes (TODO).
</pre>
</div>
</content>
</entry>
<entry>
<title>decreased default recovery interval to 120s</title>
<updated>2026-03-09T20:12:32+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2026-03-09T20:12:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=66317e173c592817cfc7052b55a768e3ce7e4223'/>
<id>66317e173c592817cfc7052b55a768e3ce7e4223</id>
<content type='text'>
5 minutes was probably a bit too conservative.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
5 minutes was probably a bit too conservative.
</pre>
</div>
</content>
</entry>
<entry>
<title>`ER` updates ^S/^Y now as any other text insertion</title>
<updated>2026-01-24T16:19:48+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2026-01-24T16:19:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=59d3c24f198ca4628fb69c8da163f103bafebc43'/>
<id>59d3c24f198ca4628fb69c8da163f103bafebc43</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<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>avoid unnecessary cleanups of recovery files</title>
<updated>2025-12-28T23:42:41+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2025-12-28T23:31:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=713462dfdf3c46a998b43525cbbf5ae0ec8ea84b'/>
<id>713462dfdf3c46a998b43525cbbf5ae0ec8ea84b</id>
<content type='text'>
* After the last commit 0b593eb7d0e6907b19cdbb605caf1becae351004
  we tried to clean up (unlink) recovery files for all dirty buffers.
  This resulted in superfluous file deletions before any recovery
  file was dumped; after disabling file recovery and even in
  batch mode.
  It's not tolerable that SciTECO scripts try to unlink files
  as a side effect e.g. of EW.
  Also, sometimes you may have to clean up recovery dumps even
  in batch mode, e.g. in Quit hooks.
* Also, it was broken for dirty unnamed buffers, which would
  cause glib errors.
* That's why we had to add another buffer state for
  dirty files with outdated recovery dumps (TECO_BUFFER_DIRTY_OUTDATED_DUMP).
  Once a dump was written, a buffer never directly transitions
  into the TECO_BUFFER_DIRTY_NO_DUMP state again.
  We can now reliably unlink() only where we'd expect a
  recovery file to exist in the first place.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* After the last commit 0b593eb7d0e6907b19cdbb605caf1becae351004
  we tried to clean up (unlink) recovery files for all dirty buffers.
  This resulted in superfluous file deletions before any recovery
  file was dumped; after disabling file recovery and even in
  batch mode.
  It's not tolerable that SciTECO scripts try to unlink files
  as a side effect e.g. of EW.
  Also, sometimes you may have to clean up recovery dumps even
  in batch mode, e.g. in Quit hooks.
* Also, it was broken for dirty unnamed buffers, which would
  cause glib errors.
* That's why we had to add another buffer state for
  dirty files with outdated recovery dumps (TECO_BUFFER_DIRTY_OUTDATED_DUMP).
  Once a dump was written, a buffer never directly transitions
  into the TECO_BUFFER_DIRTY_NO_DUMP state again.
  We can now reliably unlink() only where we'd expect a
  recovery file to exist in the first place.
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed left-over recovery files</title>
<updated>2025-12-28T20:22:46+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2025-12-28T20:22:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=0b593eb7d0e6907b19cdbb605caf1becae351004'/>
<id>0b593eb7d0e6907b19cdbb605caf1becae351004</id>
<content type='text'>
* It was possible to provoke left-over recovery files even if the editor does *not* crash:
  1. If you dirtified the buffer (state = TECO_BUFFER_DIRTY), it would be dumped to a
     recovery file (TECO_BUFFER_DIRTY_DUMPED).
  2. If you dirtify the buffer again, the state will become TECO_BUFFER_DIRTY again,
     so it's up for dumping in the next cycle.
  3. If you now save and exit (e.g. `:EX`) the recovery file is not deleted since
     the state is not TECO_BUFFER_DIRTY_DUMPED.
* A buffer can have a recovery file both for TECO_BUFFER_DIRTY and TECO_BUFFER_DIRTY_DUMPED,
  so we must clean up afterwards in both states.
* Of course, it may __not__ yet have a recovery file in the TECO_BUFFER_DIRTY state.
  The g_unlink() might therefore be superfluous on those files.
  Moreover, if you disable recovery files, SciTECO will now still try to unlink the
  recovery file.
  These operations could only be avoided by adding yet another state, e.g.
  TECO_BUFFER_DIRTY_OUTDATED_DUMP, so that after the first dump you will never switch
  back into TECO_BUFFER_DIRTY.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* It was possible to provoke left-over recovery files even if the editor does *not* crash:
  1. If you dirtified the buffer (state = TECO_BUFFER_DIRTY), it would be dumped to a
     recovery file (TECO_BUFFER_DIRTY_DUMPED).
  2. If you dirtify the buffer again, the state will become TECO_BUFFER_DIRTY again,
     so it's up for dumping in the next cycle.
  3. If you now save and exit (e.g. `:EX`) the recovery file is not deleted since
     the state is not TECO_BUFFER_DIRTY_DUMPED.
* A buffer can have a recovery file both for TECO_BUFFER_DIRTY and TECO_BUFFER_DIRTY_DUMPED,
  so we must clean up afterwards in both states.
* Of course, it may __not__ yet have a recovery file in the TECO_BUFFER_DIRTY state.
  The g_unlink() might therefore be superfluous on those files.
  Moreover, if you disable recovery files, SciTECO will now still try to unlink the
  recovery file.
  These operations could only be avoided by adding yet another state, e.g.
  TECO_BUFFER_DIRTY_OUTDATED_DUMP, so that after the first dump you will never switch
  back into TECO_BUFFER_DIRTY.
</pre>
</div>
</content>
</entry>
<entry>
<title>teco_string_t is now passed by value like a scalar if the callee isn't expected to modify it</title>
<updated>2025-12-28T19:57:31+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2025-12-28T15:23:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=ea0a23645f03a42252ab1ce8df45ae4076ebae75'/>
<id>ea0a23645f03a42252ab1ce8df45ae4076ebae75</id>
<content type='text'>
* When passing a struct that should not be modified, I usually use a const pointer.
* Strings however are small 2-word objects and they are often now already passed via separate
  `gchar*` and gsize parameters. So it is consistent to pass teco_string_t by value as well.
  A teco_string_t will usually fit into registers just like a pointer.
* It's now obvious which function just _uses_ and which function _modifies_ a string.
  There is also no chance to pass a NULL pointer to those functions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* When passing a struct that should not be modified, I usually use a const pointer.
* Strings however are small 2-word objects and they are often now already passed via separate
  `gchar*` and gsize parameters. So it is consistent to pass teco_string_t by value as well.
  A teco_string_t will usually fit into registers just like a pointer.
* It's now obvious which function just _uses_ and which function _modifies_ a string.
  There is also no chance to pass a NULL pointer to those functions.
</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 clicking the "(Unnamed)" buffer in 0EB popups</title>
<updated>2025-12-23T12:54:17+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2025-12-23T12:54:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=0c89fb700957e411885e7e7835e15f441e8b5e84'/>
<id>0c89fb700957e411885e7e7835e15f441e8b5e84</id>
<content type='text'>
* When constructing the list of popup items, the unnamed buffer is stored as the empty string
  instead of a prerendered "(Unnamed)".
  Using the empty string simplifies autocompletions, which will actually have to insert nothing
  at all (in addition to terminating the string).
* Since unnamed buffers are now special in the popup list, we can render them with special
  icons as well.
  Currently, only on Curses we use a file symbol with a question mark.
  There doesn't appear to be a fitting standard Freedesktop icon to use on GTK and there
  isn't even any fitting standard emblem to lay over the default file icon.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* When constructing the list of popup items, the unnamed buffer is stored as the empty string
  instead of a prerendered "(Unnamed)".
  Using the empty string simplifies autocompletions, which will actually have to insert nothing
  at all (in addition to terminating the string).
* Since unnamed buffers are now special in the popup list, we can render them with special
  icons as well.
  Currently, only on Curses we use a file symbol with a question mark.
  There doesn't appear to be a fitting standard Freedesktop icon to use on GTK and there
  isn't even any fitting standard emblem to lay over the default file icon.
</pre>
</div>
</content>
</entry>
<entry>
<title>fixup: renamed "backups" to "recovery files"</title>
<updated>2025-12-19T22:25:48+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2025-12-19T22:25:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=2592ef74ab2eba57c32fe21993ce01e9698b106f'/>
<id>2592ef74ab2eba57c32fe21993ce01e9698b106f</id>
<content type='text'>
* Other editors call "backup files" previous copies of saved files.
  This role would be served by savepoint files in SciTECO.
* Likewise filename~ would point to such a backup file.
  It therefore makes sense that savepoint files also end in tildes (.teco-n-filename~).
* Security copies of modified buffers would be called "auto-saves" (Emacs) or
  "swap files" (Vim).
  Both of these terms is IMHO misleading, so SciTECO now uses the
  term "recovery file".
* "Recovery files" are now named #filename# just like in Emacs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Other editors call "backup files" previous copies of saved files.
  This role would be served by savepoint files in SciTECO.
* Likewise filename~ would point to such a backup file.
  It therefore makes sense that savepoint files also end in tildes (.teco-n-filename~).
* Security copies of modified buffers would be called "auto-saves" (Emacs) or
  "swap files" (Vim).
  Both of these terms is IMHO misleading, so SciTECO now uses the
  term "recovery file".
* "Recovery files" are now named #filename# just like in Emacs.
</pre>
</div>
</content>
</entry>
</feed>
