From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#24492: 24.5; Emacs unresponsive when sending buffer or region to Octave Date: Mon, 30 Nov 2020 13:42:46 +0100 Message-ID: <87ft4r8189.fsf@gnus.org> References: <687b2dd9-6626-f1a3-0c46-50410a1c9e64@alshu.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5350"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 24492@debbugs.gnu.org To: "Anton S." Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 30 14:05:14 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kjirh-0001EM-5k for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Nov 2020 14:05:13 +0100 Original-Received: from localhost ([::1]:56912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjirg-0000GA-3P for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Nov 2020 08:05:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjiWF-0007j9-ND for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2020 07:43:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42500) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kjiWE-0007QW-KC for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2020 07:43:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kjiWE-00081z-Gd for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2020 07:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Nov 2020 12:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24492 X-GNU-PR-Package: emacs Original-Received: via spool by 24492-submit@debbugs.gnu.org id=B24492.160674018030863 (code B ref 24492); Mon, 30 Nov 2020 12:43:02 +0000 Original-Received: (at 24492) by debbugs.gnu.org; 30 Nov 2020 12:43:00 +0000 Original-Received: from localhost ([127.0.0.1]:54046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjiWC-00081j-5I for submit@debbugs.gnu.org; Mon, 30 Nov 2020 07:43:00 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:36110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjiW9-00081T-Cz for 24492@debbugs.gnu.org; Mon, 30 Nov 2020 07:42:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HiGoPz5U+aoWTqXehuUjwmyetf0dbZ80DqM65S2uGP4=; b=QFmnnxY7sFQBhQGD7/uEgroZjG wSU8eLbAsU40SNx8g7V0la7TBCd/bIgN9kixPBT8mdWG8x6jsg6jYfoWs01yT06lp3BA3jrwIJsZl TspbGEDUeaXSw687pYwK3S1NwixzsHGP/ZqOd1mRjyhe+nIYxwCwcGj/jZNJzTdIoDb4=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjiW0-0000UN-7T; Mon, 30 Nov 2020 13:42:51 +0100 X-Now-Playing: Stephen Mallinder's _Um Dada_: "It's Not Me" In-Reply-To: <687b2dd9-6626-f1a3-0c46-50410a1c9e64@alshu.de> (Anton S.'s message of "Wed, 21 Sep 2016 10:11:15 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:194635 Archived-At: "Anton S." writes: > Reproduction guide :beetle: > > Start Emacs > write folling in octave mode: for i=1:10 i, pause(1); end > send the buffer to octave with > octave-send-buffer > or mark everything and do > octave-send-region > > Observed behavior: > > Emacs is unresponsive for 10 seconds. Then a second buffer window opens > with the input lines visible but without output: (This bug report unfortunately got no response at the time.) Yes, the `C-c C-i C-a' command in octave-mode is totally synchronous (per line). I wondered whether you can just avoid splitting up the region into lines and just send them to the process, and that works fine, as far as I can see. And it fixes the test case. However, I'm not an octave-mode user. Does anybody have a comment on making a change like this? diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index c313ad1179..24e69ab992 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -1517,23 +1517,8 @@ octave-send-region (with-current-buffer inferior-octave-buffer ;; https://lists.gnu.org/r/emacs-devel/2013-10/msg00095.html (compilation-forget-errors) - (setq inferior-octave-output-list nil) - (while (not (string-equal string "")) - (if (string-match "\n" string) - (setq line (substring string 0 (match-beginning 0)) - string (substring string (match-end 0))) - (setq line string string "")) - (setq inferior-octave-receive-in-progress t) - (inferior-octave-send-list-and-digest (list (concat line "\n"))) - (while inferior-octave-receive-in-progress - (accept-process-output proc)) - (insert-before-markers - (mapconcat 'identity - (append - (if octave-send-echo-input (list line) (list "")) - inferior-octave-output-list - (list inferior-octave-output-string)) - "\n"))))) + (insert-before-markers string "\n") + (comint-send-string proc (concat string "\n")))) (if octave-send-show-buffer (display-buffer inferior-octave-buffer))) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no