| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit): The recall previous word,
atom and line features now offset relative to the current
navigation position in the history. Previous line means
the line before the currently showing history line, not the
line most recently entered into the history.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (defstruct): Generate a named
block around the body forms of the :method and
:function lambdas, whose name matches the slot name.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit): Extended Ctrl-X Ctrl-R/r
command added.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: Formatting blunders in defstruct (description of :fini),
new macro, make-struct-type.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit_move_sol): If the cursor
is already at the beginning of a line, then move it
to the start of the buffer.
(edit_move_eol): If the cursor is at the end of the
line, then move it to the end of the buffer.
This also fixes a bug: previously, if the cursor was
at the end of the line already, it moved to the end
of the following line.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* struct.c (super): Detect structure instance
and resolve it to its type. Recursion eliminated in favor of
imperative approach that eliminates redundant checks.
* txr.1: Description of super updated.
|
|
|
|
|
|
|
|
|
| |
* struct.c (struct_init): Register super-method.
(super_method): New function.
* struct.h (super_method): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A new optional argument on finalize allows it to
be expressed that multiple finalizers on the same
object are to be called in reverse order, which is
potentially for objects with inheritance.
* gc.c (gc_finalize): New optional argument, rev_order_p.
Insert at the head of the list if this argument is
specified and true.
(gc_late_init): Register finalize as three-argument
function with optional argument.
* gc.h (gc_finalize): Declaration updated.
* share/txr/stdlib/struct.tl (defstruct): Register :fini
functions in reverse, so that derived finalizers
are called before supertype finalizers.
* txr.1: Documented new finalize argument, and
behavior of :fini.
|
|
|
|
| |
* txr.1: Run-on .code macro fixed.
|
|
|
|
| |
* txr.1: * used instead of @.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (defstruct): New (:init ...) and
(:fini ...) syntax can be used in the slot list to specify
an initialization function and a gc-finalization function.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (sys:bad-slot-syntax): New helper function.
(defstruct): Macro revamped with new slot specifier syntax for
writing static slots as well as methods.
* struct.c (STATIC_SLOT_BASE): New preprocessor symbol.
(struct struct_type): New members, nstslots, stinitfun, stslot.
(make_struct_type_compat): New static function.
(struct_init): Register make-struct-type to make_struct_type_compat
if compatibility is 117 or lower.
Register new intrinsics static-slot, static-slot-set, call-super-method,
call-super-fun, slot-p and static-slot-p.
(call_stinitfun_chain): New static function.
(make_struct_type): Two new arguments for specifying static slots and
an initialization function for them. Logic added for setting
up static slots and handling inheritance.
(struct_type_destroy): New static function.
(struct_type_mark): Mark the new stinitfun member of struct type.
Also iterate over the static slots in the new stslot array and
mark them.
(lookup_slot): Altered to return a loc instead of a raw pointer,
and also to accept the instance object as a member.
Now resolves static slots: it can return a loc which references
a static slot in the structure type, or an instance slot in
the structure.
(lookup_static_slot): New static function.
(slot, slotset): Implementation adjusted due to new lookup_slot interface.
(static_slot, static_slot_set, slot_p, static_slot_p): New functions.
(call_super_method, call_super_fun): New static functions.
(struct_inst_print): This function can no longer assume that the slots
list lines up with the array of slots, since it contains a mixture of
static and instance slots. Earnest slot lookup has to be performed.
(struct_type_ops): Point the destroy function to struct_type_destroy
instead of cobj_destroy_free_op. A structure type now has an array
of static slots to free.
* struct.h (make_struct_type): Declaration updated.
(static_slot, static_slot_set, slot_p, static_slot_p): Declared.
* lib.c (time_init): Update call to make_struct_type with new
arguments.
* sysif.c (sysif_init): Likewise.
* tests/012/struct.tl: Update defstruct macro expansion test.
* txr.1: Documented static slots and new functions.
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit): Do paren_jump after
backspace
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (find_nearest_paren): New static
function.
(edit_move_matching_paren): Use find_matching_paren to
usefully handle situations when the cursor is not on
a parenthesis, bracket or brace.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* linemode/linemode.c (edit_move_home, edit_move_end):
Check for multi-line mode and implement movement
within the physical line.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
| |
* txr.1: document a TOCTTOU race condition in
uses of path-private-to-me-p and how to get
around it.
|
|
|
|
|
|
| |
* txr.1: Under Unix Filesystem Object Existence, Type and
Access Tests, fix text which implies that the stat functions
return a list.
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (paren_jump): Scan forward also,
if reverse scan turns up nothing, thereby jumping
to a closing parenthesis in the forward direction.
* txr.1: Documentation updated.
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit): Implemented.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (scan_match_fwd, scan_fwd,
edit_move_matching_paren): New functions.
(edit): New Ctrl-] command implemented using
edit_move_matching_paren.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit_delete_line): New
static function.
(edit): New Ctrl-K extended command case implemented using
edit_delete_line.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit_delete_prev_all):
In multi-line mode, delete only to beginning of physical
line, not the entire logical line.
Also, detect noop cases and don't do record undo
or produce any effect.
(edit_delete_to_eol): New function.
(edit): Use edit_delete_to_eol function for Ctrl-K instead of
inline code.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Undo now works intuitively. It does not perform invisible
jumps among history items, restoring instead just the history
for the given line being edited.
* linenoise/linenoise.c (LINENOISE_MAX_UNDO): Raised from 32
to a more generous 200. Since edits are per-history line,
it makes sense to allow a lot more.
(delete_undo): New static function.
(free_undo): Static function removed to free_undo_stack.
Trivial loop around delete_undo.
(record_undo): Do not record the current history index; all
edits are assigned the index INT_MAX. INT_MAX is an indicator
that the edits do not have an assigned history line. The
decision of where to assign them depends on whether history
navigation is used to move to another history line or
Enter is used to submit an edited line.
A stinky part of the history trimming code is rewritten
simply in terms of delete_undo.
(record_triv_undo): Suppress a trivial item only if
the top item belongs to the same history line, or is
nonspecific (INT_MAX).
(undo_pop): Static function removed.
(restore_undo): Rewritten to look for the topmost item
specific to the current history line or an INT_MAX nonspecific
item. Removes undo items for expired lines as it goes.
(undo_subst_hist_idx): New static function.
(renumber_undo_hist): Renamed to undo_renumber_hist_idx.
(edit_history_next): Do not record an undo; history navigation
is no longer considered an edit. Rewrite all the INT_MAX
entries in the undo stack with the current history index,
permanently associating the undo items with the history line
away from which we are navigating.
(edit): Do not record an undo for a line terminating with
Enter. It is not an edit action. When leaving the funtion,
renumber any INT_MAX entries in the undo history to history
index zero. Thus edits to any line which is submitted via
Enter will (correctly) not be associated with that line,
which was not in fact edited, but with the new line that was
submitted.
(lino_cleanup): Follow rename of free_undo.
(lino_hist_add): Follow rename of undo_renumber_hist_idx.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (LINENOISE_MAX_UNDO): New preprocessor
symbol.
(struct lino_state): New member, undo_stack.
(struct lino_undo): New struct type.
(free_undo, record_undo, record_triv_undo, restore_undo):
New static functions.
(edit_insert): Record trivial undo item with record_triv_undo.
(edit_insert_str, edit_history_next, edit_delete,
edit_backspace, edit_delete_prev_all, edit_delete_prev_word,
edit_in_editor): Record undo item.
(edit): Record undo item before Ctrl-R history recall and
Ctrl-T twiddle. Also record one final undo item upon Enter, as
well as Ctrl-C. New Ctrl-O command to undo.
(lino_copy): Do not copy undo_stack, to prevent double
freeing.
(lino_free): Free the undo history.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (struc lino_state): New member,
clip, sel, end, dsel, dend, need_refresh, selmode.
(sync_data_to_buf): Update the sel and end members
of the structure based on dsel and dend, the way
pos is being updated from dpos.
(refresh_singleline, refresh_multiline): If visual selection
mode is in effect, show the selected region in inverse video.
(update_sel, clear_sel, yank_sel, delete_sel):
New static function.
(edit_insert): Delete the selection before inserting, so that
the character appears to replace the selection.
Set need_refresh flag instead of calling refresh_line.
(edit_insert_str): New static function. Inserts string,
replacing existing selection, if any.
(paren_jump, edit_move_left, edit_move_right, edit_move_home,
edit_move_end, edit_history_next): Set new
need_refresh flag instead of calling refresh_line directly.
(edit_delete): If selection is in effect, just delete the
selection and return. Set need_refresh flag instead
of calling refresh_line.
(edit_backspace): If selection is in effect, and selection
is not inverted (cursor is to the right of selection)
then just delete the selection. Otherwise delete the
selection, and perform the backspace. Set need_refresh flag
instead of calling refresh_line.
(edit_delete_prev_word): Delete the selection and the word
before the selection. Set need_refresh flag
instead of calling refresh_line.
(edit_in_editor): Set need_refresh_flag instead of
calling refresh_line, and cancel visual selection mode.
(edit): Clear selection mode on entry. Update the selection
variables on each loop iteration. Honor the need_refresh
flag. New commands implemented: Ctrl-S, Ctrl-Q, Ctrl-X Ctrl-Q.
Some commands need to set need_refresh flag.
Some need to cancel selection mode.
(lino_copy): Set the clip member of the cloned structure
to null, otherwise there will be a double free of the
clipboard buffer.
(lino_cleanup): Free the clipboard and null out the pointer.
* txr.1: Documented visual select.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Registered flatcar* intrinsic.
* lib.c (lazy_flatcar_scan, lazy_flatcar_func):
New static functions.
(lazy_flatcar): New function.
* lib.h (lazy_flatcar): Declared.
* txr.1: Documented, also touching flatten documentation.
|
|
|
|
|
|
|
|
| |
* parser.c (provide_atom): New static function.
(repl): Register provide_atom with linenoise as
atom callback.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register flatcar intrinsic.
* lib.c (flatcar): New function.
* lib.h (flatcar): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit): Ctrl-X Ctrl-W,
or Ctrl-X w, with an optional number in between,
cause a word from the previous line to be inserted.
* txr.1: Documented.
|
|
|
|
| |
* txr.1: Description wrongly refers to getpwuid.
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (load_rcfile): Use path-exists-p for the existence
check. Since that doesn't throw, it's outside of the
catch section. Use path-private-to-me-p to impose a security
check on the profile file. If an error exception is caught,
show the details.
* txr.1: Added notes about security check.
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (path_test_set_entries: "path-private-to-me-p"
addred to name array.
* share/txr/stdlib/path-test.tl (path-private-to-me-p): New
function.
* txr.1: Documented path-private-to-me.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure (have_grgid): New variable.
New tests added for getgrent and the rest.
(HAVE_GRGID, HAVE_GRGID_R): New preprocessor symbols
conditionally deposited into config/config.h.
* sysif.c (group_s, mem_s): New global symbol variables.
(setgrent_wrap, endgrent_wrap, fill_group, make_grstruct,
get_grent_wrap, getgrgid_wrap, getgrnam_wrap): New static
functions.
(sysif_init): New global symbol variables initialized.
New group struct type instantiated.
Intrinsic functions setgrent, endgrent, getgrent,
getgrgid and getgrnam registered.
* txr.1: Documented group structure and functions.
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit): Support a verbatim
entry mode with limited commands, in which most
characters self-insert, including Enter.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (lino_get_multiline): New function.
* linenoise/linenoise.h (lino_get_multiline): Declared.
* parser.c (listener_hist_len, listener_multi_line_p_s): New
symbol global variables.
(repl): Set linenoise history length and multi-line mode from
the *listener-hist-len* and *listener-multi-line-p* variables
on each call. Set the *listener-multi-line* variable from
the lino_t object's current state after each linenoise call.
(parse_init): Initialize new global variables and register
them as special variables.
* txr.1: Update sentence which says that history is fixed
at 100 lines. Document listener configuration variables.
|
|
|
|
| |
* txr.1: New section about line length limit and other restrictions.
|
|
|
|
|
| |
* txr.1: Clear Screen, Suspend, and History Persistence
are not editing commands. They get their own sections.
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (tr, edit_in_editor): New
static functions.
(edit): edit_in_editor hooked in under Ctrl-X Ctrl-E.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The linenoise multi-line mode is just a glorified line
wrapper, and not actualy a multi-line editor, like in GNU
Readline and others. This commit fixes it. The edit buffer can
now contain line breaks, separated by carriage return
characters. (In single-line mode, these characters continue
to be displayed as ^M). The row and column calculations in the
multi-line refresh follow this data representation.
* linenoise/linenoise.c (sync_data_to_buf): This function
now takes an extra argument telling it whether multi-line mode
is in effect for the rendering. In multi-line mode, the prompt
is now added to the display data, so that multi-line refresh
is simplified by not having to account for the prompt length
in various calculations. Also, in multi-line mode, carriage
returns are rendered to display as CR-LF pairs, since they
denote embedded line breaks.
(complete_line): Pass mlmode to sync_data_to_buf.
(struct row_values): New struct, for returning multiple
row values out of a function.
(screen_rows, col_offset_in_str): New static functions.
(refresh_multiline): Modified to use screen_rows and
col_offset_in_str for its calculations, and not to deal with
the prompt at all, since the prompt is rolled into the display
data.
(refresh_line, edit_insert): Pass mlmode to sync_data_to_buf.
* txr.1: Documented multi-line mode.
|
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (LINENOISE_PAREN_DELAY): New
preprocessor symbol.
(scan_match_rev, scan_rev, usec_delay, paren_jump):
New static functions.
(edit): Handle closing parenthesis, bracket and brace
by inserting and calling paren_jump.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: Fix inappropriately copy and pasted ungrammatical
text "permutations is of zero length".
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* 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 (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.
|