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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ messages in thread

* bug#21150: 24.5; octave-inf mode does not need --no-line-editing
@ 2015-07-28 13:40 Francesco Potortì
  0 siblings, 0 replies; 9+ 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] 9+ messages in thread

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

Thread overview: 9+ 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
  -- strict thread matches above, loose matches on Subject: below --
2015-07-28 13:40 Francesco Potortì

unofficial mirror of bug-gnu-emacs@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-bugs/0 emacs-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-bugs emacs-bugs/ https://yhetil.org/emacs-bugs \
		bug-gnu-emacs@gnu.org
	public-inbox-index emacs-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.bugs
	nntp://news.gmane.io/gmane.emacs.bugs


code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git