From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francesco =?UTF-8?Q?Potort=C3=AC?= Newsgroups: gmane.emacs.bugs Subject: bug#21162: adapting octave-inf.el to Octave 4 Date: Thu, 30 Jul 2015 19:22:45 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1438277012 19628 80.91.229.3 (30 Jul 2015 17:23:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Jul 2015 17:23:32 +0000 (UTC) Cc: "John W. Eaton" , Mike Miller To: 21162@debbugs.gnu.org, Kurt.Hornik@wu-wien.ac.at Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 30 19:23:17 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZKrY3-0003jH-1E for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Jul 2015 19:23:15 +0200 Original-Received: from localhost ([::1]:41225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKrY2-0003Jr-6K for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Jul 2015 13:23:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKrXx-0003JO-RQ for bug-gnu-emacs@gnu.org; Thu, 30 Jul 2015 13:23:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKrXs-0007ZX-Pk for bug-gnu-emacs@gnu.org; Thu, 30 Jul 2015 13:23:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKrXs-0007ZG-MX for bug-gnu-emacs@gnu.org; Thu, 30 Jul 2015 13:23:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZKrXr-0006Lc-GH for bug-gnu-emacs@gnu.org; Thu, 30 Jul 2015 13:23:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Francesco =?UTF-8?Q?Potort=C3=AC?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Jul 2015 17:23:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21162 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org, Kurt Hornik Original-Received: via spool by submit@debbugs.gnu.org id=B.143827698124383 (code B ref -1); Thu, 30 Jul 2015 17:23:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Jul 2015 17:23:01 +0000 Original-Received: from localhost ([127.0.0.1]:35015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZKrXo-0006LC-7j for submit@debbugs.gnu.org; Thu, 30 Jul 2015 13:23:00 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59017) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZKrXm-0006L5-8M for submit@debbugs.gnu.org; Thu, 30 Jul 2015 13:22:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKrXl-0007Wh-7U for submit@debbugs.gnu.org; Thu, 30 Jul 2015 13:22:57 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:59819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKrXl-0007Wd-4r for submit@debbugs.gnu.org; Thu, 30 Jul 2015 13:22:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKrXh-0003DH-8N for bug-gnu-emacs@gnu.org; Thu, 30 Jul 2015 13:22:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKrXc-0007Se-N1 for bug-gnu-emacs@gnu.org; Thu, 30 Jul 2015 13:22:53 -0400 Original-Received: from blade3.isti.cnr.it ([194.119.192.19]:4134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKrXc-0007S4-GH for bug-gnu-emacs@gnu.org; Thu, 30 Jul 2015 13:22:48 -0400 Original-Received: from tucano.isti.cnr.it ([146.48.81.102]) by mx.isti.cnr.it (PMDF V6.5-x6 #32097) with ESMTPSA id <01POYPDI5P6O9VUM1J@mx.isti.cnr.it> for bug-gnu-emacs@gnu.org; Thu, 30 Jul 2015 19:22:45 +0200 (MEST) Original-Received: from pot by tucano.isti.cnr.it with local (Exim 4.86_RC5) (envelope-from ) id 1ZKrXZ-0007Io-DV; Thu, 30 Jul 2015 19:22:45 +0200 X-INSM-ip-source: 146.48.81.102 Auth Done X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:105230 Archived-At: The following patch does two things: 1) it removes the --no-line-editing option when calling the Octave process, for reasons that I explained in my previous bug report about octave-inf.el 2) it adds the --no-gui option when calling Octave if its version is different from 3: this is needed because the last (and future, probably) Octave versions launch a GUI by default --- /dev/fd/63 2015-07-30 19:21:16.227231663 +0200 +++ octave-inf.el 2015-07-30 19:13:13.678557317 +0200 @@ -193,12 +193,16 @@ (defun inferior-octave-startup () "Start an inferior Octave process." - (let ((proc (comint-exec-1 - (substring inferior-octave-buffer 1 -1) - inferior-octave-buffer - inferior-octave-program - (append (list "-i" "--no-line-editing") - inferior-octave-startup-args)))) + (let* ((octave-version-string (shell-command-to-string + (concat inferior-octave-program " --version"))) + (octave-gui (not (string-match "version 3" octave-version-string))) + (proc (comint-exec-1 + (substring inferior-octave-buffer 1 -1) + inferior-octave-buffer + inferior-octave-program + (append (list "-i") + (when octave-gui (list "--no-gui")) + inferior-octave-startup-args)))) (set-process-filter proc 'inferior-octave-output-digest) (setq comint-ptyp process-connection-type inferior-octave-process proc