unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* 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; 8+ 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] 8+ messages in thread

* bug#21162: adapting octave-inf.el to Octave 4
  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ì
  0 siblings, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2015-07-31  6:47 UTC (permalink / raw)
  To: Francesco Potortì; +Cc: Kurt.Hornik, 21162, John W. Eaton, Mike Miller

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.





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

* bug#21162: adapting octave-inf.el to Octave 4
  2015-07-31  6:47 ` Glenn Morris
@ 2015-07-31  9:26   ` Francesco Potortì
  2015-07-31 15:39     ` Glenn Morris
  2021-05-26 22:58     ` bug#21150: 24.5; octave-inf mode does not need --no-line-editing Lars Ingebrigtsen
  0 siblings, 2 replies; 8+ messages in thread
From: Francesco Potortì @ 2015-07-31  9:26 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Kurt.Hornik, 21162, 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
>
>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





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

* bug#21162: adapting octave-inf.el to Octave 4
  2015-07-31  9:26   ` Francesco Potortì
@ 2015-07-31 15:39     ` Glenn Morris
  2015-08-06 13:15       ` Francesco Potortì
  2021-05-26 22:58     ` bug#21150: 24.5; octave-inf mode does not need --no-line-editing Lars Ingebrigtsen
  1 sibling, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2015-07-31 15:39 UTC (permalink / raw)
  To: Francesco Potortì
  Cc: stephen, Kurt.Hornik, 21162, John W. Eaton, Mike Miller

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!





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

* bug#21162: adapting octave-inf.el to Octave 4
  2015-07-31 15:39     ` Glenn Morris
@ 2015-08-06 13:15       ` Francesco Potortì
  0 siblings, 0 replies; 8+ messages in thread
From: Francesco Potortì @ 2015-08-06 13:15 UTC (permalink / raw)
  To: Glenn Morris; +Cc: stephen, Kurt.Hornik, 21162, John W. Eaton, Mike Miller

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.





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

* bug#21150: 24.5; octave-inf mode does not need --no-line-editing
  2015-07-31  9:26   ` Francesco Potortì
  2015-07-31 15:39     ` Glenn Morris
@ 2021-05-26 22:58     ` Lars Ingebrigtsen
  2021-06-08 13:09       ` bug#21162: " Francesco Potortì
  1 sibling, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-26 22:58 UTC (permalink / raw)
  To: Francesco Potortì
  Cc: Glenn Morris, 21162, John W. Eaton, 21150, Kurt.Hornik,
	Mike Miller

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





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

* bug#21162: bug#21150: 24.5; octave-inf mode does not need --no-line-editing
  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       ` Francesco Potortì
  2021-06-09  9:35         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Francesco Potortì @ 2021-06-08 13:09 UTC (permalink / raw)
  To: Lars Ingebrigtsen
  Cc: Glenn Morris, 21162, John W. Eaton, 21150, Kurt.Hornik,
	Mike Miller

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





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

* bug#21150: 24.5; octave-inf mode does not need --no-line-editing
  2021-06-08 13:09       ` bug#21162: " Francesco Potortì
@ 2021-06-09  9:35         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-06-09  9:35 UTC (permalink / raw)
  To: Francesco Potortì
  Cc: Glenn Morris, 21162, John W. Eaton, 21150, Kurt.Hornik,
	Mike Miller

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





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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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ì
2015-07-31 15:39     ` Glenn Morris
2015-08-06 13:15       ` 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).