aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2014-11-22fixed document parameters when editing local q-registers (must_undo)Robin Haberkorn1-1/+6
2014-11-21updated documentation on ED (buffer editing) hooksRobin Haberkorn2-14/+58
2014-11-21finally implemented the CLOSE and QUIT hooksRobin Haberkorn8-44/+151
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.
2014-11-20renamed ED hook register to "ED" and protect ED hook executionsRobin Haberkorn2-2/+23
SciTECO commands usually only take parameters from the stack that they need. Without protecting the ED hook execution with brace operators, additional arguments not consumed by the hook-dispatching command are passed into the ED hook invocation. Also an ED hook macro could leave additional values on the expression stack (by accident). All of this may lead to undefined behaviour if ED hooks are involved.
2014-11-20simplified attaching errors to a position in a macroRobin Haberkorn2-7/+11
introduced Error::set_coord()
2014-11-20Throw error when a macro terminates while a local q-reg is edited.Robin Haberkorn3-15/+53
This is only a problem if the macro created the local Q-Register table (i.e. not when called with ":M") but resulted in segfaults. Since we do not want to save in a Q-Reg whether it is local (and that wouldn't suffice anyway), we do it in the Q-Register table cleanup. The corresponding QRegisterTable::clear() must be called explicitly, since the RBTree::clear() called on destruction does not and cannot throw errors. If QRegisterTable::clear() has been called successfully, the default object destructor will not do much. If it has thrown an error, the destructor will clean up the remaining Q-Registers.
2014-11-20throw error when macro returns with an unterminated commandRobin Haberkorn1-0/+13
it was not possible to inherit the parser state of the last command in a macro. However, it was possible to exit the macro when its last command was not properly terminated. There is no useful conscious application of this behaviour. * If something like an uncomplete E-Command was last in the macro, there was absolutely no effect. However this points to a macro programming error. * If the last command started a string parameter but did not terminate it, the command might be (partially) executed. However the State's done() method wasn't called, which means that some commands will not execute at all. Again there's no useful application of this. When on the other hand, the last command was not terminated by accident, this was not reported to the user.
2014-11-20lexer library: added M[lexer.checkheader] and M[lexer.checkname] for ↵Robin Haberkorn8-20/+32
matching a pattern against the first line of a buffer or its filename. This simplifies the "lexer.test..." macros and allows us to select lexers based on the #! line.
2014-11-20allow a current buffer if we're editing a Q-RegisterRobin Haberkorn5-16/+23
this eases handling of the "*" register
2014-11-19added first draft of new modular lexer systemRobin Haberkorn12-237/+354
2014-11-18updated Scintilla submoduleRobin Haberkorn3-4/+3
Scintilla is now at v3.5.1 and Scinterm at v1.4 (actually one commit after that and the sciteco-branch contains another fix for the Scinterm Makefile)
2014-11-17updated TODORobin Haberkorn1-4/+1
2014-11-17updated sciteco(7): information on Scintilla views versus documentsRobin Haberkorn1-3/+30
2014-11-17renamed the "NCurses" UI to "Curses" internallyRobin Haberkorn5-42/+42
* does not change ./configure parameters You still have to specifiy --with-interface=ncurses for the Curses interface with default settings * the "NCurses" UI was used for many different Curses variants, so plain "Curses" is a better name.
2014-11-17Make sure QRegister::view is properly initialized and cleaned upRobin Haberkorn12-79/+99
* it must be initialized after the UI (Interface::main), so I added a View::initialize() function * the old initialize() method was renamed to setup() * use a global instance of QRegister::view so it is guaranteed to be destroyed only after any QRegisters that could still need it * Document API adapted to work with ViewCurrent references
2014-11-17simplified (User) Interface APIRobin Haberkorn3-53/+15
Both UIs have a current_view, so this field, the ssm(), undo_ssm() and get_current_view() methods can be refactored into the Interface base class
2014-11-17updated GTK user interface to API changesRobin Haberkorn2-43/+143
it now works as good (or bad) as it did before. * fixed entering of the Escape character
2014-11-16cleaned up Scintilla document "updating"Robin Haberkorn5-75/+58
* allowed me to remove some obscure global functions and methods like QRegister::update_string(). * Document updating is concentrated in qregisters.cpp now * also fixes some bugs introduced earlier, like undo tokens being generated for non-undo registers (resulting in segfaults on rubout)
2014-11-16rewritten View and Interface base classes using the Curiously Recurring ↵Robin Haberkorn9-114/+237
Template Pattern. * without the one-view-per-buffer designs, many Scintilla send message (SSM) calls could be inlined * with the new design, this was no longer possible using the abstract base classes. the CRT pattern allows inlining again but introduces a strange level of code obscurity. * tests suggest that at high optimization levels, the one-view-per-buffer design and the CRT pattern reduces typical macro runtimes by 30% (e.g. for symbols-extract.tes). * only updated the NCurses UI for the time being
2014-11-16avoid saving interface instance in UndoTokenInfoUpdate by implementing its ↵Robin Haberkorn1-13/+22
run() method later in interface.h
2014-11-16adapted sample teco.ini: margin setup must be done for every new documentRobin Haberkorn1-8/+11
2014-11-16first working version of the one-view-per-buffer designRobin Haberkorn18-252/+475
The user interface provides a Scintilla view abstraction and every buffer is based on a view. All Q-Register strings use a single dedicated view to save memory and initialization time when using many string registers. * this means we can finally implement a working lexer configuration and it only has to be done once when the buffer is first added to the ring. It is unnecessary to magically restore the lexer styles upon rubout of EB (very hard to implement anyway). It is also not necessary to rerun the lexer configuration macro upon rubout which would be hard to reconcile with SciTECO's basic design since every side-effect should be attached to a character. * this means that opening buffers is slightly slower now because of the view initialization * on the other hand, macros with many string q-reg operations are faster now, since the document must no longer be changed on the buffer's view and restored later on. * also now we can make a difference between editing a document in a view and changing the current view, which reduces UI calls * the Document class has been retained as an abstraction about Scintilla documents, used by QRegister Strings. It had to be made virtual, so the view on which the document is created can be specified by a virtual function. There is no additional space overhead for Documents.
2014-11-16enable bootstrapping by defaultRobin Haberkorn1-6/+7
The SciTECO language changes often and the build system scripts are adapted accordingly. If bootstrapping is disabled by default on systems that already have SciTECO, building recent Git versions will fail often due to macro errors. This is not easy to see and correct for users. Also the build-time overhead for `sciteco-minimal` is minimal. The --disable-bootstrap option is mostly useful when cross-compiling SciTECO.
2014-11-14added ^# (XOR) operatorRobin Haberkorn4-4/+16
also changed precedence of + operator (higher than minus). the effects of this should be minimal
2014-11-14fixed number formatting for radix > 10Robin Haberkorn1-1/+1
this fixes the "\" command and ^E\ string building characters
2014-11-11refactored SciTECO runtime errors: moved from parser.cpp to error.cppRobin Haberkorn15-294/+375
* the GError expection has been renamed to GlibError, to avoid nameclashes when working from the SciTECO namespace
2014-11-11added all of SciTECO's declarations to the "SciTECO" namespaceRobin Haberkorn33-74/+208
normally, since SciTECO is not a library, this is not strictly necessary since every library should use proper name prefixes or namespaces for all global declarations to avoid name clashes. However * you cannot always rely on that * Scintilla does violate the practice of using prefixes or namespaces. The public APIs are OK, but it does define global functions/methods, e.g. for "Document" that clashed with SciTECO's "TECODocument" class at link-time. Scintilla can put its definitions in a namespace, but this feature cannot be easily enabled without patching Scintilla. * a "SciTECO" namespace will be necessary if "SciTECO" is ever to be turned into a library. Even if this library will have only a C-linkage API, it must ensure it doesn't clutter the global namespace. So the old "TECODocument" class was renamed back to "Document" (SciTECO::Document).
2014-11-10revised default function key macrosRobin Haberkorn1-18/+63
* use shorter function key macros. * instead, every function key has a commandline editing macro based on the macro "^Tc" * dot is no longer modified to calculate positions, instead Scintilla messages are used * prevent that function key macros move dot off-page * improved behaviour: HOME will will first skip spaces and tabs at the beginning of the line and only the second press will move dot to the real line beginning. UP and DOWN will try to keep the column. However this does not work quite as good as in other editors, since there's no (sane) way to save the column last set by one of the function keys.
2014-11-10updated TODORobin Haberkorn1-1/+3
2014-11-10extended ^U command: allow setting and appending of strings and characters fromRobin Haberkorn2-5/+61
the expression stack now it's more like standard TECO's ^U command
2014-11-10clarified conditions when <;> should yield an errorRobin Haberkorn1-2/+11
2014-11-10README: mention Github wikiRobin Haberkorn1-0/+1
2014-11-10support new "~" conditional: useful for implying default parameters in macrosRobin Haberkorn2-14/+44
2014-11-10fixed EG command: make sure to reset the register argument on termination,Robin Haberkorn1-0/+2
else the next EC command will not work as expected or even crash
2014-11-09fixed EC command for negative line rangesRobin Haberkorn1-0/+6
2014-11-09allow "-EC" command even though we do not generally imply the sign prefixRobin Haberkorn1-3/+13
2014-11-09revised U command: fail if no argument is providedRobin Haberkorn3-7/+32
* there is no reasonable default value for U * omitting the parameter for U might be a frequent programming error * U can be colon-modified now, in which case it may be used * to check for the presence of arguments in macros
2014-11-09Clarify `symcasecmp` macro in string.tesRobin Haberkorn1-1/+2
2014-11-09fixed undoing of initial TECO document changesRobin Haberkorn1-0/+3
* the TECODocument::undo_edit() function is called before TECODocument::edit() and the Scintilla document might still be unitialized * fixes e.g. undoing of Xq, ^Uq on registers whose string part has not being used before
2014-11-09current_doc_must_undo(): check for undo-necessity when operating on the ↵Robin Haberkorn3-19/+44
current document if the current document is a local q-register from a macro call, we must not generate undo tokens, since the local documents are discarded on macro termination.
2014-11-09prevent assertions when pushing operators without corresponding operandsRobin Haberkorn1-4/+14
instead throw an error. The error could theoretically be thrown earlier instead of only when trying to perform a calculation. test cases: "++", "+1+", etc.
2014-11-09documented EC and EG commandsRobin Haberkorn4-2/+111
2014-11-09TAB-completion for EC commandRobin Haberkorn1-2/+13
behaves just like ^T in string arguments. later we might add special Bash-completion support
2014-11-09added EG command: pipe from buffer into Q-RegisterRobin Haberkorn3-7/+45
2014-11-09implemented EC command (execute operating system command) in spawn.cppRobin Haberkorn6-1/+428
powerful command for filtering a SciTECO buffer through an external program. It will be described in the sciteco(7) man pages. The implementation uses an asynchronous background process with pipes but is platform independant thanks to glib's g_spawn functions, GIOChannels and event loops. There are however platform differences in how the operating system command is interpreted/parsed.
2014-11-02changed syntax for long Q-Register names: use [] brackets instead of {}Robin Haberkorn9-84/+83
this breaks many existing scripts, and means you may have to rebuild SciTECO with ./configure --enable-bootstrap The syntax of SciTECO might change in backwards-incompatible until version 1.0 is released.
2014-11-01fixed reversing EW (save as)Robin Haberkorn2-24/+23
when the file name changes, there will no longer be a use-less save point file. instead the new file is deleted upon rubout. * save points are properly created if a file already exists with the same name, even though it was not known to SciTECO before the save. (e.g. you do save-as to a file that already exists). * more effects of the save command can now be rubbed out correctly
2014-10-07fixed URL in .gitmodulesRobin Haberkorn2-1/+1
2014-10-07Merge branch 'master' of https://github.com/rhaberkorn/scitecoRobin Haberkorn11-142/+121
2014-08-22minor INSTALL typos fixedRobin Haberkorn1-3/+3