Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug#14399: octave-mode bug

3 views
Skip to first unread message

Leo Liu

unread,
May 15, 2013, 8:00:51 AM5/15/13
to Tom Olin, Kurt....@wu-wien.ac.at, 14...@debbugs.gnu.org
I have written to octave's maintainers' list:
http://article.gmane.org/gmane.comp.gnu.octave.maintainers/32441

Leo



Leo Liu

unread,
May 17, 2013, 7:13:10 PM5/17/13
to Stefan Monnier, Tom Olin, 14...@debbugs.gnu.org
Hi Stefan,

On 2013-05-15 20:00 +0800, Leo Liu wrote:
> http://article.gmane.org/gmane.comp.gnu.octave.maintainers/32441

It seems the octave community's consensus is: ... should not introduce
extra indentation in (), [] or {}. Could you help fix this bug?

Leo



Leo Liu

unread,
Nov 21, 2013, 9:11:06 PM11/21/13
to Stefan Monnier, Tom Olin, 14...@debbugs.gnu.org
On 2013-05-18 07:13 +0800, Leo Liu wrote:
> It seems the octave community's consensus is: ... should not introduce
> extra indentation in (), [] or {}. Could you help fix this bug?

Hi Stefan,

I am unfamiliar with smie. I have been meaning to understand it but
haven't found time to. Could you help fix this indentation bug?

Leo



Stefan Monnier

unread,
Nov 22, 2013, 9:27:57 AM11/22/13
to Leo Liu, Tom Olin, 14...@debbugs.gnu.org
> I am unfamiliar with smie. I have been meaning to understand it but
> haven't found time to. Could you help fix this indentation bug?

I can't remember much of the syntax of Octave. What does ";..." mean?


Stefan



Rüdiger Sonderfeld

unread,
Nov 22, 2013, 9:57:59 AM11/22/13
to 14...@debbugs.gnu.org, tom_...@partech.com, sdl...@gmail.com
... introduces a continuation line. Similar to \ in other languages.

a = [ foo;...
bar ]

is the same as a = [ foo; bar ].

See (info "(octave) Continuation Lines")

Regards,
Rüdiger




Rüdiger Sonderfeld

unread,
Nov 22, 2013, 9:57:59 AM11/22/13
to 14...@debbugs.gnu.org, tom_...@partech.com, sdl...@gmail.com

Stefan Monnier

unread,
Nov 22, 2013, 9:03:18 PM11/22/13
to Rüdiger Sonderfeld, tom_...@partech.com, sdl...@gmail.com, 14...@debbugs.gnu.org
>> > I am unfamiliar with smie. I have been meaning to understand it but
>> > haven't found time to. Could you help fix this indentation bug?
>> I can't remember much of the syntax of Octave. What does ";..." mean?
> ... introduces a continuation line. Similar to \ in other languages.

> a = [ foo;...
> bar ]

> is the same as a = [ foo; bar ].

That's the part I knew already ;-)

But in which way is

a = [ foo;...
bar ]

different from

a = [ foo
bar ]
or
a = [ foo;
bar ]

-- Stefan



Stefan Monnier

unread,
Nov 22, 2013, 9:03:18 PM11/22/13
to Rüdiger Sonderfeld, tom_...@partech.com, sdl...@gmail.com, 14...@debbugs.gnu.org

Stefan Monnier

unread,
Nov 27, 2013, 11:40:48 PM11/27/13
to Rüdiger Sonderfeld, Tom Olin, Leo Liu, 14...@debbugs.gnu.org
Ping?

Achim Gratz

unread,
Nov 28, 2013, 2:37:21 AM11/28/13
to 14...@debbugs.gnu.org
Stefan Monnier writes:
> That's the part I knew already ;-)
>
> But in which way is
>
> a = [ foo;...
> bar ]
>
> different from
>
> a = [ foo
> bar ]
> or
> a = [ foo;
> bar ]

For these three examples there is no difference because the newlines and
whitespace the continuation marker gobbles up wouldn't terminate or
alter the statement. On the other hand

a = [ foo ...
bar ]

_is_ different (introducing another column rather than a row).


Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




Stefan Monnier

unread,
Nov 30, 2013, 12:19:30 PM11/30/13
to Achim Gratz, 14...@debbugs.gnu.org
>> That's the part I knew already ;-)
>>
>> But in which way is
>>
>> a = [ foo;...
>> bar ]
>>
>> different from
>>
>> a = [ foo
>> bar ]
>> or
>> a = [ foo;
>> bar ]

> For these three examples there is no difference because the newlines and
> whitespace the continuation marker gobbles up wouldn't terminate or
> alter the statement.

Thanks. So it begs the question: why would someone write

a = [ foo;...
bar ]

instead of one of the other two? I'm trying to understand what's the
intention behind it, to better understand how the code should behave.


Stefan



Rüdiger Sonderfeld

unread,
Dec 2, 2013, 9:51:28 AM12/2/13
to 14...@debbugs.gnu.org, Stro...@nexgo.de
On Saturday 30 November 2013 12:19:30 Stefan Monnier wrote:
> Thanks. So it begs the question: why would someone write
>
> a = [ foo;...
> bar ]
>
> instead of one of the other two? I'm trying to understand what's the
> intention behind it, to better understand how the code should behave.

I think it's just a matter of style. I thought it had something to do with
Matlab compatibility but a quick test showed that Matlab accepts both forms as
well.

Regards,
Rüdiger




Rüdiger Sonderfeld

unread,
Dec 2, 2013, 9:51:28 AM12/2/13
to 14...@debbugs.gnu.org, Stro...@nexgo.de

Stefan Monnier

unread,
Dec 2, 2013, 10:15:59 AM12/2/13
to Leo Liu, Tom Olin, 14...@debbugs.gnu.org
>> It seems the octave community's consensus is: ... should not introduce
>> extra indentation in (), [] or {}. Could you help fix this bug?
> I am unfamiliar with smie. I have been meaning to understand it but
> haven't found time to. Could you help fix this indentation bug?

Looks like we've all been pretty dumb: not sure about the OP's real code
but at least his test case gets indented like this with Emacs's trunk:

vec = [...
one;...
two;...
three];

So it looks like the bug is already fixed.


Stefan



Leo Liu

unread,
Dec 2, 2013, 10:58:18 AM12/2/13
to Stefan Monnier, Tom Olin, 14...@debbugs.gnu.org
On 2013-12-02 23:15 +0800, Stefan Monnier wrote:
> Looks like we've all been pretty dumb: not sure about the OP's real code
> but at least his test case gets indented like this with Emacs's trunk:
>
> vec = [...
> one;...
> two;...
> three];
>
> So it looks like the bug is already fixed.

I was able to reproduce the bug some time ago but indeed this seems
fixed in trunk. but

x = ...
12

doesn't indent the second line correctly.

Leo



Stefan Monnier

unread,
Dec 2, 2013, 11:08:06 AM12/2/13
to Leo Liu, Tom Olin, 14...@debbugs.gnu.org
> x = ...
> 12

> doesn't indent the second line correctly.

That's simply for lack of a corresponding rule in octave-smie-rules.
Try M-x smie-edebug RET


Stefan



Rüdiger Sonderfeld

unread,
Dec 3, 2013, 1:32:50 PM12/3/13
to 14...@debbugs.gnu.org, tom_...@partech.com, sdl...@gmail.com
On Tuesday 03 December 2013 09:56:39 Tom Olin wrote:
> Just FWIW, I'm still seeing the problem. I get:
>
> vec = [...
> one;...
> two;...
> three];
>
> I'm using:
>
> GNU Emacs 24.3.1 (x86_64-apple-darwin12.2.0, X toolkit, Xaw scroll bars) of
> 2013-03-21
>
> from MacPorts. How far from HEAD is that?

Very far. Thanks to Leo Octave mode was improved quite significantly since
the release of 24.3. It should be backward compatible to 24.3. If you want
to try it you could copy octave.el from bzr and load it in your Emacs.

Regards,
Rüdiger
signature.asc

Rüdiger Sonderfeld

unread,
Dec 3, 2013, 1:32:50 PM12/3/13
to 14...@debbugs.gnu.org, tom_...@partech.com, sdl...@gmail.com
signature.asc
0 new messages