summaryrefslogtreecommitdiff
path: root/guile-readline/readline.c
Commit message (Expand)AuthorAgeFilesLines
* Avoid stifling readline history when looking up options...With this patch, history is never stifled unless (readline-set!) is used. * src/guile-readline/readline.c (scm_readline_options) Daniel Llorens2016-06-241-27/+29
* Merge remote-tracking branch 'origin/stable-2.0'...Conflicts: configure.ac libguile/deprecated.c libguile/deprecated.h libguile/filesys.h libguile/fluids.c libguile/fports.c libguile/gc.c libguile/guile.c libguile/numbers.c libguile/objcodes.c libguile/r6rs-ports.c libguile/smob.c libguile/socket.c libguile/threads.h module/language/scheme/decompile-tree-il.scm module/language/tree-il/peval.scm test-suite/tests/syncase.test Mark H Weaver2013-03-281-27/+5
|\
| * simplify readline.c...* guile-readline/readline.c: Remove all mingw special-casing, relying instead on mingw / gnulib doing the right thing. Andy Wingo2013-03-091-27/+4
* | add scm_from_port_string and friends...* doc/ref/api-data.texi (Conversion to/from C): * libguile/strings.h: * libguile/strings.c (scm_from_port_string, scm_from_port_stringn): (scm_to_port_string, scm_to_port_stringn): New functions. * guile-readline/readline.c (internal_readline): * libguile/strports.c (scm_strport_to_string): * libguile/read.c (scm_read_number, scm_read_mixed_case_symbol): (scm_read_number_and_radix, scm_read_character): Use the new functions. Andy Wingo2013-01-151-7/+2
|/
* readline only handles SIGWINCH...* acinclude.m4 (GUILE_READLINE): Check for rl_catch_signals and rl_catch_sigwinch. * guile-readline/readline.c (scm_init_readline): If we can, turn off readline's signal handling, because we can do our own. (scm_readline): Use dynwinds to handle resetting readline's state on nonlocal exit, not catches. (unwind_readline): Rename from handle_error. Andy Wingo2010-07-091-9/+20
* fix argument tab-completion...* guile-readline/readline.c (scm_init_readline): Space is a word-breaking char too. Fixes tab-completion for args; thanks to Jao for the patch! Andy Wingo2010-06-021-2/+2
* decruftify scm_sys_protects...* libguile/root.h * libguile/root.c (scm_sys_protects): It used to be that for some reason we'd define a special array of "protected" values. This was a little silly, always, but with the BDW GC it's completely unnecessary. Also many of these variables were unused, and none of them were good API. So remove this array, and either eliminate, make static, or make internal the various values. * libguile/snarf.h: No need to generate calls to scm_permanent_object. * guile-readline/readline.c (scm_init_readline): No need to call scm_permanent_object. * libguile/array-map.c (ramap, rafe): Remove the dubious nullvect optimizations. * libguile/async.c (scm_init_async): No need to init scm_asyncs, it is no more. * libguile/eval.c (scm_init_eval): No need to init scm_listofnull, it is no more. * libguile/gc.c: Make scm_protects a static var. (scm_storage_prehistory): Change the sanity check to use the address of protects. (scm_init_gc_protect_object): No need to clear the scm_sys_protects, as it is no more. * libguile/keywords.c: Make the keyword obarray a static var. * libguile/numbers.c: Make flo0 a static var. * libguile/objprop.c: Make object_whash a static var. * libguile/properties.c: Make properties_whash a static var. * libguile/srcprop.h: * libguile/srcprop.c: Make scm_source_whash a global with internal linkage. * libguile/strings.h: * libguile/strings.c: Make scm_nullstr a global with internal linkage. * libguile/vectors.c (scm_init_vectors): No need to init scm_nullvect, it's unused. Andy Wingo2009-12-051-1/+1
* Make scm_i_from_stringn into API for use with libguilereadline...* libguile/strings.c (scm_i_from_stringn): renamed to scm_from_stringn. All callers changed. * libguile/strings.h: change declaration of scm_i_from_stringn to scm_from_stringn * libguile/strports.c (scm_strport_to_string): scm_i_from_stringn -> scm_from_stringn * guile-readline/readline.c (internal_readline): scm_i_from_stringn -> scm_from_stringn Michael Gran2009-09-091-2/+2
* Fix broken interaction between readline and Unicode...This requires separate small fixes. Readline has internal logic to deal with multi-byte characters, so it wants bytes, not characters. scm_c_read gets called by the vm when readline is activated, and it was truncating multi-byte characters because soft ports didn't have the UCS-4 capability. Soft ports need the capability to read UCS-4 characters. Since soft ports may have a single byte buffer, full characters need to be stored into the pushback buffer. This broke the optimizations in scm_c_read for using an alternate buffer for single-byte-buffered ports, because the opimization wasn't expecting anything in the pushback buffer. * libguile/vports.c (sf_fill_input): store complete chars, not single bytes * libguile/ports.c (scm_c_read): don't use optimized path for non Latin-1. Add debug prints. * libguile/string.h: make scm_i_from_stringn and scm_i_string_ref public so that readline can use them * guile-readline/readline.c: read bytes, not complete chars, from the input port. Convert output to the output port's locale Michael Gran2009-09-071-2/+9
* Don't use a sub-`configure' for `guile-readline'....* acinclude.m4 (GUILE_READLINE): New macro, based on the former `guile-readline/configure.ac'. * configure.ac: Remove `AC_CONFIG_SUBDIRS' invocation. Add `GUILE_READLINE' invocation. Produce files under `guile-readline'. * guile-readline/Makefile.am: Conditionalize the meat under `HAVE_READLINE'. (INCLUDES): Rename to... (AM_CPPFLAGS): this. Users updates. (AM_CFLAGS): New variable. (libguilereadline_v_@LIBGUILEREADLINE_MAJOR@_la_LIBADD): Add $(READLINE_LIBS). * guile-readline/readline.c: Include <config.h>. * guile-readline/configure.ac, guile-readline/autogen.sh: Remove. Ludovic Courtès2009-08-211-4/+4
* Remove AC_SYS_RESTARTABLE_SYSCALLS and related code...As the Autoconf documentation says, "These days portable programs [...] should not rely on `HAVE_RESTARTABLE_SYSCALLS', since nowadays whether a system call is restartable is a dynamic issue, not a configuration-time issue." In other words, if we ever rely on HAVE_RESTARTABLE_SYSCALLS, we are at the mercy of any code that Guile happens to be linked with, because that code could install a signal handler without the SA_RESTART flag, and then a Guile system call could unexpectedly return EINTR. The readline part of this goes back to this problem report: http://sources.redhat.com/ml/guile/2000-05/msg00177.html; and is an excellent example of the above paragraph. It was noted during the discussion that undefining HAVE_RESTARTABLE_SYSCALLS would fix the problem, but that solution wasn't adopted - I guess because Guile was still using cooperative threads then (not pthreads) and so there was a significant concern (whether founded or not) that not using restartable syscalls (where available) could lead to a loss of performance. Now Guile's default mode of operation is with pthreads, where we already don't assume that HAVE_RESTARTABLE_SYSCALLS is reliable, so there is no possible further performance loss. And in any case we really have no choice, if we want correct operation. Thanks to Sylvain Beucler for reporting this and suggesting the fix. * configure.in (AC_SYS_RESTARTABLE_SYSCALLS): Removed. * doc/ref/posix.texi (Signals): Remove statement that Guile always sets SA_RESTART flag. * guile-readline/configure.in (GUILE_SIGWINCH_SA_RESTART_CLEARED): Remove this setting, together with its test code. (HAVE_RL_PRE_INPUT_HOOK): Remove this setting and its code, as no longer needed. * guile-readline/readline.c (sigwinch_enable_restart): Removed. (scm_init_readline): Remove setting of rl_pre_input_hook. * libguile/_scm.h (SCM_SYSCALL): Remove the definition that relies on HAVE_RESTARTABLE_SYSCALLS. * libguile/scmsigs.c (scm_sigaction_for_thread): Don't always set the SA_RESTART flag if available. Update docstring accordingly. (scm_init_scmsigs): Remove code that sets SA_RESTART flag for all signals. * THANKS: Add Sylvain. Neil Jerram2009-06-231-23/+0
* Change guile-readline license to GPLv3+Neil Jerram2009-06-171-1/+1
* Remove GH and its traces.Han-Wen Nienhuys2008-09-281-1/+0
* Release stuff: missing NEWS and 2007/2008 copyrights.Neil Jerram2008-02-151-1/+1
* * readline.c (scm_init_readline): Only do init_bouncing_parens ()...if HAVE_RL_GET_KEYMAP. (init_bouncing_parens, find_matching_paren, match_paren): Compile out if ! HAVE_RL_GET_KEYMAP. * configure.in: Add check for rl_get_keymap. Neil Jerram2008-01-291-0/+4
* Changes from arch/CVS synchronizationLudovic Courtès2007-06-251-1/+2
* terminate option list with NULL....(scm_init_readline): fix CVS mess-up. Han-Wen Nienhuys2007-01-191-3/+1
* * readline.c: terminate option list with NULL....* read.c: idem. * print.c: idem. * eval.c: terminate option lists with 0. * options.c: remove n (for length) from scm_option_X functions. Detect option list length by looking for NULL name. Han-Wen Nienhuys2007-01-191-1/+2
* merge from 1.8 branchKevin Ryde2006-06-171-4/+2
* merge from 1.8 branchKevin Ryde2006-04-161-1/+1
* The FSF has a new address.Marius Vollmer2005-05-231-2/+2
* Use scm_current_input_port instead of scm_cur_inp. Use scm_std_select...instead of scm_internal_select. Marius Vollmer2005-03-021-5/+5
* Avoid the use of discouraged or deprecated things.Marius Vollmer2004-08-191-21/+28
* Replaced all uses of deprecated SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,...SCM_NEGATE_BOOL, and SCM_BOOLP with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively. Thanks to Andreas Vögele! Marius Vollmer2004-07-101-8/+8
* Replaced all uses of deprecated SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,...SCM_NEGATE_BOOL, and SCM_BOOLP with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively. Marius Vollmer2004-07-061-2/+2
* * readline.c (redisplay): Removed. (It didn't do anything other...than calling rl_redisplay.) (scm_init_readline): Don't inititalize rl_redisplay_function. Mikael Djurfeldt2003-04-051-9/+1
* * readline.c: add HAVE_CONFIG_H test guarding #include config.h.Rob Browning2003-03-191-0/+4
* Fix input/output port typo.Neil Jerram2003-01-081-1/+1
* * __scm.h (USE_THREADS, GUILE_ISELECT): Define when...SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile. Marius Vollmer2002-11-031-8/+0
* fixed mangled comment.Marius Vollmer2002-11-021-1/+1
* (reentry_barrier_mutex): Reimplemented with scm_make_mutex, etc.Marius Vollmer2002-10-271-5/+5
* 2001-11-04 Stefan Jahn <stefan@lkcc.org>... * NEWS: Corrected remarks about SCM_API. * configure.in: Defining USE_DLL_IMPORT definition to indicate usage of DLL import macros in `libguile/__scm.h'. (LIBOBJS): Removed `fileblocks.o' from the list of object files. Somehow Jim Blandy's patch from 1997 did not survive. 2001-11-04 Stefan Jahn <stefan@lkcc.org> * configure.in (EXTRA_DEFS): Follow-up patch. Using SCM_IMPORT instead of __SCM_IMPORT__. * readline.c (scm_readline_init_ports): Disable input/output stream redirection for Win32. The readline package for Win32 does not support this. The guile-readline library works fine for command line editing. * readline.h (SCM_RL_API): Renamed __FOO__ macros into FOO. 2001-11-04 Stefan Jahn <stefan@lkcc.org> * Makefile.am (libguile_la_LIBADD): Added $(THREAD_LIBS_LOCAL) here (was at guile_LDADD) which describes the dependency correctly and allows a clean build on Win32. * __scm.h (SCM_API): Follow-up patch. Renamed __FOO__ macros into FOO. * __scm.h: USE_DLL_IMPORT indicates the usage of the DLL import macros for external libraries (libcrypt, libqthreads, libreadline and libregex). * coop-defs.h: Include <winsock2.h> for `struct timeval'. * posix.c (flock): Added support for flock() in M$-Windows. * guile.c (SCM_IMPORT): Follow-up patch. Use SCM_IMPORT instead of __SCM_IMPORT__. * fports.c (getflags): Differentiate reading and writing pipes descriptors. * filesys.c (S_IS*): Redefine all of the S_IS*() macros for M$-Windows. * coop.c (coop_condition_variable_timed_wait_mutex): Use conditionalized error code if `ETIMEDOUT' is not available. (scm_thread_usleep): Remove bogus declaration of `struct timeval timeout'. * numbers.c (PTRDIFF_MIN): Moved this definition where it actually belongs. That is because NO_PREPRO_MAGIC gets undefined after each inclusion of `num2integral.i.c'. (SIZE_MAX): Define NO_PREPRO_MAGIC if SIZE_MAX is undefined. 2001-11-04 Stefan Jahn <stefan@lkcc.org> * md/Makefile.am (EXTRA_DIST): Added `i386.asm'. * md/i386.asm: New file. Contains the Intel syntax version for nasm/tasm/masm of the file `i386.s'. * qt.h.in: Definition of QT_API, QT_IMPORT and QT_EXPORT. Prefixed each symbols which is meant to go into a DLL. * Makefile.am (libqthreads_la_LDFLAGS): Put `-no-undefined' into LDFLAGS to support linkers which do not allow unresolved symbols inside shared libraries. (EXTRA_DIST): Add `libqthreads.def', which is an export file definition for M$-Windows. It defines exported symbols. This is necessary because the M$VC linker does not know how to export assembler symbols into a DLL. 2001-11-04 Stefan Jahn <stefan@lkcc.org> * srfi-13.h, srfi-14.h, srfi-4.h: Follow-up patch. Renamed __FOO__ macros into FOO. 2001-11-04 Stefan Jahn <stefan@lkcc.org> * tests/ports.test: Run (close-port) before (delete-file) if necessary/advisory. Stefan Jahn2001-11-041-3/+21
* Include `io.h' and exclude `sys/time.h' for MinGW.Marius Vollmer2001-11-021-0/+4
* * Removed lots of deprecated stuff.Dirk Herrmann2001-08-311-4/+0
* Remove "face-lift" comment.Thien-Thi Nguyen2001-07-091-2/+0
* * Don't use SCM_LISTn any more.Dirk Herrmann2001-06-301-2/+2
* Replace "scm_*_t" with "scm_t_*".Marius Vollmer2001-06-141-5/+5
* * configure.in: Check for rl_filename_completion_function....* readline.c (s_scm_filename_completion_function): Use rl_filename_completion_function instead of filename_completion_function, if we have it. (scm_init_readline): Use rl_compentry_func_t instead if Function when _RL_FUNCTION_TYPEDEF is defined. Marius Vollmer2001-06-141-0/+8
* * Introduce SCM_UNUSED and mark unused function parameters....* Introduce SCM_DEBUG_PAIR_ACCESSES. * Extend the possibilities of SCM_DEBUG_CELL_ACCESSES. Dirk Herrmann2001-06-071-2/+2
* Make it compile with --disable-deprecated.... * readline.h: scm_option->scm_option_t. * readline.c (stream_from_fport): scm_fport->scm_fport_t; scm_option->scm_option_t. Martin Grabmüller2001-05-241-2/+2
* * validate.h...(SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,BITS,UBITS,INT,UINT}[_DEF]): new macros. * unif.h: type renaming: scm_array -> scm_array_t scm_array_dim -> scm_array_dim_t the old names are deprecated, all in-Guile uses changed. * tags.h (scm_ubits_t): new typedef, representing unsigned scm_bits_t. * stacks.h: type renaming: scm_info_frame -> scm_info_frame_t scm_stack -> scm_stack_t the old names are deprecated, all in-Guile uses changed. * srcprop.h: type renaming: scm_srcprops -> scm_srcprops_t scm_srcprops_chunk -> scm_srcprops_chunk_t the old names are deprecated, all in-Guile uses changed. * gsubr.c, procs.c, print.c, ports.c, read.c, rdelim.c, ramap.c, rw.c, smob.c, sort.c, srcprop.c, stacks.c, strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, unif.c, values.c, vectors.c, vports.c, weaks.c: various int/size_t -> size_t/scm_bits_t changes. * random.h: type renaming: scm_rstate -> scm_rstate_t scm_rng -> scm_rng_t scm_i_rstate -> scm_i_rstate_t the old names are deprecated, all in-Guile uses changed. * procs.h: type renaming: scm_subr_entry -> scm_subr_entry_t the old name is deprecated, all in-Guile uses changed. * options.h (scm_option_t.val): unsigned long -> scm_bits_t. type renaming: scm_option -> scm_option_t the old name is deprecated, all in-Guile uses changed. * objects.c: various long -> scm_bits_t changes. (scm_i_make_class_object): flags: unsigned long -> scm_ubits_t * numbers.h (SCM_FIXNUM_BIT): deprecated, renamed to SCM_I_FIXNUM_BIT. * num2integral.i.c: new file, multiply included by numbers.c, used to "templatize" the various integral <-> num conversion routines. * numbers.c (scm_mkbig, scm_big2num, scm_adjbig, scm_normbig, scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl): deprecated. (scm_i_mkbig, scm_i_big2inum, scm_i_adjbig, scm_i_normbig, scm_i_copybig, scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big, scm_i_long2big, scm_i_ulong2big, scm_i_bits2big, scm_i_ubits2big, scm_i_size2big, scm_i_ptrdiff2big, scm_i_long_long2big, scm_i_ulong_long2big, scm_i_dbl2big, scm_i_big2dbl, scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num, scm_bits2num, scm_ubits2num, scm_size2num, scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint, scm_num2bits, scm_num2ubits, scm_num2ptrdiff, scm_num2size): new functions. * modules.c (scm_module_reverse_lookup): i, n: int -> scm_bits_t.x * load.c: change int -> size_t in various places (where the variable is used to store a string length). (search-path): call scm_done_free, not scm_done_malloc. * list.c (scm_ilength): return a scm_bits_t, not long. some other {int,long} -> scm_bits_t changes. * hashtab.c: various [u]int -> scm_bits_t changes. scm_ihashx_closure -> scm_ihashx_closure_t (and made a typedef). (scm_ihashx): n: uint -> scm_bits_t use scm_bits2num instead of scm_ulong2num. * gsubr.c: various int -> scm_bits_t changes. * gh_data.c (gh_scm2double): no loss of precision any more. * gh.h (gh_str2scm): len: int -> size_t (gh_{get,set}_substr): start: int -> scm_bits_t, len: int -> size_t (gh_<num>2scm): n: int -> scm_bits_t (gh_*vector_length): return scm_[u]size_t, not unsigned long. (gh_length): return scm_bits_t, not unsigned long. * fports.h: type renaming: scm_fport -> scm_fport_t the old name is deprecated, all in-Guile uses changed. * fports.c (fport_fill_input): count: int -> scm_bits_t (fport_flush): init_size, remaining, count: int -> scm_bits_t * debug.h (scm_lookup_cstr, scm_lookup_soft, scm_evstr): removed those prototypes, as the functions they prototype don't exist. * fports.c (default_buffer_size): int -> size_t (scm_fport_buffer_add): read_size, write_size: int -> scm_bits_t default_size: int -> size_t (scm_setvbuf): csize: int -> scm_bits_t * fluids.c (n_fluids): int -> scm_bits_t (grow_fluids): old_length, i: int -> scm_bits_t (next_fluid_num, scm_fluid_ref, scm_fluid_set_x): n: int -> scm_bits_t (scm_c_with_fluids): flen, vlen: int -> scm_bits_t * filesys.c (s_scm_open_fdes): changed calls to SCM_NUM2LONG to the new and shiny SCM_NUM2INT. * extensions.c: extension -> extension_t (and made a typedef). * eval.h (SCM_IFRAME): cast to scm_bits_t, not int. just so there are no nasty surprises if/when the various deeply magic tag bits move somewhere else. * eval.c: changed the locals used to store results of SCM_IFRAME, scm_ilength and such to be of type scm_bits_t (and not int/long). (iqq): depth, edepth: int -> scm_bits_t (scm_eval_stack): int -> scm_bits_t (SCM_CEVAL): various vars are not scm_bits_t instead of int. (check_map_args, scm_map, scm_for_each): len: long -> scm_bits_t i: int -> scm_bits_t * environments.c: changed the many calls to scm_ulong2num to scm_ubits2num. (import_environment_fold): proc_as_ul: ulong -> scm_ubits_t * dynwind.c (scm_dowinds): delta: long -> scm_bits_t * debug.h: type renaming: scm_debug_info -> scm_debug_info_t scm_debug_frame -> scm_debug_frame_t the old names are deprecated, all in-Guile uses changed. (scm_debug_eframe_size): int -> scm_bits_t * debug.c (scm_init_debug): use scm_c_define instead of the deprecated scm_define. * continuations.h: type renaming: scm_contregs -> scm_contregs_t the old name is deprecated, all in-Guile uses changed. (scm_contregs_t.num_stack_items): size_t -> scm_bits_t (scm_contregs_t.num_stack_items): ulong -> scm_ubits_t * continuations.c (scm_make_continuation): change the type of stack_size form long to scm_bits_t. * ports.h: type renaming: scm_port_rw_active -> scm_port_rw_active_t (and made a typedef) scm_port -> scm_port_t scm_ptob_descriptor -> scm_ptob_descriptor_t the old names are deprecated, all in-Guile uses changed. (scm_port_t.entry): int -> scm_bits_t. (scm_port_t.line_number): int -> long. (scm_port_t.putback_buf_size): int -> size_t. * __scm.h (long_long, ulong_long): deprecated (they pollute the global namespace and have little value besides that). (SCM_BITS_LENGTH): new, is the bit size of scm_bits_t (i.e. of an SCM handle). (ifdef spaghetti): include sys/types.h and sys/stdtypes.h, if they exist (for size_t & ptrdiff_t) (scm_sizet): deprecated. * Makefile.am (noinst_HEADERS): add num2integral.i.c Michael Livshin2001-05-241-1/+1
* Merged from mvo-vcell-cleanup-1-branch.Marius Vollmer2001-05-151-2/+2
* * readline.c (scm_clear_history): New function....* readline.scm (readline-port): Call clear-history on exit. Thanks to Utz-Uwe Haus. Marius Vollmer2001-04-101-0/+10
* * readline.c: Add #include <stdio.h>Keisuke Nishida2001-03-091-0/+1
* * Fixed readline default input/output port parameter handling....* Removed redundant SCM_N?IMP tests. Dirk Herrmann2000-11-241-9/+9
* * Don't uses anything deprecated any more.Dirk Herrmann2000-11-241-10/+10
* FixMikael Djurfeldt2000-06-191-2/+2
* * readline.c (sigwinch_enable_restart, scm_init_readline):...Re-enable restart for SIGWINCH signal. Mikael Djurfeldt2000-06-191-0/+24
* * readline.c (scm_readline): Added parenthesis around && within...||. Fixed up prototype for `reentry_barrier'. Conditionally #include <unistd.h>. (Needed for `dup'.) Mikael Djurfeldt2000-06-141-2/+5
* * readline.c: Always provide scm_init_readline, also if readline...support is not included. Otherwise, a strange dynamic loading error will occur. (It would be better not to install libguilereadline at all.) Mikael Djurfeldt2000-06-061-3/+4