Age | Commit message (Collapse) | Author | Files | Lines |
|
* They have a newer version in pkgsrc, but it's not even available
as a binary package on the arm6.
* Has some glitches, e.g. does accept the ASCII 27 in tutorial.ms,
but it's probably not worth to work around.
|
|
TECO compatibility
|
|
`make install` invocation
* The previous way of fixing up all `*.tes` scripts had the disadvantage
of touching unrelated scripts or grosciteco/tedoc of a previous invocation.
E.g. installing a Gtk build after the ncurses build would overwrite all hash-bang
lines of the curses-version scripts as well with gsciteco.
* This caused problems with the RPM package where both variants were
installed into the same buildroot and introduced a dependency from sciteco-curses
to sciteco-gtk.
This is worked around in sciteco.spec with a manual sed call.
* It would be better to get rid of the install-exec-hook altogether
as it causes problems with FreeBSD/Poudriere (FIXME).
|
|
CI and nightlies
* They would get the --program-prefix.
* If they aren't installed as real scripts, there is no point in fixing up their
hash-bang lines.
* The hash-bang line fix won't work on Windows anyway, so they are now disabled for
grosciteco and tedoc as well.
|
|
special Q-registers ^Ax
* The unnamed buffer is also used for reading from --stdin, so you couldn't practically combine
--stdin with passing command-line arguments to macros.
* The old approach of passing command-line arguments via lines in the
unnamed buffer was flawed anyway as it wouldn't work with filenames containing LF.
This is just a very ancient feature, written when there weren't even long Q-reg names in SciTECO.
* You can now e.g. pipe into SciTECO and edit what was read interactively, e.g. `dmesg | sciteco -i`.
You can practically use SciTECO as a pager.
* htbl.tes is now a command-line filter (uses -qio).
* grosciteco.tes reads Troff intermediate code from stdin, so we no longer need
"*.intermediate" temporary files.
* added a getopt.tes test case to the testsuite.
* This change unfortunately breaks most macros accepting command-line arguments,
even if they used getopt.tes.
It also requires updating ~/.teco_ini - see fallback.teco_ini.
|
|
--stdin and --stdout options
* htbl.tes now reads from stdin and writes to stdout.
Allows avoiding temporary `*.htbl` files
* grosciteco.tes still cannot be simplified since --stdin cannot be combined with
passing command-line arguments (FIXME).
|
|
* In principle --stdin and --stdout could have been done in pure TECO code using the
<^T> command.
Having built-in command-line arguments however has several advantages:
* Significantly faster than reading byte-wise with ^T.
* Performs EOL normalization unless specifying --8bit of course.
* Significantly shortens command-lines.
`sciteco -qio` and `sciteco -qi` can be real replacements for sed and awk.
* You can even place SciTECO into the middle of a pipeline while editing
interactively:
foo | sciteco -qio --no-profile | bar
Unfortunately, this will not currently work when munging the profile
as command-line parameters are also transmitted via the unnamed buffer.
This should be changed to use special Q-registers (FIXME).
* --quiet can help to improve the test suite (TODO).
Should probably be the default in TE_CHECK().
* --stdin and --stdout allow to simplify many SciTECO scripts, avoiding
temporary files, especially for womenpage generation (TODO).
* For processing potentially infinite streams, you will still have to
read using ^T.
|
|
commands with multiple string arguments
* When `@`-modifying a command with several string arguments and choosing `{` as the alternative
string termination character, the parser would get totally confused.
Any sequence of `{` would be ignored and only the first non-`{` would become the termination character.
Consequently you also couldn't choose a new terminator after the closing `}`.
So even a documented code example from sciteco(7) wouldn't work.
The same was true when using $ (escape) or ^A as the alternative termination character.
* We can now correctly parse e.g. `@FR{foo}{bar}` or `@FR$foo$bar$` (even though the
latter one is quite pointless).
* has probably been broken forever (has been broken even before v2.0).
* Whitespace is now ignored in front of alternative termination characters as in TECO-64, so
we can also write `@S /foo/` or even
```
@^Um
{
!* blabla *!
}
```
I wanted to disallow whitespace termination characters, so the alternative would have been
to throw an error.
The new implementation at least adds some functionality.
* Avoid redundancies when parsing no-op characters via teco_is_noop().
I assume that this is inlined and drawn into any jump-table what would be
generated for the switch-statement in teco_state_start_input().
* Alternative termination characters are still case-folded, even if they are Unicode glyphs,
so `@IЖfooж` would work and insert `foo`.
This should perhaps be restricted to ANSI characters?
|
|
and also the CTRL+L immediate editing command
* ^W can be added to loops in order to view progress in interactive mode.
It also sleeps for a given number of milliseconds (10ms by default).
* In batch mode it is therefore the sleep command.
* Since CTRL+W is an immediate editing command, you will usually type it Caret+W.
ASCII 23 however will also be accepted.
* While ^W only updates the screen, you can force a complete redraw by pressing CTRL+L.
This is what most terminal applications use for redrawing.
It will make it harder to insert ASCII 12, but this is seldom necessary since it
is a form feed.
^L (ASCII 12 and the upcaret variant ) is still a whitespace character and therefore treated as a NOP.
* DEC TECO had CTRL+W as the refresh immediate editing command.
Video TECO uses <ET> as a regular command for refreshign in loops.
I'd rather keep ET reserved as a potential terminal configuration command
as in DEC TECO, though.
|
|
* DEC TECO had an <EO> command.
In contrast to DEC TECO's implementation, the value reported by
<EO> encodes a major.minor.micro semantic version.
|
|
inserting it
|
|
* 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.
|
|
support the append operation (:Xq, :^Uq...)
Works via a default implementation in the "external" Q-register "class"
by first querying the string, appending and re-setting it.
|
|
* `[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
|
|
* 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.
|
|
* ED hooks are not executed in this case
* <EF> is now allowed even when editing a Q-Reg, unless you try to close the
current buffer
|
|
codepoints in a strtoul()-like manner
|
|
* We have to avoid `/*` within comments, so one of the two characters will
have to use a named glyph.
\[**] is actually a special symbol, which wasn't noticed until supporting Unicode.
There is no named glyph for the plain asterisk.
Thus we now use \[sl] to escape the `/` character.
`/\c*` might have also worked.
* grosciteco now supports the `sl` glyph.
|
|
command now
* Improves DEC TECO-11 compatibility.
* <EM> is still supported as a synonym, but considered deprecated and is no longer documented.
A warning is printed when invoked.
It can be repurposed at any time in the future.
* `EI$` is not yet supported.
I am unsure whether this makes any sense.
|
|
* Now, `I^P` can replace `EI`.
EI is therefore now free to be repurposed as the new "mung file" command for improved TECO-11 compatibility.
* On the downside when inserting large blocks of TECO code, you will have to write something like
`@I{^P !...! }`
* The construct is also useful when searching for carets as in `S^P^Q^`.
|
|
* Any value left on the numeric stack now determines the exit code.
This ensures you can call n^C as the SciTECO version of exit(n).
It will also work with n$$ in the top level macro.
But you don't necessarily need any of these commands.
* Could be useful in shell scripting as in
`sciteco -e "@EB/file/ :@S/foo/\"F1'"` to fail `foo` is not found.
|
|
So you can lookup `?bool$` for instance.
|
|
* Support fold level configuration using `.SCITECO_FOLDLEVEL`.
This sets the current output line as the fold header and all subsequent lines
with the given fold level (until another `.SCITECO_FOLDLEVEL` instruction
is encountered).
* This is now done automatically for man's SH and SS macros,
so the man-page based woman pages provide folding.
* The folding margin is therefore now always enabled in fallback.teco_ini.
|
|
customized (refs #34)
* In the grosciteco-generated .woman.tec files, the fonts were only
set on the monospaced styles if lexer.font was set since it was
undefined by default.
We'd need a lare IF-ELSE statement to handle that in womanpages
since woman.tes changes the default font to a variable-width font.
Just leaving the default font, therefore won't work.
* We now always initialize lexer.font in lexer.tes.
You no longer have to check for its existance.
* Consequently, you can no longer set lexer.font *before* munging
lexer.tes because it will be overwritten.
At least not without additional checks.
Such a design is not suggested by fallback.teco_ini, though.
* Fixes monospaced sections in the tutorial and other womanpages on Gtk.
|
|
variable-width font is configurable via lexer.woman.font (refs #34)
* grosciteco was just hardcoding "Monospace", regardless of what was configured via lexer.font in ~/.teco_ini
* The variable-width font used for ordinary "womanpage" body texts was hardcoded to "Serif".
It is now configurable via the lexer.woman.font register.
* There is a difference, though:
lexer.font has no default value and must therefore be checked everywhere.
This is so you can set it even before munging lexer.tes.
lexer.woman.font however has a default (Serif), so it can only be overridden after
munging lexer.tes.
Perhaps it would be easier and more consistent to have a default for lexer.font as well.
|
|
|
|
`a-b"=` idiom
* There might theoretically be problems with the uncommon one's complement or magnitude
representation of negative integers, but it's practically impossible to meet those in
the wild.
* Still, we do some checks now, so we will at least notice any exotic architectures.
* Also, documented the `a^#b"=` idiom for checking for equality.
It's longer to type, but faster and will also work for floats.
For floats it will be the only permissible idiom for checking for bitwise equality
as `a-b` can be 0 even if a!=b (if the difference is very small).
Changing the `-` semantics is out of the question.
|
|
* Instead of separate stand-alone commands, they are now allowed only immediately
in front of the commands that accept them.
* The order is still insignificant if both `@` and `:` are accepted.
* The number of colon modifiers is now also checked.
We basically get this for free.
* `@` has syntactic significance, so it could not be set conditionally anyway.
Still, it was possible to provoke bugs were `@` was interpreted conditionally
as in `@ 2<I/foo/$>`.
* Even when not causing bugs, a mistyped `@` would often influence the
__next__ command, causing unexpected behavior, for instance when
typing `@(233C)W`.
* While it was theoretically possible to set `:` conditionally, it could also
be "passed through" accidentally to some command where it wasn't expected as in
`:Ifoo$ C`.
I do not know of any real useful application or idiom of a conditionally set `:`.
If there would happen to be some kind of useful application, `:'` and `:|` could
be re-allowed easily, though.
* I was condidering introducing a common parser state for modified commands,
but that would have been tricky and introduce a lot of redundant command lists.
So instead, we now simply everywhere check for excess modifiers.
To simplify this task, teco_machine_main_transition_t now contains flags
signaling whether the transition is allowed with `@` or `:` modifiers set.
It currently only has to be checked in the start state, after `E` and `F`.
|
|
* This was actually broken if the command is preceded by `@` and `:` characters, which
are __not__ modifiers.
E.g. `Q:@I/foo^W` would have rubbed out the `:` register as well.
* Also, since it was all done in teco_state_process_edit_cmd(),
it would also rub out modifier characters from within string arguments,
E.g. `@I/::^EQ^W`
* Real commands now have their own ^W rubout implementation, while the generic
fallback just rubs out until the start state is re-established.
This fails to rub out modifiers as in `@I/^W`, though.
* Real command characters now use the common TECO_DEFINE_STATE_COMMAND().
* Added test cases for CTRL+W rub out.
A few control characters are now portably available to tests
via environment variables `$ESCAPE`, `$RUBOUT` and `$RUBOUT_WORD`.
|
|
For some strange reason, Make wouldn't know how to get tutorial.ms.
Replacing it with an equivalent `%` works flawlessly, though.
|
|
* The old heuristics - scroll if dot changes after key press -
turned out to be too simplistic.
They broke the clang-format macro (M#cf), which left the view at the
top of the document since the entire document is temporarily erased.
Other simplified examples of this bug would be:
@^Um{[: HECcat$ ]:} Mm
Or even: @^Um{[: H@X.aG.a ]:} Mm
* Actually, the heuristics could be tricked even without deleting any
significant amount of text from the buffer.
The following test case replaces the previous character with a linefeed
in a single key press:
@^Um{-DI^J$} Mm
If executed on the last visible line, dot wouldn't be scrolled into the view
since it did not change.
* At the same time, we'd like to keep the existing mouse scroll behavior from
fnkeys.tes, which is allowed to scroll dot outside of the visible area.
Therefore, dot is scrolled into view always, except after mouse events.
You may have to call SCI_SCROLLCARET manually in the ^KMOUSE macro,
which is arguably not always straight forward.
* Some macros like M#cf may still leave the vertical scrolling position
in unexpected positions. This could either be fixed by eradicating all
remaining automatic scrolling from Scintilla or by explicitly restoring
the vertical position from the macro (FIXME).
* This was broken since the introduction of mouse support,
so it wasn't in v2.3.0.
|
|
--enable-html-docs
* `--enable-html-manual` renamed to `--enable-html-docs`.
* It's also uploaded to the website and linked to in README.
|
|
of Groff
|
|
Fixes `make distcheck` and CI builds.
|
|
This fixes building of the new tutorial.woman on Ubuntu.
|
|
|
|
* This is rendered with ms, so we now need the entire groff on Debian.
This is not a big deal as it just adds a few kilobytes of build-time dependencies.
Most platforms do not allow installation of some "groff-base" package anyway
and always draw in the entire package.
* sciteco.tmac has been extended to disable page breaks on ms.
* The tutorial is installed like any other woman page and can be invoked
interactively with ?tutorial$.
* It is optimized to be still usable on a plain 80x24 terminal.
|
|
* It makes little sense to e.g. rub out until `I` in `@I/foo/`, but
leave the `@` modifier.
Modifiers have to be considered part of the command,
even though the state machine is not currently modelled like that.
|
|
* They swap the default order of skipping characters.
For positive arguments: first non-word chars, then word chars.
* This is especially useful after executing the non-at-modified versions.
For instance, at the beginning of a word, `@W` jumps to its end.
`@V` would delete the remainder of the word.
* Since they have to evaluate the at-modifier, which has syntactic
significance, the command implementations can no longer use
transition tables, so they are in the switch-statements instead.
|
|
* regression from 867d22e419afe769f05ad26b61c6ea5ea1432c3c
|
|
This was changed ages ago for some old version of Groff.
These workarounds should no longer be necessary.
|
|
out no-op commands (whitespace)
* In string arguments, ^W first rubs out non-word chars (usually whitespace),
so it makes sense if ^W would work analogously at the command level.
A non-command would be one of the no-ops.
|
|
* All the movement commands have shortcuts for their negative forms:
`R` instead of `-C`, `B` instead of `-L`.
Therefore there was always the need for a `-W` shortcut as well.
* `P` is a good choice because it is a file IO command in TECO-11,
that does not make sense supporting.
In Video TECO it toggles between display windows (ie. split screens)
and I do not plan to support multiple windows in SciTECO.
* Added to the cheat sheet.
|
|
the beginning of words now
* All commands and their documentations were inconsistent.
* ^W rubbed out to the beginning of words.
* Shift+Right (fnkeys.tes) moved to the beginning of the next word if
invoked at the beginning of a word and to the end of the next word otherwise.
* <W> (and <V> and <Y> by extension) moved to the end of the next word.
* The cheat sheet would claim that <W> moves to the beginning of the next word.
* Video TECO's <W> command would differ again from everything else.
With positive arguments, it moved to the beginning of words, while
with negative it moved to end of words.
I decided not to copy this behavior.
* It has been decided to adopt a consistent beginning-of-words policy.
-W therefore differs from Video TECO in moving to the beginning of the
current or previous word.
* teco_find_words() is now based on parsing the document pointer, instead
of relying on SCI_WORDENDPOSITION, since the latter cannot actually be
used to skip strictly non-word characters.
This requires a constant amount of Scintilla messages but will require fewer
messages only when moving for more than 3 words.
* The semantics of <W> are therefore now consistent with Vim and Emacs as well.
* Shift+Right/Left is still based on SCI_WORDENDPOSITION, so it's behavior
differs slightly from <W> for instance at the end of lines, as it will
stop at linebreaks.
* Unfortunately, these changes will break lots of macros, among others
the M#rf, M#sp and git.blame macros ("Useful macros" from the wiki).
|
|
We don't need to specify the "woman.tec" output file as the default is sufficient.
If it has to be specified, it's now done with `-t`.
|
|
* After installation, SciTECO will therefore start into a more userfriendly mode
even if the user does not create a custom ~/.teco_ini.
It is hoped that this will scare away less of new users, who
are not willing to read through all of the documentation.
Still, users are warned in the absence of ~/.teco_ini.
This warning however, might not be immediately visible, especially
not when running gsciteco without an attached console.
(This will change once I redo the UI and allow a number of messages
to be queued in the message area.)
* Theoretically, you could also just extend fallback.teco_ini from ~/.teco_ini,
but that would require installing it into $SCITECOPATH.
* Since the fallback profile will now be munged automatically
on a wide range of systems, we set up xclip only when detecting X11
($DISPLAY is non-empty).
E.g. when running under Wayland or the Linux console, you still won't
get the clipboard registers, which is probably better than having the
clipboard operations fail once you try to use them.
* xclip is now "suggested" on Debian/Ubuntu.
Unfortunately we cannot pull it in only in the presence of X11.
|
|
|
|
* As an alternative to OSC-52, which is rarely supported by terminal emulators.
* Makes the new mouse support much more useful since you rely on good builtin
clipboard support. You can no longer e.g. just double-click a word to copy it into
the "primary" selection as terminal emulators do by default.
* Set $SCITECO_CLIPBOARD_SET/GET e.g. to xclip, way-copy, pbcopy or some wrapper script.
* This is currently using POSIX-specific popen() API, so it behaves a bit different
to command execution via EC/EG.
I am not sure if it's worth rewriting with the GSpawn-API, since it will be used
only on POSIX anyway and a GSpawn-based implementation is likely to be a bit larger.
* Should there be some small command-line utility for interacting (esp. pasting) via OSC-52,
built-in OSC-52 support could well be removed from SciTECO.
Currently, I know only of https://github.com/theimpostor/osc/ and it requires
very recent Go compilers. (I still haven't tested it. Quite possibly, pasting when run as
a piped command is impossible.)
|
|
* Curses allows scrolling with the scroll wheel at least
if mouse support is enabled via ED flags.
Gtk always supported that.
* Allow clicking on popup entries to fully autocomplete them.
Since this behavior - just like auto completions - is parser state-dependant,
I introduced a new state method (insert_completion_cb).
All the implementations are currently in cmdline.c since there is some overlap
with the process_edit_cmd_cb implementations.
* Fixed pressing undefined function keys while showing the popup.
The popup area is no longer redrawn/replaced with the Scintilla view.
Instead, continue to show the popup.
|
|
* You need to set 0,64ED to enable mouse processing in Curses.
It is always enabled in Gtk as it should never make the experience worse.
sample.teco_ini enables mouse support, since this should be the new default.
`sciteco --no-profile` won't have it enabled, though.
* On curses, it requires the ncurses mouse protocol version 2, which will
also be supported by PDCurses.
* Similar to the Curses API, a special key macro ^KMOUSE is inserted if any of the supported
mouse events has been detected.
* You can then use -EJ to get the type of mouse event, which can be used
with a computed goto in the command-line editing macro.
Alternatively, this could have been solved with separate ^KMOUSE:PRESSED,
^KMOUSE:RELEASED etc. pseudo-key macros.
* The default ^KMOUSE implementation in fnkeys.tes supports the following:
* Left click: Edit command line to jump to position.
* Ctrl+left click: Jump to beginning of line.
* Right click: Insert position or position range (when dragging).
* Double right click: insert range for word under cursor
* Ctrl+right click: Insert beginning of line
* Scroll wheel: scrolls (faster with shift)
* Ctrl+scroll wheel: zoom (GTK-only)
* Currently, there is no visual feedback when "selecting" ranges
via right-click+drag.
This would be tricky to do and most terminal emulators do not appear
to support continuous mouse updates.
|