unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#12207: repl and comments or tabs
@ 2012-08-15 20:11 Andy Wingo
  2016-06-20 19:39 ` Andy Wingo
  2016-07-28 17:21 ` helpful.user
  0 siblings, 2 replies; 5+ messages in thread
From: Andy Wingo @ 2012-08-15 20:11 UTC (permalink / raw)
  To: Neil Jerram; +Cc: 12207

Hi Neil,

Mailing you since you were the last to touch the REPL, and perhaps you
have a desire for a small hack :)

There are two bugs that bother me off and on.  One is that pasting
Scheme code into the Guile REPL can cause autocompletion if the Scheme
code has tabs for whitespace.  I wonder, is there a way to fix that?

Another is that going up into the history where the history has
multi-line Scheme expressions with comments doesn't work, because a
comment from line N will cause lines N+1,N+2... to be commented out --
because they all end up on the same line.  Is there a way for the
history to preserve the multi-line nature of the input while only having
one prompt?  Dunno, just a thought.

Hope all is well.  Let me know if you are interested in these bugs.

Cheers,

Andy
-- 
http://wingolog.org/





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#12207: repl and comments or tabs
  2012-08-15 20:11 bug#12207: repl and comments or tabs Andy Wingo
@ 2016-06-20 19:39 ` Andy Wingo
  2016-07-28 17:21 ` helpful.user
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Wingo @ 2016-06-20 19:39 UTC (permalink / raw)
  To: Neil Jerram; +Cc: 12207

A very kind ping :)

You didn't sign up to do this but maybe you would like to do it?  I'll
never know if I don't ask :)

Hope you are well, & happy hacking :)

Andy

On Wed 15 Aug 2012 22:11, Andy Wingo <wingo@pobox.com> writes:

> Hi Neil,
>
> Mailing you since you were the last to touch the REPL, and perhaps you
> have a desire for a small hack :)
>
> There are two bugs that bother me off and on.  One is that pasting
> Scheme code into the Guile REPL can cause autocompletion if the Scheme
> code has tabs for whitespace.  I wonder, is there a way to fix that?
>
> Another is that going up into the history where the history has
> multi-line Scheme expressions with comments doesn't work, because a
> comment from line N will cause lines N+1,N+2... to be commented out --
> because they all end up on the same line.  Is there a way for the
> history to preserve the multi-line nature of the input while only having
> one prompt?  Dunno, just a thought.
>
> Hope all is well.  Let me know if you are interested in these bugs.
>
> Cheers,
>
> Andy





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#12207: repl and comments or tabs
  2012-08-15 20:11 bug#12207: repl and comments or tabs Andy Wingo
  2016-06-20 19:39 ` Andy Wingo
@ 2016-07-28 17:21 ` helpful.user
  2016-08-04 20:55   ` Andy Wingo
  1 sibling, 1 reply; 5+ messages in thread
From: helpful.user @ 2016-07-28 17:21 UTC (permalink / raw)
  To: 12207

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

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)

[-- Attachment #2: Type: text/html, Size: 315 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#12207: repl and comments or tabs
  2016-07-28 17:21 ` helpful.user
@ 2016-08-04 20:55   ` Andy Wingo
  2017-05-17 20:30     ` Andy Wingo
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Wingo @ 2016-08-04 20:55 UTC (permalink / raw)
  To: helpful.user@discard.email; +Cc: 12207

On Thu 28 Jul 2016 19:21, "helpful.user@discard.email" <helpful.user@discard.email> 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





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#12207: repl and comments or tabs
  2016-08-04 20:55   ` Andy Wingo
@ 2017-05-17 20:30     ` Andy Wingo
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Wingo @ 2017-05-17 20:30 UTC (permalink / raw)
  To: helpful.user@discard.email; +Cc: 12207-done

On Thu 04 Aug 2016 22:55, Andy Wingo <wingo@pobox.com> writes:

> On Thu 28 Jul 2016 19:21, "helpful.user@discard.email" <helpful.user@discard.email> 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

Done.  Thanks for the tip.  See NEWS for details.

Andy





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-05-17 20:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-15 20:11 bug#12207: repl and comments or tabs Andy Wingo
2016-06-20 19:39 ` Andy Wingo
2016-07-28 17:21 ` helpful.user
2016-08-04 20:55   ` Andy Wingo
2017-05-17 20:30     ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).