unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: "Jose A. Ortega Ruiz" <jao@gnu.org>
To: Neil Jerram <neil@ossau.homelinux.net>
Cc: geiser-users@nongnu.org, 33403@debbugs.gnu.org
Subject: bug#33403: [Geiser-users] bug#33403: Data length limit in Guile/Geiser/Scheme evaluation
Date: Fri, 16 Nov 2018 22:40:13 +0000	[thread overview]
Message-ID: <878t1sy7ci.fsf__38022.764834068$1542407946$gmane$org@imladris> (raw)
In-Reply-To: <878t1t1ety.fsf@ossau.homelinux.net> (Neil Jerram's message of "Fri, 16 Nov 2018 10:44:57 +0000")

On Fri, Nov 16 2018, Neil Jerram wrote:

> Mark H Weaver <mhw@netris.org> writes:
>
>> This is a documented limitation in Linux's terminal handling when in
>> canonical mode.  See the termios(3) man page, which includes this text:
>>
>>    Canonical and noncanonical mode
>>        
>>        The setting of the ICANON canon flag in c_lflag determines
>>        whether the terminal is operating in canonical mode (ICANON set)
>>        or noncanonical mode (ICANON unset).  By default, ICANON is set.
> [...]
>>        * The maximum line length is 4096 chars (including the
>>          terminating newline character); lines longer than 4096 chars
>>          are truncated.  After 4095 characters, input processing (e.g.,
>>          ISIG and ECHO* processing) continues, but any input data after
>>          4095 characters up to (but not including) any terminating
>>          newline is discarded.  This ensures that the terminal can
>>          always receive more input until at least one line can be read.
>>
>> Note that last item above.
>
> Awesome; thank you Mark.
>
> So possibly this limit can be removed, in my Org/Geiser context, by
> evaluating (system* "stty" "-icanon") when initializing the Geiser-Guile
> connection.  I'll try that.  Will the terminal that that 'stty' sees be
> the same as Guile's stdin?
>
> Jao, if that works, I wonder if it should be the default for Geiser?  It
> appears to me that Geiser shouldn't ever need the features of canonical
> mode.  Is that right?

I don't really know offhand.  Geiser simply uses comint-mode to talk to
Guile, and that in turn must be using Emacs' ability to spawn a process
and redirect its stdout and stderr, so I am not sure where the stty
kernel side enters the game, and how exactly shuold that call to system*
be performed to make sure it only affects the guile-emacs
communications.

Geiser has a mode of operation whereby it connects to a running Guile
REPL server instead of spawning its own process.  In that mode, instead
of a stdout/err redirection what is used is a TCP/IP connection, that
won't have any of this limitations.  So a cleaner solution would be to
make geiser always use a REPL server for Guile, but that requires some
non-trivial work on my side.  Another option would be for the org mode
package to setup a guile server and then use connect-to-guile (instead
of run-guile), but i don't know how difficult that would be.

Finally, a shabby workaround would be generating multiple lines instead
of a big one :)  That's of course not a real solution, but maybe can
work as a stopgap.

> Anyway, I'll see first if the stty call is effective.

Excellent.  Thanks for taking the time and please keep us posted!

Cheers,
jao
-- 
"I don't want to achieve immortality through my work... I want to
achieve it through not dying" -- Woody Allen





  parent reply	other threads:[~2018-11-16 22:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87sh021kw2.fsf@ossau.homelinux.net>
     [not found] ` <878t1ugyf9.fsf@nicolasgoaziou.fr>
     [not found]   ` <87h8gi1g5g.fsf@ossau.homelinux.net>
     [not found]     ` <871s7mz357.fsf@imladris>
     [not found]       ` <87bm6q1c33.fsf@ossau.homelinux.net>
     [not found]         ` <87bm6q1c33.fsf-mq78CtbEgnGjF4gvJNWmbtHuzzzSOjJt@public.gmane.org>
2018-11-15 22:33           ` Data length limit in Guile/Geiser/Scheme evaluation Neil Jerram
2018-11-16  6:49             ` bug#33403: [Geiser-users] " Mark H Weaver
2018-11-16  7:13               ` Mark H Weaver
2018-11-16 10:44                 ` Neil Jerram
2018-11-16 11:16                   ` Neil Jerram
2018-11-16 22:40                   ` Jose A. Ortega Ruiz [this message]
     [not found]                   ` <875zwx1dcn.fsf@ossau.homelinux.net>
2018-11-16 23:12                     ` bug#33403: [Geiser-users] bug#33403: " Jose A. Ortega Ruiz
     [not found]                     ` <87va4wwra7.fsf@imladris>
2018-11-17  7:09                       ` Mark H Weaver
     [not found]                       ` <87zhu8w55u.fsf@netris.org>
2018-11-17  7:31                         ` Mark H Weaver
2018-11-17 14:59                         ` Jose A. Ortega Ruiz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='878t1sy7ci.fsf__38022.764834068$1542407946$gmane$org@imladris' \
    --to=jao@gnu.org \
    --cc=33403@debbugs.gnu.org \
    --cc=geiser-users@nongnu.org \
    --cc=neil@ossau.homelinux.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).