From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Jose A. Ortega Ruiz" Newsgroups: gmane.lisp.guile.bugs Subject: bug#33403: [Geiser-users] bug#33403: Data length limit in Guile/Geiser/Scheme evaluation Date: Fri, 16 Nov 2018 22:40:13 +0000 Message-ID: <878t1sy7ci.fsf__38022.764834068$1542407946$gmane$org@imladris> References: <87sh021kw2.fsf@ossau.homelinux.net> <878t1ugyf9.fsf@nicolasgoaziou.fr> <87h8gi1g5g.fsf@ossau.homelinux.net> <871s7mz357.fsf@imladris> <87bm6q1c33.fsf@ossau.homelinux.net> <87o9aq55tl.fsf@ossau.homelinux.net> <87d0r5349t.fsf@netris.org> <87y39t1olc.fsf@netris.org> <878t1t1ety.fsf@ossau.homelinux.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1542407946 17117 195.159.176.226 (16 Nov 2018 22:39:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Nov 2018 22:39:06 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.90 (gnu/linux) Cc: geiser-users@nongnu.org, 33403@debbugs.gnu.org To: Neil Jerram Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Nov 16 23:39:02 2018 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNmlS-0004Kz-3z for guile-bugs@m.gmane.org; Fri, 16 Nov 2018 23:39:02 +0100 Original-Received: from localhost ([::1]:47299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNmnY-0000Ga-Dm for guile-bugs@m.gmane.org; Fri, 16 Nov 2018 17:41:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNmnS-0000GT-Rr for bug-guile@gnu.org; Fri, 16 Nov 2018 17:41:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNmnO-00077m-S3 for bug-guile@gnu.org; Fri, 16 Nov 2018 17:41:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52653) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNmnO-00077M-KO for bug-guile@gnu.org; Fri, 16 Nov 2018 17:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gNmnO-0001Km-DX for bug-guile@gnu.org; Fri, 16 Nov 2018 17:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Jose A. Ortega Ruiz" Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 16 Nov 2018 22:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33403 X-GNU-PR-Package: guile X-GNU-PR-Keywords: notabug Original-Received: via spool by 33403-submit@debbugs.gnu.org id=B33403.15424080265081 (code B ref 33403); Fri, 16 Nov 2018 22:41:02 +0000 Original-Received: (at 33403) by debbugs.gnu.org; 16 Nov 2018 22:40:26 +0000 Original-Received: from localhost ([127.0.0.1]:56911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNmmn-0001Jr-9P for submit@debbugs.gnu.org; Fri, 16 Nov 2018 17:40:26 -0500 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:38267) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNmmk-0001Je-IW for 33403@debbugs.gnu.org; Fri, 16 Nov 2018 17:40:23 -0500 Original-Received: by mail-wr1-f43.google.com with SMTP id e3-v6so26397766wrs.5 for <33403@debbugs.gnu.org>; Fri, 16 Nov 2018 14:40:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=mmJqUyRrNkQF//WPC5f3NgJxt2gFBimS4Pypx1vNAUg=; b=UXD+Jo+AdOxFzX+DYLjtB/y4AIU8usEpCeb7oR0gM4NMzraOI+TRDDhaYl1n5hW4tM 0+6rE5MGjzdnpvwEwjVWhMdZHTarUD7KxJOEcw3IHGZ9vD5SyQeqeK5tbttLQJmHzixa 8ELdPsYPxAK3j+x/fsYhpVfjXDG9OHvWaa6gP4yCF1Yfj07RkRqSQN+v86SfDS05mL7b 2OztJyqfQ4/kZseBUoS+OIuBWG11FjtfSr+7K3DIRlX0cxEaw3pz4oqWDBIOoC5qimDe A7gypRzcDFDzgMS562b+/Uf3yycVjuAfjWvMjmzp4nrGpqV2svjFWm/V5WGWX2CMMz+f a2HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=mmJqUyRrNkQF//WPC5f3NgJxt2gFBimS4Pypx1vNAUg=; b=o0AMDBRh8pcU5QO7Ggu+kxjTJkARTtZjBJE+jrjeSGT97a4IAayzO9PyfyG3QiMgRG MNJKPnrFVpZ0Tqmpm6htBHr0j5C8LSOxCKqkZQjVIQBvZoSQUxhiys24dPzYzpC8x1J4 YUKkuN0ol+/0c4LUUr8aZZNWqn9eZDfz0iPgOhSlcHo0og9VT3H1MIX1WfGEVXihaqvb OxfUF+VB5B64nMBG8QnjfaXNchTiiM5BDwAKri0/MitXWTZGIEqu9U2eSazGCAjKdRsM t2TtJ1gqPbB6mOy6S+ExKAwpScWgL9Vd79yeW5QyhwYiXxe20gdHf9ntuF9O8uV914ZZ Q/2g== X-Gm-Message-State: AGRZ1gK6KL62mUd6i+EYAIbgqYDADGW2fiF9L+y/UspJZvLYK4klXP7Q vko+kAsdMLHT/nc1SXtGhMQpCpBcuiQ= X-Google-Smtp-Source: AJdET5eOHqO6KVyfbvagM5J1Zgqn2nGY0sVCH0ou5W4vgqn4ZedwEdH7Nasmq1mruclajWJ9C8/xeA== X-Received: by 2002:adf:f68e:: with SMTP id v14-v6mr10977887wrp.261.1542408016052; Fri, 16 Nov 2018 14:40:16 -0800 (PST) Original-Received: from imladris.local (cpc103058-sgyl39-2-0-cust254.18-2.cable.virginm.net. [94.173.216.255]) by smtp.gmail.com with ESMTPSA id a18sm1479339wrp.13.2018.11.16.14.40.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Nov 2018 14:40:14 -0800 (PST) Original-Received: from imladris (localhost [127.0.0.1]) by imladris.local (Postfix) with ESMTPS id E51FD320228; Fri, 16 Nov 2018 23:40:13 +0100 (CET) In-Reply-To: <878t1t1ety.fsf@ossau.homelinux.net> (Neil Jerram's message of "Fri, 16 Nov 2018 10:44:57 +0000") X-Attribution: jao X-Clacks-Overhead: GNU Terry Pratchett X-URL: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9273 Archived-At: On Fri, Nov 16 2018, Neil Jerram wrote: > Mark H Weaver 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