summaryrefslogtreecommitdiff
path: root/guile-readline/readline.c
AgeCommit message (Collapse)AuthorFilesLines
2021-06-02Fix else in init_bouncing_parens()Daniel Llorens1-6/+8
2021-05-27Fix null dereference in readline initializationDaniel Llorens1-6/+11
* guile-readline/readline.c (init_bouncing_parens): Check that the keymap is valid before using it.
2021-05-19Fixed style for 02439a124jakub-w1-5/+3
* guile-readline/readline.c (scm_filename_completion_function)
2021-05-19Fixed filename-completion-function for readline completionJakub Wojciech1-1/+4
* guile-readline/readline.c (scm_filename_completion_function): A completion function should return #f when there's no more candidates. Since the result of readline's rl_filename_completion_function was never checked it was impossible for it to work as intended and instead of #f it threw an error from trying to convert NULL to an scm string.
2020-01-28Fix check for rl_get_keymapDaniel Llorens1-3/+3
This lets Guile build on OS X (tested on 10.14) with the system-provided libreadline. * acinclude.m4 (GUILE_READLINE): Check for rl_get_keymap_name instead of rl_get_keymap. The system provided libreadline is an alias to libedit, which has _keymap but not _keymap_name, and Guile uses both. * guile-readline/readline.c: Adjust the include guard.
2020-01-27Add missing include for strncmp()Daniel Llorens1-0/+1
2018-06-20Update license notices in all C filesAndy Wingo1-18/+17
Update to newest recommended license notices from the FSF. Everything stays LGPLv3+ except guile-readline which is GPLv3+.
2018-06-20Remove (C) from copyright statementsAndy Wingo1-1/+1
As the FSF advises, 'There is no legal significance to using the three-character sequence “(C)”, but it does no harm.' It does take up space though! For that reason, we remove it here from our C files.
2018-06-20Rationalize guile-readline includesAndy Wingo1-5/+6
* guile-readline/readline.c: Rationalize header include order.
2018-06-18Remove includes of validate.h.Andy Wingo1-3/+2
* guile-readline/readline.c: * libguile/alist.c: * libguile/array-map.c: * libguile/arrays.c: * libguile/async.c: * libguile/atomic.c: * libguile/backtrace.c: * libguile/boolean.c: * libguile/bytevectors.c: * libguile/chars.c: * libguile/continuations.c: * libguile/debug.c: * libguile/dynl.c: * libguile/eq.c: * libguile/error.c: * libguile/eval.c: * libguile/evalext.c: * libguile/expand.c: * libguile/feature.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/fports.c: * libguile/gc-malloc.c: * libguile/gc.c: * libguile/goops.c: * libguile/goops.h: * libguile/guardians.c: * libguile/hash.c: * libguile/hashtab.c: * libguile/hashtab.h: * libguile/hooks.c: * libguile/i18n.c: * libguile/ioext.c: * libguile/keywords.c: * libguile/list.c: * libguile/load.c: * libguile/macros.c: * libguile/memoize.c: * libguile/modules.h: * libguile/net_db.c: * libguile/numbers.c: * libguile/pairs.c: * libguile/poll.c: * libguile/ports.c: * libguile/posix.c: * libguile/print.c: * libguile/procprop.c: * libguile/procs.c: * libguile/promises.c: * libguile/r6rs-ports.c: * libguile/random.c: * libguile/rdelim.c: * libguile/read.c: * libguile/regex-posix.c: * libguile/rw.c: * libguile/scmsigs.c: * libguile/script.c: * libguile/simpos.c: * libguile/socket.c: * libguile/sort.c: * libguile/srcprop.c: * libguile/srfi-1.c: * libguile/srfi-4.c: * libguile/srfi-60.c: * libguile/stacks.c: * libguile/stime.c: * libguile/strings.c: * libguile/strorder.c: * libguile/strports.c: * libguile/struct.c: * libguile/symbols.c: * libguile/syntax.c: * libguile/threads.c: * libguile/throw.c: * libguile/trees.c: * libguile/unicode.c: * libguile/values.c: * libguile/variable.c: * libguile/vectors.c: * libguile/vports.c: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: * libguile.h: Remove validate.h include.
2017-05-17readline: Avoid interpreting control characters in pastes.Andy Wingo1-1/+6
* NEWS: Update. * doc/ref/repl-modules.texi (Readline Options): Update for bracketed-paste. * guile-readline/readline.h (SCM_READLINE_BRACKETED_PASTE): Add bracketed-paste option. * guile-readline/readline.c (scm_readline_opts): Add bracketed-paste. (scm_init_readline): Wire up the logic.
2016-06-24Avoid stifling readline history when looking up optionsDaniel Llorens1-27/+29
With this patch, history is never stifled unless (readline-set!) is used. * src/guile-readline/readline.c (scm_readline_options)
2013-03-28Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-27/+5
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
2013-03-09simplify readline.cAndy Wingo1-27/+4
* guile-readline/readline.c: Remove all mingw special-casing, relying instead on mingw / gnulib doing the right thing.
2013-01-15add scm_from_port_string and friendsAndy Wingo1-7/+2
* 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.
2010-07-09readline only handles SIGWINCHAndy Wingo1-9/+20
* 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.
2010-06-02fix argument tab-completionAndy Wingo1-2/+2
* 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!
2009-12-05decruftify scm_sys_protectsAndy Wingo1-1/+1
* 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.
2009-09-09Make scm_i_from_stringn into API for use with libguilereadlineMichael Gran1-2/+2
* 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
2009-09-07Fix broken interaction between readline and UnicodeMichael Gran1-2/+9
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
2009-08-21Don't use a sub-`configure' for `guile-readline'.Ludovic Courtès1-4/+4
* 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.
2009-06-23Remove AC_SYS_RESTARTABLE_SYSCALLS and related codeNeil Jerram1-23/+0
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.
2009-06-17Change guile-readline license to GPLv3+Neil Jerram1-1/+1
2008-09-28Remove GH and its traces.Han-Wen Nienhuys1-1/+0
2008-02-15Release stuff: missing NEWS and 2007/2008 copyrights.Neil Jerram1-1/+1
2008-01-29* readline.c (scm_init_readline): Only do init_bouncing_parens ()Neil Jerram1-0/+4
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.
2007-06-25Changes from arch/CVS synchronizationLudovic Courtès1-1/+2
2007-01-19terminate option list with NULL.Han-Wen Nienhuys1-3/+1
(scm_init_readline): fix CVS mess-up.
2007-01-19* readline.c: terminate option list with NULL.Han-Wen Nienhuys1-1/+2
* 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.
2006-06-17merge from 1.8 branchKevin Ryde1-4/+2
2006-04-16merge from 1.8 branchKevin Ryde1-1/+1
2005-05-23The FSF has a new address.Marius Vollmer1-2/+2
2005-03-02Use scm_current_input_port instead of scm_cur_inp. Use scm_std_selectMarius Vollmer1-5/+5
instead of scm_internal_select.
2004-08-19Avoid the use of discouraged or deprecated things.Marius Vollmer1-21/+28
2004-07-10Replaced all uses of deprecated SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,Marius Vollmer1-8/+8
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!
2004-07-06Replaced all uses of deprecated SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,Marius Vollmer1-2/+2
SCM_NEGATE_BOOL, and SCM_BOOLP with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively.
2003-04-05* readline.c (redisplay): Removed. (It didn't do anything otherMikael Djurfeldt1-9/+1
than calling rl_redisplay.) (scm_init_readline): Don't inititalize rl_redisplay_function.
2003-03-19* readline.c: add HAVE_CONFIG_H test guarding #include config.h.Rob Browning1-0/+4
2003-01-08Fix input/output port typo.Neil Jerram1-1/+1
2002-11-03* __scm.h (USE_THREADS, GUILE_ISELECT): Define whenMarius Vollmer1-8/+0
SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
2002-11-02fixed mangled comment.Marius Vollmer1-1/+1
2002-10-27(reentry_barrier_mutex): Reimplemented with scm_make_mutex, etc.Marius Vollmer1-5/+5
2001-11-042001-11-04 Stefan Jahn <stefan@lkcc.org>Stefan Jahn1-3/+21
* 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.
2001-11-02Include `io.h' and exclude `sys/time.h' for MinGW.Marius Vollmer1-0/+4
2001-08-31* Removed lots of deprecated stuff.Dirk Herrmann1-4/+0
2001-07-09Remove "face-lift" comment.Thien-Thi Nguyen1-2/+0
2001-06-30* Don't use SCM_LISTn any more.Dirk Herrmann1-2/+2
2001-06-14Replace "scm_*_t" with "scm_t_*".Marius Vollmer1-5/+5
2001-06-14* configure.in: Check for rl_filename_completion_function.Marius Vollmer1-0/+8
* 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.
2001-06-07* Introduce SCM_UNUSED and mark unused function parameters.Dirk Herrmann1-2/+2
* Introduce SCM_DEBUG_PAIR_ACCESSES. * Extend the possibilities of SCM_DEBUG_CELL_ACCESSES.