bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12207: repl and comments or tabs


From: Andy Wingo
Subject: bug#12207: repl and comments or tabs
Date: Thu, 04 Aug 2016 22:55:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

On Thu 28 Jul 2016 19:21, "address@hidden" <address@hidden> writes:

> The following patch to readline should fix the tab issue:
>
> https://lists.gnu.org/archive/html/bug-bash/2014-10/msg00211.html
>
> (AFACT you need to put "set enable-bracketed-paste on" in your ~
> /.inputrc too)

Fascinating!  I guess from Guile's side we should do

 rl_variable_bind ("enable-bracketed-paste", "on")

in our readline code; sound about right to you?  Would you mind trying
this patch to see what it does for you?

diff --git a/guile-readline/readline.c b/guile-readline/readline.c
index a3e8903..47875e4 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 }
 };
 
@@ -546,6 +548,9 @@ scm_init_readline ()
   reentry_barrier_mutex = scm_make_mutex ();
   scm_init_opts (scm_readline_options,
                 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..0986e3b 100644
--- a/guile-readline/readline.h
+++ b/guile-readline/readline.h
@@ -39,6 +39,7 @@ 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_READLINE_BRACKETED_PASTE scm_readline_opts[3].val
 #define SCM_N_READLINE_OPTIONS 3
 
 SCM_RL_API SCM scm_readline_options (SCM setting);

Andy





reply via email to

[Prev in Thread] Current Thread [Next in Thread]