From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Jakub Jankiewicz Newsgroups: gmane.emacs.devel Subject: Re: Scheme Interpreter in Emacs and Readline Date: Sun, 19 Apr 2020 09:14:00 +0200 Message-ID: <20200419091400.1d260c3a@jcubic> References: <20200418125113.014121d2@jcubic> <87imhx6ocz.fsf@yahoo.com> <20200418142918.7f5032b4@jcubic> <873690737p.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="45585"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 19 09:20:08 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQ4FL-000Blf-OI for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Apr 2020 09:20:07 +0200 Original-Received: from localhost ([::1]:38622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQ4FK-0007QR-Rg for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Apr 2020 03:20:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58250) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQ4EW-0006fb-ST for emacs-devel@gnu.org; Sun, 19 Apr 2020 03:19:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQ4EV-0007hd-Fw for emacs-devel@gnu.org; Sun, 19 Apr 2020 03:19:16 -0400 Original-Received: from smtpo68.poczta.onet.pl ([141.105.16.18]:37582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jQ4EU-0007eA-HV for emacs-devel@gnu.org; Sun, 19 Apr 2020 03:19:15 -0400 Original-Received: from jcubic (unknown [185.129.113.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jcubic@onet.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 494gzs3pBgz1XQFhf; Sun, 19 Apr 2020 09:14:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onet.pl; s=2011; t=1587280442; bh=WdrSkSQWzwEWwS4MJb8Lx0OfdF7jimAq4v68+STWxBI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JV24qaFdWmwi8a+o9pVgz2QhLW0r2rwGLOvrZWXGtXK+1e9RvDGQF3oY6KiPQgiET QSWgcNuEbyxBZXlA/99gUA9k9CqqW1xqqFygOgb+jT732tGmhWbuOBkQroQ8fo96b7 /cDJZzkc2IPGqkKnyhbCM4HM8CDlrlTjTMfb5eT4= In-Reply-To: <873690737p.fsf@yahoo.com> X-Mailer: Claws Mail 3.17.3git196 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-ONET_PL-MDA-SEGREGATION: 0 Received-SPF: pass client-ip=141.105.16.18; envelope-from=jcubic@onet.pl; helo=smtpo68.poczta.onet.pl X-detected-operating-system: by eggs.gnu.org: Linux 3.11 and newer [fuzzy] X-Received-From: 141.105.16.18 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:247288 Archived-At: On Sun, 19 Apr 2020 08:02:02 +0800 Po Lu wrote: > Jakub Jankiewicz writes: > > >> What do you mean by "when I resize the window or frame it keep adding > >> prompt to the prompt line"? > > > > I have prompt "lips> " and when I resize Emacs window on Fedora GNU/Linux > > (the only system I was testing this). on each resize I get new prompt so > > when I keep resizing I have something like this: > > > > lips> lips> lips> lips> lips> > > > > and they are all prompt because I can't delete it. Unless something wierd > > is happening. > > > >> It would also probbaly be helpful if you could post the source of your > >> Scheme interpreter. > > > > Sorry about that, my Scheme Interpreter is here: > > > > https://github.com/jcubic/lips/tree/devel > > > > Please use devel branch since it's most up to date, I still try to make it > > compatible with R5RS, before I release new version, it will 1.0. > > > > The executable is in bin directry (there are not much code, but it would > > be easier to have link that you can run insead of send this to the > > mailing list. > > > > https://github.com/jcubic/lips/blob/devel/bin/lips.js > > > > Just run: > > > > git clone https://github.com/jcubic/lips.git > > cd lips > > git checkout devel > > > > and run in GUI Emacs: > > > > (run-scheme "/lips/bin/lips.js") > > > > and resize the Frame or buffer's window if you have multiple windows. > > > > > > And I need to add that I was looking at Node.js source code, there is lot > > of code but it also use Readline and Node.js works in run-js (I'm not > > sure if it use something else for --interactive option that was suggested > > when I've search how to run node in Emacs). > > > > I've tested my interpeter with same run-js and I have same issue with > > duplicated prompt. > > > > -- > > Jakub Jankiewicz, Web Developer > > https://jcubic.pl/me > > I'm not sure about run-js, but I turned off Readline in your > interpreter, and it now works flawlessly inside comint. Since Readline > is pretty much useless anyways there, it might be worth it to turn it > off inside Emacs. (ie check the EMACS and INSIDE_EMACS variables, or add > something like CMU's `-emacs' flag.) > > Bash does the same thing too; > https://lists.gnu.org/archive/html/bug-bash/2015-03/msg00179.html > I've used this: const rl = readline.createInterface({ input: process.stdin, output: process.stdout, prompt: prompt, terminal: !!process.stdin.isTTY && !(process.env.EMACS || process.env.INSIDE_EMACS) }); Thanks, it works perfetly, this will be required for any Readline Node.js interpreter or REPL that runs in GNU Emacs. -- Jakub Jankiewicz, Web Developer https://jcubic.pl/me