unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14399: octave-mode bug
@ 2013-05-14 17:05 Tom Olin
  2013-05-15 12:00 ` Leo Liu
  0 siblings, 1 reply; 19+ messages in thread
From: Tom Olin @ 2013-05-14 17:05 UTC (permalink / raw)
  To: Kurt.Hornik, 14399

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

The following code does not indent correctly (IMHO) with octave-mode:

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

What I get is this:

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



Emacs  : GNU Emacs 24.3.1 (x86_64-apple-darwin12.2.0, X toolkit, Xaw scroll bars)
 of 2013-03-21 on alum.local
Package: Emacs version 24.3.1

current state:
==============
(setq
 octave-blink-matching-block t
 octave-block-offset 2
 octave-comment-char 35
 octave-continuation-offset 4
 octave-continuation-string "..."
 octave-send-echo-input t
 octave-send-line-auto-forward t
 octave-send-show-buffer t
 )


--
Tom Olin
Senior Systems Engineer | PAR Government Systems Corporation
315.356.2142 | tom_olin@partech.com | http://pargovernment.com




[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5134 bytes --]

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

* bug#14399: octave-mode bug
  2013-05-14 17:05 bug#14399: octave-mode bug Tom Olin
@ 2013-05-15 12:00 ` Leo Liu
  2013-05-17 23:13   ` Leo Liu
  0 siblings, 1 reply; 19+ messages in thread
From: Leo Liu @ 2013-05-15 12:00 UTC (permalink / raw)
  To: Tom Olin; +Cc: Kurt.Hornik, 14399

I have written to octave's maintainers' list:
http://article.gmane.org/gmane.comp.gnu.octave.maintainers/32441

Leo





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

* bug#14399: octave-mode bug
  2013-05-15 12:00 ` Leo Liu
@ 2013-05-17 23:13   ` Leo Liu
  2013-11-22  2:11     ` Leo Liu
  0 siblings, 1 reply; 19+ messages in thread
From: Leo Liu @ 2013-05-17 23:13 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Tom Olin, 14399

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





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

* bug#14399: octave-mode bug
  2013-05-17 23:13   ` Leo Liu
@ 2013-11-22  2:11     ` Leo Liu
  2013-11-22 14:27       ` Stefan Monnier
  2013-12-02 15:15       ` Stefan Monnier
  0 siblings, 2 replies; 19+ messages in thread
From: Leo Liu @ 2013-11-22  2:11 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Tom Olin, 14399

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





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

* bug#14399: octave-mode bug
  2013-11-22  2:11     ` Leo Liu
@ 2013-11-22 14:27       ` Stefan Monnier
  2013-11-22 14:57         ` Rüdiger Sonderfeld
  2013-12-02 15:15       ` Stefan Monnier
  1 sibling, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2013-11-22 14:27 UTC (permalink / raw)
  To: Leo Liu; +Cc: Tom Olin, 14399

> 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





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

* bug#14399: octave-mode bug
  2013-11-22 14:27       ` Stefan Monnier
@ 2013-11-22 14:57         ` Rüdiger Sonderfeld
  2013-11-23  2:03           ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Rüdiger Sonderfeld @ 2013-11-22 14:57 UTC (permalink / raw)
  To: 14399; +Cc: tom_olin, sdl.web

On Friday 22 November 2013 09:27:57 Stefan Monnier wrote:
> > 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 ].

See (info "(octave) Continuation Lines")

Regards,
Rüdiger






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

* bug#14399: octave-mode bug
  2013-11-22 14:57         ` Rüdiger Sonderfeld
@ 2013-11-23  2:03           ` Stefan Monnier
  2013-11-28  4:40             ` Stefan Monnier
  2013-11-28  7:37             ` Achim Gratz
  0 siblings, 2 replies; 19+ messages in thread
From: Stefan Monnier @ 2013-11-23  2:03 UTC (permalink / raw)
  To: Rüdiger Sonderfeld; +Cc: tom_olin, sdl.web, 14399

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





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

* bug#14399: octave-mode bug
  2013-11-23  2:03           ` Stefan Monnier
@ 2013-11-28  4:40             ` Stefan Monnier
  2013-11-30 13:09               ` Tom Olin
  2013-11-28  7:37             ` Achim Gratz
  1 sibling, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2013-11-28  4:40 UTC (permalink / raw)
  To: Rüdiger Sonderfeld; +Cc: Tom Olin, Leo Liu, 14399

Ping?

>>>>> "Stefan" == Stefan Monnier <monnier@iro.umontreal.ca> writes:

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





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

* bug#14399: octave-mode bug
  2013-11-23  2:03           ` Stefan Monnier
  2013-11-28  4:40             ` Stefan Monnier
@ 2013-11-28  7:37             ` Achim Gratz
  2013-11-30 17:19               ` Stefan Monnier
  1 sibling, 1 reply; 19+ messages in thread
From: Achim Gratz @ 2013-11-28  7:37 UTC (permalink / raw)
  To: 14399

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






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

* bug#14399: octave-mode bug
  2013-11-28  4:40             ` Stefan Monnier
@ 2013-11-30 13:09               ` Tom Olin
  0 siblings, 0 replies; 19+ messages in thread
From: Tom Olin @ 2013-11-30 13:09 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Rüdiger Sonderfeld, Leo Liu, 14399

[-- Attachment #1: Type: text/plain, Size: 1073 bytes --]

A semicolon separates rows; a comma or space separates columns. Thus [ foo bar ] or [ foo, bar ] is a 1x2 matrix. [ foo; bar ] is a 2x1 matrix.

--
Tom Olin
Senior Systems Engineer | PAR Government Systems Corporation
315.356.2142 | tom_olin@partech.com | http://pargovernment.com



On Nov 27, 2013, at 11:40 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> Ping?
> 
>>>>>> "Stefan" == Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
>>>>> 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


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5134 bytes --]

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

* bug#14399: octave-mode bug
  2013-11-28  7:37             ` Achim Gratz
@ 2013-11-30 17:19               ` Stefan Monnier
  2013-12-02 14:51                 ` Rüdiger Sonderfeld
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2013-11-30 17:19 UTC (permalink / raw)
  To: Achim Gratz; +Cc: 14399

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





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

* bug#14399: octave-mode bug
  2013-11-30 17:19               ` Stefan Monnier
@ 2013-12-02 14:51                 ` Rüdiger Sonderfeld
  0 siblings, 0 replies; 19+ messages in thread
From: Rüdiger Sonderfeld @ 2013-12-02 14:51 UTC (permalink / raw)
  To: 14399; +Cc: Stromeko

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






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

* bug#14399: octave-mode bug
  2013-11-22  2:11     ` Leo Liu
  2013-11-22 14:27       ` Stefan Monnier
@ 2013-12-02 15:15       ` Stefan Monnier
  2013-12-02 15:58         ` Leo Liu
  1 sibling, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2013-12-02 15:15 UTC (permalink / raw)
  To: Leo Liu; +Cc: Tom Olin, 14399

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





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

* bug#14399: octave-mode bug
  2013-12-02 15:15       ` Stefan Monnier
@ 2013-12-02 15:58         ` Leo Liu
  2013-12-02 16:08           ` Stefan Monnier
  2013-12-03 14:56           ` Tom Olin
  0 siblings, 2 replies; 19+ messages in thread
From: Leo Liu @ 2013-12-02 15:58 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Tom Olin, 14399

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





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

* bug#14399: octave-mode bug
  2013-12-02 15:58         ` Leo Liu
@ 2013-12-02 16:08           ` Stefan Monnier
  2013-12-03 14:56           ` Tom Olin
  1 sibling, 0 replies; 19+ messages in thread
From: Stefan Monnier @ 2013-12-02 16:08 UTC (permalink / raw)
  To: Leo Liu; +Cc: Tom Olin, 14399

> 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





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

* bug#14399: octave-mode bug
  2013-12-02 15:58         ` Leo Liu
  2013-12-02 16:08           ` Stefan Monnier
@ 2013-12-03 14:56           ` Tom Olin
  2013-12-03 18:32             ` Rüdiger Sonderfeld
  1 sibling, 1 reply; 19+ messages in thread
From: Tom Olin @ 2013-12-03 14:56 UTC (permalink / raw)
  To: Leo Liu; +Cc: 14399

[-- Attachment #1: Type: text/plain, Size: 987 bytes --]

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?

--
Tom Olin
Senior Systems Engineer | PAR Government Systems Corporation
315.356.2142 | tom_olin@partech.com | http://pargovernment.com



On Dec 2, 2013, at 10:58 AM, Leo Liu <sdl.web@gmail.com> wrote:

> 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


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5134 bytes --]

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

* bug#14399: octave-mode bug
  2013-12-03 14:56           ` Tom Olin
@ 2013-12-03 18:32             ` Rüdiger Sonderfeld
  2013-12-03 18:45               ` Tom Olin
  2013-12-03 21:00               ` Tom Olin
  0 siblings, 2 replies; 19+ messages in thread
From: Rüdiger Sonderfeld @ 2013-12-03 18:32 UTC (permalink / raw)
  To: 14399; +Cc: tom_olin, sdl.web

[-- Attachment #1: Type: text/plain, Size: 585 bytes --]

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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 230 bytes --]

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

* bug#14399: octave-mode bug
  2013-12-03 18:32             ` Rüdiger Sonderfeld
@ 2013-12-03 18:45               ` Tom Olin
  2013-12-03 21:00               ` Tom Olin
  1 sibling, 0 replies; 19+ messages in thread
From: Tom Olin @ 2013-12-03 18:45 UTC (permalink / raw)
  To: Rüdiger Sonderfeld; +Cc: sdl.web, 14399

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

I will give that a try. Thanks.

--
Tom Olin
Senior Systems Engineer | PAR Government Systems Corporation
315.356.2142 | tom_olin@partech.com | http://pargovernment.com



On Dec 3, 2013, at 1:32 PM, Rüdiger Sonderfeld <ruediger@c-plusplus.de> wrote:

> 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


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5134 bytes --]

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

* bug#14399: octave-mode bug
  2013-12-03 18:32             ` Rüdiger Sonderfeld
  2013-12-03 18:45               ` Tom Olin
@ 2013-12-03 21:00               ` Tom Olin
  1 sibling, 0 replies; 19+ messages in thread
From: Tom Olin @ 2013-12-03 21:00 UTC (permalink / raw)
  To: Rüdiger Sonderfeld; +Cc: sdl.web, 14399

[-- Attachment #1: Type: text/plain, Size: 923 bytes --]

I've confirmed that the latest version of octave.el works correctly. Thanks!

--
Tom Olin
Senior Systems Engineer | PAR Government Systems Corporation
315.356.2142 | tom_olin@partech.com | http://pargovernment.com



On Dec 3, 2013, at 1:32 PM, Rüdiger Sonderfeld <ruediger@c-plusplus.de> wrote:

> 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


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5134 bytes --]

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

end of thread, other threads:[~2013-12-03 21:00 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-14 17:05 bug#14399: octave-mode bug Tom Olin
2013-05-15 12:00 ` Leo Liu
2013-05-17 23:13   ` Leo Liu
2013-11-22  2:11     ` Leo Liu
2013-11-22 14:27       ` Stefan Monnier
2013-11-22 14:57         ` Rüdiger Sonderfeld
2013-11-23  2:03           ` Stefan Monnier
2013-11-28  4:40             ` Stefan Monnier
2013-11-30 13:09               ` Tom Olin
2013-11-28  7:37             ` Achim Gratz
2013-11-30 17:19               ` Stefan Monnier
2013-12-02 14:51                 ` Rüdiger Sonderfeld
2013-12-02 15:15       ` Stefan Monnier
2013-12-02 15:58         ` Leo Liu
2013-12-02 16:08           ` Stefan Monnier
2013-12-03 14:56           ` Tom Olin
2013-12-03 18:32             ` Rüdiger Sonderfeld
2013-12-03 18:45               ` Tom Olin
2013-12-03 21:00               ` Tom Olin

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