unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21150: 24.5; octave-inf mode does not need --no-line-editing
@ 2015-07-28 13:40 Francesco Potortì
  0 siblings, 0 replies; 3+ messages in thread
From: Francesco Potortì @ 2015-07-28 13:40 UTC (permalink / raw)
  To: 21150; +Cc: Kurt Hornik, John W. Eaton, Mike Miller

In Octave inferior mode, defined in octave-inf.el, the Octave process is
called with the --no-line-editing option.  This option should be
deleted, because apparently it is useless and it causes problems.

The problem is that Octave disables everything related to readline with
that option, which has the side effects of making Octave incapable of
getting the terminal line width and of using the Ftlk graphics engine.

These problems could in principle be corrected inside Octave, but in
fact the --no-line-editing option seems to be not necessary (no more?),
as I have experienced in several weeks of using Octave under Emacs with
a modified octave-inf.el.  Note that it is unlikely that other users
have had a different experience, as I am one of the few users which are
both proficient in Emacs and Octave and uses routinely Octave in an
Emacs buffer.

As you can read in the following email, all the other potentially
involved developers have nothing to add to this description of facts.

In short, please remove the "--no-line-editing" option from the list of
options in octave-inf.el.

-- 
Francesco Potortì (ricercatore)        Voice:  +39.050.621.3058
ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa         Skype:  wnlabisti
(entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it


------- Start of forwarded message -------
Date: Thu, 02 Jul 2015 19:33:16 +0200
From: Kurt Hornik <Kurt.Hornik@wu.ac.at>
Subject: Fwd: Re: changing terminal size
In-reply-to: <E1Z9xck-0002o2-Br@tucano.isti.cnr.it>
To: Francesco Potortì <Potorti@isti.cnr.it>
Cc: Kurt Hornik <Kurt.Hornik@wu-wien.ac.at>, Mike Miller <mtmiller@octave.org>,
 "John W. Eaton" <jwe@degreesofgray.org>
Reply-to: Kurt.Hornik@wu.ac.at

>>>>> Francesco Potortì writes:

> Kurt,
> I am writing to you about the --no-line-editing option that is used when
> calling octave in inferior octave mode under Emacs.  That option causes
> at least to nasty side effects.  As you can read in the Debian bug
> report linked at the end of the following email, it disables Octave's
> modern graphics engine.  Moreover, it forces Octave into 80-column mode,
> sa discussed in the following email.

> Both these problems could be in prnciple be corrected in Octave,
> especially the second one.  But I just tried to remove --no-line-editing
> from the list of options in octave-inf.el and everything seems to work
> well.

> So, why is --no-line-editing there at all?  Can it be simply deleted
> from the code of octave-inf.el?

Francesco,

Sorry ... I really don't know any more.  It must be more than 20 years
ago that I wrote the code ...

Best
- -k



> -- 
> Francesco Potortì (ricercatore)        Voice:  +39.050.621.3058
> ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
> via G. Moruzzi 1, I-56124 Pisa         Skype:  wnlabisti
> (entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it



> ------- Start of forwarded message -------
> Date: Mon, 29 Jun 2015 14:23:27 -0400
> From: Mike Miller <mtmiller@octave.org>
> Subject: Re: changing terminal size
> In-reply-to: <E1Z8BZ2-0002a8-Eu@tucano.isti.cnr.it>
> To: Francesco Potortì <Potorti@isti.cnr.it>
> Cc: Octave users list <help@octave.org>, "John W. Eaton" <jwe@degreesofgray.org>

> On Thu, Jun 25, 2015 at 20:07:52 +0200, Francesco Potortì wrote:
>> Probably the clean solution would be to not using readline for getting
>> terminal width and height, if possible.

> We could add a fallback to get the terminal size directly if readline
> is disabled, but IMHO we should also definitely add support for
> overriding the terminal size with COLUMNS and LINES regardless.

>> However, there is fundamental question: why ever is --no-line-editing
>> needed at all?  I just tried modifying octave-inf.el to call Octave
>> without it, and apparently all is well, the columns behave as they
>> should and all the resta s well...

> I don't know, that's a question for the Emacs devs who work on the
> Octave mode. You might have better luck asking on an emacs list. I
> suspect it's because Emacs wants to be in charge of line editing,
> history, completion, etc, and maybe there is some interference or
> other reason to want to disable readline in the target program.

> We talked about all of this a while ago on Debian #675509 [1] where
> you proposed that Octave mode should not be based on comint mode. I
> have no opinion or insight into what any of that means, but it is
> still based on comint mode today and does still set the
> - --no-line-editing option. IMHO taking this up with the maintainers of
> the Octave mode script is the best way forward.

> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=675509

> - -- 
> mike
> ------- End of forwarded message -------
------- End of forwarded message -------






^ permalink raw reply	[flat|nested] 3+ messages in thread
* bug#21162: adapting octave-inf.el to Octave 4
@ 2015-07-30 17:22 Francesco Potortì
  2015-07-31  6:47 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Francesco Potortì @ 2015-07-30 17:22 UTC (permalink / raw)
  To: 21162, Kurt.Hornik; +Cc: John W. Eaton, Mike Miller

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-09  9:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-28 13:40 bug#21150: 24.5; octave-inf mode does not need --no-line-editing Francesco Potortì
  -- strict thread matches above, loose matches on Subject: below --
2015-07-30 17:22 bug#21162: adapting octave-inf.el to Octave 4 Francesco Potortì
2015-07-31  6:47 ` Glenn Morris
2015-07-31  9:26   ` Francesco Potortì
2021-05-26 22:58     ` bug#21150: 24.5; octave-inf mode does not need --no-line-editing Lars Ingebrigtsen
2021-06-08 13:09       ` bug#21162: " Francesco Potortì
2021-06-09  9:35         ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).