amagura / eggs Goto Github PK
View Code? Open in Web Editor NEWChicken Scheme eggs I either maintain or wrote
Chicken Scheme eggs I either maintain or wrote
The code used in the readline egg was very old (some of it anyway) when I adopted it; I then refactored/rewrote what I could (according to my understanding of C at the time) to make it easier to maintain, extend, and improve. However, after reviewing readline bindings for other languages, I've begun to realize that this egg may not be as solid as I had hoped; therefore, I would like to begin working on a new major version of readline, featuring:
rudimentary syntax color support? (Is it worth it?)
when an odd number of parens are present in the current expression, the last paren (or odd one out) should be highlighted a shade of red.
symbols should be highlighted? Maybe?
Better signal handling (non-blocking) (see #9)
If the cursor is over a paren or brace (e.g. (
or [
) and said paren/brace has a matching paren/brace, the matched paren/brace pair should be highlighted in teal. If the paren/brace does not have a match, it should be highlighted in purple.
IIRC, Arrow keys are manufacturer, therefore we'll need a function that can be used to register the current systems arrow key codes:
bool register_arrwkys(char up, char down, char left, char right)
{
return true;
}
The Scheme binding should be usable like so
(readline#register-up-arrow-key "^[[A")
;; OR
(readline#register-arrow-keys '((up . "^[[A") ...))
For now, I think recognizing the arrow keys should be more than enough, but eventually it'd be nice to be able to highlight the matching paren/brace whenever the cursor is placed on one.
Now that setup-helper
finally deprecated the include
usage, a number of eggs broke, including kvlists
which is a test dependency for the readline egg. As the test file does only use kvlist?
, I wonder whether it's necessary to use this dependency at all. One could easily copy this one definition and just use it.
What could also work is thinking a bit more about the tested variable, readline#session
. It is defined as a list with four special keys. Why not test for the presence of each with kvlist-ref
or a copied definition instead?
Readline builds and can be used just fine, however, it seems to have no effect when running under cygwin.
readline
is loadedWhen csi
is started without an rc file (e.g. csi -n
) it: responds to SIGINT
immediately and prints a new prompt, however, when/after readline has been loaded, csi
only responds to SIGINT
after encountering a carriage return (\r
): this behavior is awkward and differs from other major lisps implementations such as clisp
and sbcl
(both of which respond to SIGINT
after a short pause without any further intervention from the user).
rl_catch_signals
when loading readline.so
; loading /home/rr257875/usr/lib/chicken/8/readline.so ...
readline: rl_catch_signals: unknown variable name
After doing a small amount of research, I realized that the issue is caused by the following code in interface.c
:
#endif
rl_completion_entry_function = &gnu_readline_tab_complete;
rl_variable_bind("rl_catch_signals", 0);
rl_clear_signals();
rl_set_signals();
In the code above, rl_variable_bind
is being misused, it is not designed to set C variables, but readline variables such as you could set by calling set ...
on the command-line.
The code should be something like this:
#endif
rl_completion_entry_function = &gnu_readline_tab_complete;
int rl_catch_signals = 0;
rl_clear_signals();
rl_set_signals();
This misuse does not seem to be present in trunk, but is present in the most recent release.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.