[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/01: readline: Avoid interpreting control characters i
From: |
Andy Wingo |
Subject: |
[Guile-commits] 01/01: readline: Avoid interpreting control characters in pastes. |
Date: |
Wed, 17 May 2017 16:29:35 -0400 (EDT) |
wingo pushed a commit to branch stable-2.2
in repository guile.
commit 96c9af4ab1490766fb1e2229ff3cf565cf7f10d1
Author: Andy Wingo <address@hidden>
Date: Wed May 17 22:09:26 2017 +0200
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.
---
NEWS | 17 +++++++++++++++++
doc/ref/repl-modules.texi | 2 ++
guile-readline/readline.c | 7 ++++++-
guile-readline/readline.h | 3 ++-
4 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/NEWS b/NEWS
index d2c6197..6d7e58e 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,23 @@ Please send Guile bug reports to address@hidden
+Changes in 2.2.3 (since 2.2.2):
+
+* Bug fixes
+
+** Enable GNU Readline 7.0's support for "bracketed paste".
+
+Before, when pasting an expression that contained TAB characters into
+Guile's REPL with GNU Readline support enabled, the pasted TAB
+characters would trigger autocompletion in Readline. This was never
+what you wanted. Guile now sets the new "bracketed-paste" option in GNU
+Readline 7.0 to on by default, making readline treat pastes into the
+terminal as atomic units without control characters. See "Readline
+Options" in the manual for full details.
+
+** Fix time-monotonic from SRFI-19; broken in 2.2.1.
+
+
Changes in 2.2.2 (since 2.2.1):
* Bug fixes
diff --git a/doc/ref/repl-modules.texi b/doc/ref/repl-modules.texi
index 7008672..e20393b 100644
--- a/doc/ref/repl-modules.texi
+++ b/doc/ref/repl-modules.texi
@@ -108,6 +108,8 @@ history-file yes Use history file.
history-length 200 History length.
bounce-parens 500 Time (ms) to show matching opening parenthesis
(0 = off).
+bracketed-paste yes Disable interpretation of control characters
+ in pastes.
@end smalllisp
The readline options interface can only be used @emph{after} loading
diff --git a/guile-readline/readline.c b/guile-readline/readline.c
index a3e8903..c15275d 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 2bf5f80..3c935e2 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);