| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* configure: If we don't have alloca, we must not only
print "no", but bail, because we depend on it now.
If termios is not found, print no.
|
|
|
|
|
|
| |
* linenoise/linenoise.c (enable_raw_mode): Do not
clear the OPOST output flag. It is implementation-defined,
and if it is set, it is probably set for a good reason.
|
|
|
|
|
| |
* linenoise/linenoise.c (linenoise): Replace
printf("\n") with one-character write on ls->ofd.
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (enable_raw_mode,
disable_raw_mode): Use TCSANOW instead of TCSAFLUSH
to change tty settings without flushing input.
TCSAFLUSH could discard type-ahead-buffered keystrokes.
|
|
|
|
|
|
|
|
| |
* parser.c (repl): Rather than breaking out of the
loop when linenoise indicates lino_eof, break out
of the loop for any error not equal to lino_intr.
If the termination was due to other than lino_eof,
print an error message.
|
|
|
|
|
|
| |
* linenoise/linenoise.c (linenoise): Of course, we must up
ls->ifd and fdopen the dup, because fdopen closes
the descriptor.
|
| |
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (CTL): New macro.
(enum key_action): Removed CTRL_ members.
(edit): Replace CTRL_A with CTL('A') and similarly for all
others.
|
|
|
|
|
|
|
| |
* parser.c (provide_completions): If strlen(data) is zero,
the calculation of ptr places it at data - 1. Instead,
let us calculate a zero value for ptr and then bail based
on this.
|
|
|
|
|
|
|
|
|
|
|
| |
Ctrl-U does not traditionally delete the entire line
in line editors or text editors. Rather, it is a
"super backspace" to the beginning of the line.
* linenoise/linenoise.c (edit_delete_prev_all): New
static function.
(edit): Replace CTRL_U action with call to
edit_delete_prev_all.
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (LINENOISE_MAX_LINE): Reduced to 1024.
(LINENOISE_MAX_DISP): Now 8 times LINENOISE_MAX_LINE because
the worst case is that the line contains only tabs, which
expand to eight spaces.
(sync_data_to_buf): Use character constants instead of hard
coded values. Check for tab, and expand to spaces up to the
next modulo 8 tab position.
|
|
|
|
|
|
| |
* linenoise/linenoise.c (SPACE): New preprocessor symbol.
(edit_delete_prev_word): Use strchr to check for spaces
and tabs.
|
| |
|
|
|
|
|
|
| |
* lib.c (car, cdr, car_l, cdr_l):
Check for signal before calling forcing
function of a lazy cons.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register subtypep and typep.
* eval.h (list_s): Existing variable declared.
* lib.c (atom_s, integer_s, number_s, sequence_s, string_s):
new symbol variables.
(subtypep, typep): New functions.
(obj_init): Initialize new symbol variables.
* lib.c (atom_s, integer_s, number_s, sequence_s, string_s):
Declared.
* txr.1: Documented type hierarchy and the new functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (compat_fixup): Call rand_compat_fixup.
* rand.c (random_state_var_s): New global symbol variable.
(rand_compat_fixup): New static function.
(rand_init): Initialize random_state_var_s by intering
the earmuffed symbol *random-state*. Initialize random_state_s
to the non-earmuffed symbol random-state.
* rand.h (random_state_var_s): Declared.
(random_state): Macro updated to look up the special
variable using random_state_var_s, rather than random_state_s.
(rand_compat_fixup): Declared.
|
|
|
|
|
|
|
|
|
|
|
| |
The issue is that eval_intrinsic doesn't clear the
last_form_evaled global around the evaluation of its forms.
If a symbol is evaluated, and it is an unbound variable, the
error is reported against some wrong form.
* eval.c (eval_intrinsic): Set the value of last_form_evaled
to nil before expanding and evaluating the form, then restore
the value.
|
|
|
|
|
| |
* txr.1: Debugger and Compatibility are moved out of the TXR
library description, into their own major sections.
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (repl): If a HOME environment variable
exists, then load the .txr_history file from the user's home
directory and save it when exiting.
* sysif.c (getenv_wrap): Static function changed to extern.
* sysif.h (getenv_wrap): Declared.
|
|
|
|
|
| |
* linenoise.c (key_action): New enum constant, CTRL_Z.
(edit): Implement Ctrl-Z suspend.
|
|
|
|
|
| |
* parser.c (repl): Use format to print exception, and use ~!
to ensure indentation.
|
|
|
|
|
|
| |
* eval.c (abbrev_ctx): New static function.
(bind_args): In too many/few args case, use abbrev_ctx to only
show function only when it is a lambda.
|
|
|
|
|
| |
* lib.c (callerror): Remove accidentally committed debug
print, present from the time the function was introduced.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the -n option was introduced, on Mar 29, 2015, the
change didn't take into account that the hacky complex_open
function takes the C stdin stream directly, and not the
std_input Lisp stream. After that change, only the std_input
is automaticaly marked for real-time input if standard input
is a tty, and not any stream later opened from stdin.
* match.c (enum fpip_close): New enum member, fpip_close_stream.
(struct fpip): New member s, for smuggling through a stream.
(complex_open): If name is "-", then plant std_input or std_output
as the s member of fpip_t, rather than planting stdin or stdout
as the f member.
(complex_open_failed): Check for nil stream also.
(complex_snarf, complex_stream): Handle stream case.
|
|
|
|
|
|
|
|
|
|
|
| |
* match.c (extract): Return match result as cons, rather than
int termination status.
* match.h (extract): Declaration updated.
* txr.c (txr_main): Handle result cons. If repl mode is selected,
pass bindings from car(result) to repl. Otherwise use match success
indication in cdr(result) to determine termination status.
|
|
|
|
|
| |
* txr.c (txr_main): i option sets a flag only, processed
later in the function.
|
|
|
|
|
|
|
|
| |
* signal.c (kill_wrap): Return boolean indication of success,
with compatibility to previous behavior.
* txr.1: Document return value of kill, and put in
compatibility note.
|
|
|
|
|
|
|
| |
* signal.c (raise_wrap): New static function
(sig_init): Register raise intrinsic.
* txr.1: Documented raise.
|
|
|
|
|
| |
* parser.c (repl): Use ** prefix on caught exception
message. Clearly indicate that the second value is args.
|
|
|
|
|
|
|
| |
* parser.c (repl): If an exception is caught, don't
store nil in the repl result variable and hash.
Rather, store a cons cell holding the exception symbol
and arguments.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (split_str, split_str_set, list_str, int_str): Use
gc_hint rather than prot1/rel1. More efficient, doesn't
use space in the prot_stack array.
* regex.c (search_regex): Likewise.
* stream.c (vformat_str, formatv, run): Likewise.
In formatv, rel1 wasn't being called in the uw_unwind
block, so this fixes a bug.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We must tear down and rebuild the Flex scanner, otherwise
it is left in a bad state causing it to abort.
* parser.c (parser_cleanup): After destroying scanner,
null out the pointer.
(parser_reset): Destroy the Flex scanner, and
instantiate a new one in its place.
(lisp_parse): Set up an unwind catch which will
reset the parser if it was aborted by an exception.
* parser.h (parser_reset): Declared.
|
|
|
|
|
|
| |
* parser.c (repl): Print a simple fixed message when a
syntax error exception is caught, just so the fact
is noted.
|
|
|
|
|
|
| |
* signal.c (sig_handler): Make sure the interrupt_count
is restored to the value on entry into the handler
if the lambda throws.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is just amazingly broken; sig_mask recurses instead
of calling sigprocmask.
Also, we need a way to reload the signal mask cache from the
kernel, because the kernel can change the signal mask behind
our back.
* signal.c (sig_reload_cache): New static function.
(sig_handler): Call sig_reload_cache to ensure the
sig_blocked_cache accurately reflects the currently
blocked signal set.
(sig_init): Call sig_reload_cache at init time to
correctly reflect any blocked signals.
(sig_mask): Call sigprocmask instead of recursing. Moreover,
the correct op code is SIG_SETMASK, not SIG_BLOCK.
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (lino_print_codes): Pass l
into enable_raw_mode rather than STDIN_FILENO.
Read from l->ifd rather than STDIN_FILENO.
since this is a debugging function, I'm leaving the
printfs to stdio alone.
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (chk_strdup_utf8): New function.
* lib.h (chk_strdup_utf8): Declared.
* linenoise/linenoise.c (chk_strdup_utf8): Declared.
(edit_history_next, linenoise, lino_hist_add): Use
chk_strdup_utf8 instead of strdup.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If some program really needs this, it can be implemented in
that program.
* linenoise/linenoise.c (supported_term): Static array
removed.
(unsupported_term): Function removed.
(linenoise): Function removed.
(go_raw): Converted to linenoise function.
For handling non-tty's, opens and closes a stdio stream
over ls->ifd instead of using stdin and STDIN_FILENO.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (do_eval): Check for pending signals.
* parser.c (repl_intr): New static function.
(repl): Set up signal handler for SIGINT around REPL.
* signal.h (sig_deferred): declared.
(sig_check_fast): New inline function/macro.
A bit of a rearrangement here.
|
|
|
|
|
|
| |
* parser.c (repl): If linenoise returns a null pointer,
but the last error is lino_eof, print "** intr" message and
continue; do not quit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this commit, we introduce a persistent error
variable stored in the lino_t structure, and
functions to access it.
* linenoise/linenoise.c (struct lino_state): New
member, error.
(enable_raw_mode): Don't set errno to ENOTTY;
set linenoise error to lino_notty.
(complete_line, edit, go_raw, linenoise, lino_hist_save,
lino_hist_load): Set linenoise error before returning -1.
(lino_get_error, lino_set_error): New functions.
* linenoise/linenoise.h (enum lino_error, lino_error_t):
New enum.
(lino_get_error, lino_set_error): Declared.
|
|
|
|
|
|
|
|
|
| |
* linenoise.c (complete_line, sync_data_to_buf,
refresh_singleline, refresh_multiline, refresh_line,
edit_insert, edit_move_left, edit_move_right, edit_move_home,
edit_move_end, edit_history_next, edit_delete, edit_backspace,
edit_delete_prev_word): struct lino_state replaced
with lino_t.
|
|
|
|
|
| |
* parser.c (repl): Print "** " sequence in front
of exception.
|
|
|
|
|
|
| |
* parser.c (repl): If an exception is thrown, we
record a nil value for the line backreference
variable, and add the line to history.
|
|
|
|
|
|
|
|
|
| |
* parser.c (repl): If an expression is caught of
type syntax-error, then just suppress it. It is not
informative in this situation because the syntax
error diagnostics have appeared on the tty.
A syntax error exceptions is thrown out of the
reader so that program logic doesn't ignore errors.
|
|
|
|
|
|
|
| |
* txr.c (txr_main): Pass the name argument to lisp_parse
instead of defaulting it, so that errors against expressions
passed on the command line are referred to "cmdline-expr"
rather than the generic "string".
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.l (yyerrorf): Don't print the program prefix
and parenthes, except if compatibility to 114 or older is
requested. The main motivation for this is the repl, where the
program prefix is not informative. The new format is also a
de facto standard which is compatible with other parsers.
Vim understands it directly.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (boundp): Static function becomes extern.
* eval.h (boundp): Declared.
* parser.c (find_matching_syms): New par parameter
lets function determine whether previous character is a an
open parenthesis or brace, based on which the set
of possible completions is restricted.
(provide_completions): Calculate the par parameter
and pass to find_matching_syms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement basic tab completion.
* lib.c (package_alist, package_name, package_symbols): New
functions.
* lib.h (package_alist, package_name, package_symbols):
Declared.
* parser.c (find_matching_syms, provide_completions):
New static functions.
(repl): Register provide_completions as completion callback
with linenoise.
|
|
|
|
|
| |
* linenoise/linenoise.c (complete_line): Use
TAB and ESC instead of 9 and 27.
|