diff options
author | Andy Wingo <wingo@pobox.com> | 2017-05-17 22:09:26 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2017-05-17 22:29:08 +0200 |
commit | 96c9af4ab1490766fb1e2229ff3cf565cf7f10d1 (patch) | |
tree | b46ad651eae3b76a61fac4046ad2e776e75f0723 /guile-readline | |
parent | 7ac3d17ceaffc5f068e500c30b1728eae12ae0f0 (diff) |
readline: Avoid interpreting control characters in pastes.
* 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.
Diffstat (limited to 'guile-readline')
-rw-r--r-- | guile-readline/readline.c | 7 | ||||
-rw-r--r-- | guile-readline/readline.h | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/guile-readline/readline.c b/guile-readline/readline.c index a3e890346..c15275dd3 100644 --- a/guile-readline/readline.c +++ b/guile-readline/readline.c @@ -47,6 +47,8 @@ scm_t_option scm_readline_opts[] = { "History length." }, { SCM_OPTION_INTEGER, "bounce-parens", 500, "Time (ms) to show matching opening parenthesis (0 = off)."}, + { SCM_OPTION_BOOLEAN, "bracketed-paste", 1, + "Disable interpretation of control characters in pastes." }, { 0 } }; @@ -545,7 +547,10 @@ scm_init_readline () reentry_barrier_mutex = scm_make_mutex (); scm_init_opts (scm_readline_options, - scm_readline_opts); + scm_readline_opts); + rl_variable_bind ("enable-bracketed-paste", + SCM_READLINE_BRACKETED_PASTE ? "on" : "off"); + #if HAVE_RL_GET_KEYMAP init_bouncing_parens(); #endif diff --git a/guile-readline/readline.h b/guile-readline/readline.h index 2bf5f8000..3c935e2aa 100644 --- a/guile-readline/readline.h +++ b/guile-readline/readline.h @@ -39,7 +39,8 @@ SCM_RL_API scm_t_option scm_readline_opts[]; #define SCM_HISTORY_FILE_P scm_readline_opts[0].val #define SCM_HISTORY_LENGTH scm_readline_opts[1].val #define SCM_READLINE_BOUNCE_PARENS scm_readline_opts[2].val -#define SCM_N_READLINE_OPTIONS 3 +#define SCM_READLINE_BRACKETED_PASTE scm_readline_opts[3].val +#define SCM_N_READLINE_OPTIONS 4 SCM_RL_API SCM scm_readline_options (SCM setting); SCM_RL_API void scm_readline_init_ports (SCM inp, SCM outp); |