summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Stand-alone application support.Kaz Kylheku2016-05-252-18/+150
| | | | | | | | | | | | | | | | | | | * txr.c (sysroot_init): Don't print "unable to calculate sysroot" error message in the fallback case, and use the absolute path of the executable directory as the sysroot in this case. (txr_main): Define static area prefixed by @(txr): header. If a string is present in this data area then process it as an argument. Treat the *args* variable carefully. If we use the stored string as the argument, save the args in orig_args variable, then later bind *args* to that. In the -e, -p and related options processing, we bind *args* to the original list so args are available to the expression being evaluated. If the expression mutates *args* then we keep the mutated args whether or not we are processing the stored string. * txr.1: Documented in new sction, STAND-ALONE APPLICATION SUPPORT.
* New variable: txr-path.Kaz Kylheku2016-05-252-0/+12
| | | | | | | * txr.c (dirname): New static function. (sysroot_init): Register txr-path variable. * txr.1: documented txr-path.
* Track origin across op/do expansion.Kaz Kylheku2016-05-231-0/+2
| | | | | | | | * eval.c (me_op): We tell a little lie here, by indicating that the "dwim body" is an expansion of the op operator. Of course, the entire lambda containing that body is that expansion. But in error messages, we need something useful for the user.
* Allow whitespace between @ and ; in comments.Kaz Kylheku2016-05-232-3/+3
| | | | | | | * parser.l (grammar): Recognize {WS}* between @ and ; (or the legacy #) in comments. * txr.1: Documentation updated.
* Don't use sleep function in tail streams.Kaz Kylheku2016-05-233-20/+9
| | | | | | | | | | | | | | | Let's use our usleep_wrap function which uses nanosleep. The old sleep can interact with SIGALRM. * stream.c (tail_calc): Calculate microseconds instead of seconds. (sleep): Wrapper for Windows gone. (tail_strategy): Rename sec variable to usec. Use usleep_wrap instead of sleep. * sysif.c (usleep_wrap): Change to extern. * sysif.h (usleep_wrap): Declaration updated.
* Optional argument on remove-path.Kaz Kylheku2016-05-233-8/+19
| | | | | | | | | | * stream.c (remove_path): New parameter, throw_on_error. (stream_init): Update registratino of remove_path intrinsic. * stream.h (remove_path): Declaration updated. * txr.1: Updated remove-path documentation to describe throw-on-error-p parameter.
* Bugfix: strange diagostic for -B-c.Kaz Kylheku2016-05-231-2/+7
| | | | | | * txr.c (txr_main): Diagnose unrecognized long option in if/else statement that handles long options, rather than clumsily in switch for non-clumping options.
* Few more drop_privilege calls in txr_main.Kaz Kylheku2016-05-231-0/+2
| | | | | | * txr.c (txr_main): Drop setuid privilege as soon as we know we are just going to exit, before producing any diagnostic output, like in existing cases.
* Neglected documentation about @(next).Kaz Kylheku2016-05-231-3/+8
| | | | | txr.1: It wasn't documented that expr in @(next expr) can produce a stream.
* Version 141.txr-141Kaz Kylheku2016-05-206-500/+581
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* No such word: expressivity.Kaz Kylheku2016-05-201-1/+1
| | | | * txr.1: Replace Expressivity with Expressiveness.
* Capitalize Boolean.Kaz Kylheku2016-05-201-23/+23
| | | | * txr.1: Capitalize Boolean everywhere.
* Implement listener variable for selection style.Kaz Kylheku2016-05-192-17/+49
| | | | | | | | | | | * parser.c (listener_sel_inclusive_p_s): New symbol variable. (repl): Install current value of *listener-sel-inclusive-p* variable into linenoise. (parse_init): Initialize the symbol variable and register the Lisp special variable. * txr.1: Documented special variable and selection mode semantics.
* linenoise: support inclusive selection.Kaz Kylheku2016-05-192-3/+23
| | | | | | | | | | | | | | * linenoise/linenoise.c (struct lino_state): New mode flag, selinclusive. (lino_set_selinclusive, lino_get_selinclusive): New functions. (sync_data_to_buf): Adjust rightmost endpoint when selection is reversed and inclusive mode is in effect, so that the included character will be visually highlighted. (yank_sel, delete_sel): Adjust endpoint of selection if in in inclusive mode. * linenoise/linenoise.h (lino_set_selinclusive, lino_get_selinclusive): Declared.
* Help text upkeep.Kaz Kylheku2016-05-181-0/+7
| | | | | * txr.c (help): Note the existence of --args and --eargs, without giving a full description.
* Grammar under Dot Position in Function Calls.Kaz Kylheku2016-05-181-2/+2
| | | | * txr.1: maybe -> may be.
* Streamline text about where Lisp is evaluated.Kaz Kylheku2016-05-181-16/+14
| | | | | | * txr.1: Just list directives that take Lisp; drop the details. Point out that no @ is needed for access to Lisp variable.
* Fix outdated example.Kaz Kylheku2016-05-181-1/+1
| | | | | * txr.1: @ is not required on Lisp variables.
* Formatting fix under make-random-stateKaz Kylheku2016-05-181-1/+1
| | | | * txr.1: Mistake in syntax markup.
* Use sys_load_s symbol variable.Kaz Kylheku2016-05-181-1/+1
| | | | | | * eval.c (eval_init): Use sys_load_s variable set up earlier in the function instead of redundant call to intern.
* New feature: self-load-path symbol macro.Kaz Kylheku2016-05-186-8/+94
| | | | | | | | | | | | | | | | | | | | | * eval.c (self_load_path_s): New symbol variable. (sys_load): Save, set-up and restore self-load-path around load. (set_get_symacro): New function. (eval_init): Register load function using sys_load_s instead of redundant intern. * eval.h (set_get_symacro): Declared. * match.c (v_load): Save, set-up and restore self-load-path macro. * parser.c (load_rcfile): Likewise. * txr.c (txr_main: Set up self-load-path when opening file. * txr.1: Documented self-load-path.
* Add notes about cursor shape and selection semantics.Kaz Kylheku2016-05-181-0/+23
| | | | | | | * txr.1: In Interactive Listener sections, note what "character under the cursor" means when a vertical cursor is in effect, and add notes about how the selection semantics pairs well with that style of cursor.
* New functions: at-exit-call and at-exit-do-not-call.Kaz Kylheku2016-05-183-0/+69
| | | | | | | | | | | | | | * sysif.c (at_exit_list): New static variable. (at_exit_call, at_exit_do_not_call): New functions. (at_exit_handler): New static function. (sysif_init): GC-protect at_exit_list. Register at_exit_handler with C atexit function. Register intrinsic functions at-exit-call and at-exit-do-not-call. * sysif.h (at_exit_call, at_exit_do_not_call): Registered. * txr.1: Documented.
* Handle integer overflow in length_list.Kaz Kylheku2016-05-181-2/+14
| | | | | | * lib.c (length_list): Count using cnum only up to INT_PTR_MAX, then switch to bignums.
* Adding termios support.Kaz Kylheku2016-05-187-1/+1407
| | | | | | | | | | | | | | | | * Makefile (termios.o): New object file. * lib.c (init): Call termios_init. * lisplib.c (termios_set_entries, termios_instantiate): New functions. (lisplib_init): Register new functions in autoload table. * share/txr/stdlib/termios.tl: New file. * termios.c, termios.h: New files. * txr.1: Documented termios.
* Bugfix in checkman leading to doc improvements.Kaz Kylheku2016-05-172-39/+20
| | | | | | | | | | | * checkman.txr: Check against blank line after .desc. Fix incorrect pattern, failing to match one-symbol Function/Operator/Macro headings. This exposes errors in the document that were previously undetected. * txr.1: Fix numerous occurrences of blank lines after .desc, missing .desc, incorrect headings and other problems.
* Some streamlining in the cons recycling.Kaz Kylheku2016-05-152-11/+9
| | | | | | | | | | | * lib.c (rcyc_pop): Just assume that *plist points to a cons and access the fields directly. (rcyc_cons): Don't bother with rplacd. (rcyc_list): Don't bother with set macro. * regex.c (read_until_match): Defensive coding: locally ensure that rcyc_pop won't be called on a nil stack, which will now segfault.
* Bugfix: recycled conses play nice with gen GC.Kaz Kylheku2016-05-151-0/+3
| | | | | | | | | | * lib.c (cons): When we recycle a cons, it could be already in the mature generation. In that case, baby objects stored in its car or cdr violate the integrity of the heap. We must hint about this to the garbage collector. Test case: ./txr --gc-debug -p "(list* 'foo (zip '(a) (repeat '((gensym)))))"
* Fix incorrect comment.Kaz Kylheku2016-05-151-1/+1
| | | | | * gc.c (gc_set): Should say "promote obj to gen 1", not "to gen 0".
* Fix generational-GC bug in struct code.Kaz Kylheku2016-05-141-3/+5
| | | | | | | | | * struct.c (static_slot_ensure): In the case when we grow the array of static slots, we were allowing chk_manage_vec to initialize the newly added element. This is wrong, because it is just a plain assignment, which causes a mature object to point to a baby object. This bug caused static slots to contain junk.
* Support autoloading for methods.Kaz Kylheku2016-05-131-2/+22
| | | | | | | * struct.c (lookup_slot_load, lookup_static_slot_load): New functions. (slot, static_slot): Use auto-load wrappers for lower-level slot lookup functions.
* Bugfix in - and / functions.Kaz Kylheku2016-05-131-4/+4
| | | | | | | | | Improper handling of arguments in certain cases. Test case: [[flipargs -] 2 1]. Should yield -1; actual behavior is error. * lib.c (minusv, divv): Correct test for more arguments after extracting the leftmost one.
* Wrong argument defaulting in record-adapter.Kaz Kylheku2016-05-091-1/+1
| | | | | | | | * stream.c (record_adapter): Use default_bool_arg rather than tnil. Since rb->include_match ends up passed directly to read_until_match, which deals with argument defaulting, we could just store the argument value into the structure.
* Version 140.txr-140Kaz Kylheku2016-05-076-690/+737
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Avoid unnecessary evaluation in argument defaulting.Kaz Kylheku2016-05-072-5/+1
| | | | | | | | * lib.h (default_arg): Inline function becomes macro, so we can avoid evaluating the default value expression when it is not needed. * lib.c (default_arg): Declaration removed.
* Argument of flush-stream now optional.Kaz Kylheku2016-05-072-3/+10
| | | | | | | | | * stream.c (flush_stream): Default the argument to std_output. (stream_init): Register flush-stream as having one optional arg. * txr.1: Updated flush-stream description.
* Get rid of txl prefix from symbols.Kaz Kylheku2016-05-071-23/+23
| | | | | | * genvim.txr: Let's not get rid of this just from the instructions comment, but from the internals. txl-* replaced with tl-*.
* Don't refer to .txl in install instructions.Kaz Kylheku2016-05-071-3/+3
| | | | | | * genvim.txr: "INSTALL-HOWTO" comment still talks about .txl files, an experimental suffix we didn't go with. Now fixed to .tl.
* Redundant addr in printed rep of string-input-stream.Kaz Kylheku2016-05-071-1/+1
| | | | | * stream.c (string_in_get_prop): Do not format stream address into name; the general stream_print_op already adds that.
* *args*, *args-full* and self-path in listener.Kaz Kylheku2016-05-071-8/+10
| | | | | | | * txr.c (txr_main): Register *args-full* variable before first branch to repl. In repl section, register or re-register *args* to any remaining args, and self-path to the string "listener".
* Replace abort with panic in setuid code.Kaz Kylheku2016-05-071-8/+7
| | | | | | * sysif.c (drop_privilege): If bailing due to a privilege management problem, use panic with a descriptive message instead of a plain abort.
* Adding panic macro, which throws a panic exception.Kaz Kylheku2016-05-074-2/+14
| | | | | | | | | | | * lib.c (panic_s): New symbol variable. (obj_init): Initialize panic_s. * lib.h (panic_s): Declared. * unwind.c (uw_init): Register panic exception. * unwind.h (panic): New macro.
* Cygwin and MinGW exception for GNU stack section.Kaz Kylheku2016-05-071-1/+1
| | | | | * jmp.S: Don't generate the .note.GNU-stack section on MinGW or Cygwin either.
* Less specific check for Cygwin in assembly code.Kaz Kylheku2016-05-071-1/+1
| | | | | jmp.S: check for __CYGWIN__ rather than __CYGWIN32__ for defining the DEFUN macro.
* New: standard stream redirection for subprocesses.Kaz Kylheku2016-05-072-11/+215
| | | | | | | | | | | | | | | | | | | When subprocesses are created using open-command, open-process, run or sh, any streams not bound by those functions are obtained from *stdin*, *stdout* or *stderr*, as appropriate. Thus manipulating these variables has the effect of redirecting not only local output within the program but over coprocesses as well. * stream.c (struct save_fds): New type. (FDS_IN, FDS_OUT, FDS_ERR): New macros. (fds_init, fds_subst, fds_swizzle, fds_restore): New static functions. (open_command, open_process, run): "Swizzle" and restore the standard file descriptors. * txr.1: Updated documentation of affected function.
* Some recent versions of flex contain // comment.Kaz Kylheku2016-05-061-1/+6
| | | | | | Makefile (lex.yy.c): Crudely and shamelessly filter lex.yy.c through sed to remove // commments, even if // occurs in a string literal or a /*...*/ comment which ends on that line.
* Copyright in --help text.Kaz Kylheku2016-05-051-1/+1
| | | | | txr.c (help): 2015 was so last year. Let's make it a range from 2009 to current.
* Condense --help text.Reini Urban2016-05-051-1/+0
| | | | | txr.c (help): Remove blank line between name and copyright line.
* Typo in --help.Reini Urban2016-05-051-1/+1
| | | | txr.c (help): "sare" -> "are".
* HACKING: typoReini Urban2016-05-051-1/+1
|