| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (struct lino_state): New member,
need_resize.
(lino_list_busy): New static variable.
(handle_resize): New function.
(complete_line, history_search, edit): Check for the tty read
being interrupted, and in that case call handle_resize to put
the resize into effect, and continue the loop to fetch another
character.
(sigwich_handler): New function.
(linenoise): If we have SIGWINCH, install a handler for it
temporarily.
(link_into_list, unlink_from_list): Set global busy flag
around list manipulations. The signal handler stays away if
these are set. This means that if the user performs some
action that requires a lino_t to be constructed (e.g. types
Ctrl-R to search), while resizing the window at almost exactly
the same time, we will lose the resize signal. Oh well!
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (load_rcfile): New function.
(repl): Compute profile file name and try to load it before
entering loop.
* sysif.c (statp): Linkage becomes external.
* sysif.h (statp): Declaration updated.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* parser.c (find_matching_syms): Don't add an entry
into the history if it is a full match for the
completion prefix, because in the UI in then looks
as if nothing happened when Tab as pressed.
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (history_search): Editing keys
should leave search mode and be processed in command mode.
Also, let's have Ctrl-L and Ctrl-Z work, but stay in search
mode.
* txr.1: Documented.
|
|
|
|
|
|
| |
* linenoise/linenoise.c (history_search):
Don't step through identical lines, which
looks as if Ctrl-R is being ignored.
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (compare_completions): Restructure
with help of new lino_copy function to collect completions
just for the prefix of the line up to the cursor position,
and recombine those with the suffix.
* txr.1: Doc updated.
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (complete_line): ESC must not be
treated specially when leaving completion mode; it must
accept the completed line. The original code did this wrong
in my opinion and I propagated the error.
* txr.1: Remove all mention of special ESC treatment
in completion mode.
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit): Don't let characters
less than 32 be inserted.
* txr.1: Documented that control characters are rejected.
|
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (next_hist_match, history_search): New
static function.
(edit): New Ctrl-R case added to early switch that also
handles Tab completion, and calls history_search.
(lino_free): Adding null check, so we can safely call
lino_free(0). history_search relies on this.
* txr.1: Documented search.
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (repl): If we continue the loop due to detecting a
blank line, we must free that line, since we are outside of
the unwind block (and continue would violate that block if we
were). If a line contains nothing but a comment, then enter
that line into the history.
* txr.1: Documented treatment of commented lines.
|
|
|
|
|
|
|
|
| |
* parser.c (read_eval_ret_last): New function.
(repl): Use read_eval_ret_last for :read command.
* txr.1: Document :read in new section on direct
read from the terminal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes a difference if we read from a TTY.
Without this fix, two Ctrl-D's have to be issued
before the code registers EOF and returns.
The trick is that we know, after calling the
parser, whether it hit EOF, because we have
the recent token. If its value is zero, that's
the EOF token. We can bail out of the loop
instead of calling the parser again which will
require another EOF (because prime_parser
will not push an EOF token!)
* parser.h (parser_eof): Declared.
* parser.c (read_eval_stream): After lisp_parse
and eval, check for EOF with the parser_eof
function, and bail if so.
(parser_eof): New function.
|
|
|
|
|
|
|
|
| |
* parser.c (repl): Subtle difference. Test form's syntax for
equality to :quit, not its value. The REPL should not
terminate if a form happens to calculate :quit as a value.
* txr.1: Updated.
|
|
|
|
| |
* txr.1: document Home, End and Delete support.
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (complete_line): If Ctrl-C is
pressed in completion mode, we cancel completion and return
0 so the command loop reads a new character.
* txr.1: Documented Ctrl-C in completion mode, and removed
the falsehood that ESC is a cancel command, adding instead
an explanation about the ESC handling is really for.
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit): Code block which handles
tab completion before main command dispatch uses the
TAB symbol instead of 9, and is refactored into a switch
statement which will also handle a history search command.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (link_into_list, unlink_from_list):
New static functions.
(lino_make): Use link_into_list instead of open-coded
list manipulation.
(lino_copy): New function.
(lino_free): Use unlink_from list instead of
open-coded list manipulation.
* linenoise/linenoise.h (lino_copy): Declared.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The manual documents a filter called :tointeger, but it has
never existed. The keyword was misspelled in the source code
from the beginning as :toinger.
I'm fixing the typo and renaming the filter to :toint
at the same time.
* filter.c (tointeger_k, toint_k): Former renamed
to latter.
(filter_init): Initialize toint_k with correctly
spelled symbol. Register filter under toint_k.
* filter.h (tointeger_k, toint_k): Former renamed
to latter.
* txr.1: Changed mention of :tointeger to :toint.
|
|
|
|
|
| |
* eval.c (eval_init): Remove duplicate initialization
of with_saved_vars_s.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The documentation says that *args* is bound to nil,
but actually it is not bound at all.
Let us fix this by actualy binding *args* to the
remaining arguments, and by also allowing
modification of *args* to dynamically take effect.
* txr.c: Set up value of *args* prior to processing
any option which evaluates TXR Lisp. Afterwards,
reload the argument list from that variable.
* txr.1: Documented semantics of *args* during
command line processing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register package-alist, package-name
and package-symbols intrinsics.
* genvim.txr: Rather than scanning C sources for TXR Lisp
symbols, iterate over the packages and their symbols,
collecting anything which has a binding or is self-evaluating.
To get the stdlib symbols, we trigger the autoloads by doing
boundp queries on a few symbols.
* txr.1: Document package-alist, package-name and
package-symbols.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The self-path variable is not bound in TXR Lisp scripts
or the command line.
* txr.c (txr_main): Set self-path to "cmdline-expr" before
command line Lisp evaluations. (For TXR pattern language
syntax invoked in a -c, it continues to be "cmdline").
Set self-path to the file name when reading a Lisp file.
Also, the legacy, undocumented *self-path* is only set
for TXR scripts, and is reverted to being a special variable,
not a global lexical.
* txr.1: Documented self-path in more detail.
|
|
|
|
|
|
|
| |
* parser.c (provide_completions): Cast char argument to
unsigned char in call to isalnum. The data comes from
user input, which could be any byte. The char type may be
signed (and usually is) and so may take on negative values.
|
|
|
|
|
|
|
|
|
|
|
| |
When the completed symbol is unqualified, let's not
complete across all packages, but just the
user package.
* parser.c (provide_completions): Substitute
user_package if package is null, and call find_matching_syms
once rather than iterating on all packages.
Also, in this case, do not request symbol qualification.
|
|
|
|
|
| |
* parser.c (provide_completions): If find_package returns
nil, then just bail with no completions.
|
|
|
|
|
|
|
|
|
|
| |
Give the shorter completions first, and lexicographically within
each length equivalence class. This effectively gives the user
a breadth-first search through the trie of possible suffixes.
* linenoise/linenoise.c (compare_completions): New static function.
(complete_line): Apply qsort to the collected vector of strings.
Easy does it.
|
|
|
|
|
| |
* match.c (complex_open): Initialize member close
of fpip_t using fpip_close enum constant.
|
|
|
|
|
| |
* parser.c (provide_completions): Use convert macro to cast
void * return value of alloca to char *.
|
|
|
|
|
|
|
| |
* parser.c (find_matching_syms): Rename the compl
variable to comple, because compl is a standard
C++ macro which provides an alternate name for
the ~ operator.
|
|
|
|
|
|
|
| |
* txr.c (txr_main): Move the labeled code to the end
of the function, so it's not sitting in the scope of of names
whose initialization is skipped. This is a better
organization: thank you, C++.
|
|
|
|
|
|
| |
* linenoise/linenoise.c (sync_data_to_buf): Cast l->dpos
to the signed type ptrdiff_t when comparing to difference
between two pointers.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gc.c (prepare_finals): In the second pass, only mark
objects that were identified in the first pass as unreachable.
Reachable ones don't require a redundant call to mark_obj.
Also, objects identified as unreachable can be moved to
gen 0. This is something like what the mark_makefresh hack was
trying to do. It only does anything in a full GC pass, because
in an incremental pass, anything identified as unreachable is
necessarily gen 0. It can help prevent some objects that
are revived by finalization from sliding back to gen 1
and hanging around.
|
|
|
|
|
|
|
|
|
| |
This contraption doesn't actually do anything.
* gc.c (mark_makefresh): Static variable removed.
(mark_obj): Remove logic conditional no mark_makefresh.
(prepare_finals): Remove setting of mark_makefresh.
(call_finals): Remove clearing of mark_makefresh.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Another bug found in the finalization hooks. The reachability
test being applied is not correct for generational GC,
relying only on the REACHABLE flag. This bug means that we
call finalization hooks on mature objects, while they remain
reachable. It must use the gc_is_reachable logic, just like
weak hash table processing does, because under an incremental
garbage collection pass, all gen 1 objects are considered
reachable (though they don't have the REACHABLE flag set).
* gc.c (struct fin_reg): Remving obj_type member, replacing
with reachable flag.
(is_reachable): New static function based on gc_is_reachable,
minus the is_ptr test. (GC code which knows it is dealing with
a pointer doesn't need the test).
(prepare_finals): In the first pass, instead of memorizing the
prior object type, simply calculate the reachable flag,
correctly taking into account generational GC.
(call_finals): Rely on the new reachable flag rather than
the REACHABLE flag in the saved obj_type.
(gc_is_reachable): Becomes a public wrapper for is_reachable
which adds the pointer test.
(gc_finalize): Initialize the reachable member of fin_reg.
Remove initialization for obj_type.
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (defplace slot): The slot
argument must be evaluated only once, a gensym is
established for it, just like for the object form.
|
|
|
|
| |
* txr.1: Missing .desc added.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (defplace fun,
defplace symbol-function, defplace symbol-value):
Fix incorrect splicing substitution of body into
the output.
|
|
|
|
|
|
|
|
|
| |
* lib.c (obj_print_impl): Print whether
a function is interpreted or intrinsic, and
include argument information.
* tests/012/struct.tl: Test case relying on
function printed rep updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Solaris 10, we need __EXTENSIONS__ defined to make
struct winsize appear out of <termios.h>.
This commit adds detection for what preprocessor symbol needs
to be defined for struct winsize to appear, if it appears at
all. Then this symbol is defined on the compiler command line
when compiling linenoise.
* Makefile (CFLAGS): Add -D$(termios_define) for
linenoise.o target.
* configure (have_winsize, termios_define): New variables.
Detect whether struct winsize is available, and what
preprocessor symbol, if any, is required to reveal the
feature.
* linenoise/linenoise.c: Need to include TXR's "config.h"
for HAVE_WINSIZE.
(get_columns): Reorganized so that use of struct winsize
is guarded by HAVE_WINSIZE and fallback code is used if
either obtaining the size fails or the feature is completely
unavailable.
|
|
|
|
| |
* parser.c: #include ALLOCA_H.
|
|
|
|
|
| |
* txr.c (txr_main): The repl funtion is not declared
unless HAVE_TERMIOS is present and nonzero.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is unused code which just addds to the executable size.
Also it passes a char to isprint, which is undefined behavior
if that char happens to be negative.
* linenoise/example.c (main): Remove --keycodes option
and reference to lino_print_keycodes function.
* linenoise/linenoise.c, linenoise/linenoise.h
(lino_print_keycodes): Function removed.
|
|
|
|
|
|
| |
* 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.
|
| |
|