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
Francesco Potortì wrote:
> 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
There is no file "octave-inf.el" in Emacs for some time,
and "inferior-octave-startup" has contained code to call "--no-gui" for
the past two years, so please review the situation in current Emacs
master and send a revised patch, if one is still needed. Thanks.
>> 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
>
>There is no file "octave-inf.el" in Emacs for some time,
>and "inferior-octave-startup" has contained code to call "--no-gui" for
>the past two years, so please review the situation in current Emacs
>master and send a revised patch, if one is still needed. Thanks.
Sorry, I live behind the times :)
With the newest version, it's easier: just remove the --no-line-editing
option from the initialization of inferior-octave-startup-args:
--- octave.el.old 2015-07-31 11:19:50.203406678 +0200
+++ octave.el.new 2015-07-31 11:19:55.647504953 +0200
@@ -641,7 +641,7 @@
:group 'octave
:version "24.4")
-(defcustom inferior-octave-startup-args '("-i" "--no-line-editing")
+(defcustom inferior-octave-startup-args '("-i")
"List of command line arguments for the inferior Octave process.
For example, for suppressing the startup message and using `traditional'
mode, include \"-q\" and \"--traditional\"."
Reason for changelog entry:
--no-line-editing serves no apparent purpose (any more?) and prevents an
inferior Octave process from using readline features, like getting the
terminal width and other functions used for the FLTK graphical backend.
Thanks
Francesco Potortì wrote:
> --no-line-editing serves no apparent purpose (any more?) and prevents an
> inferior Octave process from using readline features, like getting the
> terminal width and other functions used for the FLTK graphical backend.
vc-annotate is your friend, and shows that this was added in:
commit 48495f0fd6afc6aa45f87116552629df39268336
Author: Stephen Eglen <stephen@gnu.org>
Date: Mon Sep 6 19:20:29 1999 +0000
add --no-line-editing to inferior-octave-startup-args so that TABs
in source files are not interpreted as completion requests.
I don't use Octave myself, so I have no idea if this is still relevant.
If you know it isn't, I suggest you feel free to commit this.
Please bump the defcustom's :version tag (to 25.1) if you do,
and then close this bug. Thanks!
Francesco Potortì: >> --no-line-editing serves no apparent purpose (any more?) and prevents an >> inferior Octave process from using readline features, like getting the >> terminal width and other functions used for the FLTK graphical backend. Glen Morris: >vc-annotate is your friend, and shows that this was added in: > >commit 48495f0fd6afc6aa45f87116552629df39268336 >Author: Stephen Eglen <stephen@gnu.org> >Date: Mon Sep 6 19:20:29 1999 +0000 > > add --no-line-editing to inferior-octave-startup-args so that TABs > in source files are not interpreted as completion requests. Hm. Thanks, Glenn. I see now that I had not checked that corner case. I'll bring this up with Octave developers and look for a solution.
Francesco Potortì <pot@gnu.org> writes: > -(defcustom inferior-octave-startup-args '("-i" "--no-line-editing") > +(defcustom inferior-octave-startup-args '("-i") [...] Francesco Potortì <pot@gnu.org> writes: > As a conclusion of my observations above: > > A. if --no-line-editing was introduce because of the Emacs inferior > Octave mode > > B. if it is reasonable to assume that --no-line-editing is not used by > any other application > > C. if there is a way to leave readline enabled, but disable tab expansion > > then one can change the --no-line-editing behaviour to just disable tab > expansion. > > Or, if only C is certainly true, one can deprecate and undocument > --no-line-editing and add a separate option --disable-tab-expansion for > use in Emacs inferior Octave mode. I'm going through old bug reports, and after skimming this one, I'm not quite sure what the conclusions are. Should the --no-line-editing value be removed from the options? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no
>
>Francesco Potortì <pot@gnu.org> writes:
>
>> -(defcustom inferior-octave-startup-args '("-i" "--no-line-editing")
>> +(defcustom inferior-octave-startup-args '("-i")
>
>[...]
>
>Francesco Potortì <pot@gnu.org> writes:
>
>> As a conclusion of my observations above:
>>
>> A. if --no-line-editing was introduce because of the Emacs inferior
>> Octave mode
>>
>> B. if it is reasonable to assume that --no-line-editing is not used by
>> any other application
>>
>> C. if there is a way to leave readline enabled, but disable tab expansion
>>
>> then one can change the --no-line-editing behaviour to just disable tab
>> expansion.
>>
>> Or, if only C is certainly true, one can deprecate and undocument
>> --no-line-editing and add a separate option --disable-tab-expansion for
>> use in Emacs inferior Octave mode.
>
>I'm going through old bug reports, and after skimming this one, I'm not
>quite sure what the conclusions are. Should the --no-line-editing value
>be removed from the options?
No. Not unless Octave adds a --disable--tab--expansion as I suggest in
the second route that I described.
The current options provide minimal damage with current Octave's
behaviour. To do better, Octave should follow one of the two routes I
illustrated above.
Francesco Potortì <pot@gnu.org> writes: > No. Not unless Octave adds a --disable--tab--expansion as I suggest in > the second route that I described. > > The current options provide minimal damage with current Octave's > behaviour. To do better, Octave should follow one of the two routes I > illustrated above. Is there anything more to be done here on the Emacs side of things, then? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no