aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/undo.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-21 19:36:01 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-21 19:36:01 +0100
commit16a47e287f44f4ea154f9bfc1d3a6fa083a0f43e (patch)
tree6ceb4f16b271f85a00eb2e969ad9999e34369928 /src/undo.cpp
parentefa646da494c659d24bc1f09936645eed1a10244 (diff)
downloadsciteco-16a47e287f44f4ea154f9bfc1d3a6fa083a0f43e.tar.gz
finally implemented the CLOSE and QUIT hooks
the QUIT hook is actually not that trivial and required some architectural changes. First, the QUIT hook execution and any error that might occurr cannot always be attached to an existing error stack frame. Thereforce, to give a stack frame for QUIT hooks and to improve the readability of error traces for ED hooks in general, a special EDHookFrame is added to every ED hook execution error. Secondly, since QUIT hooks can themselves throw errors, we cannot run it from an atexit() handler. Instead it's always called manually before __successful__ program termination. An error in a QUIT hook will result in a failure return code nevertheless. Thirdly, errors in QUIT hooks should not prevent program termination (in interactive mode), therefore they are only invoked from main() and always in batch mode. I.e. if the interactive mode is terminated (EX$$), SciTECO will switch back to batch mode and run the QUIT hook there. This is also symmetric to program startup, which is always in batch mode. This means that Interface::event_loop() no longer runs indefinitely. If it returns, this signals that the interface shut down and batch mode may be restored by SciTECO.
Diffstat (limited to 'src/undo.cpp')
0 files changed, 0 insertions, 0 deletions