From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sprague, Webb (OFM)" Newsgroups: gmane.emacs.bugs Subject: bug#6869: Octave mode: incorrect "unbalanced block" warning Date: Tue, 17 Aug 2010 08:34:35 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1282063171 2916 80.91.229.12 (17 Aug 2010 16:39:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 17 Aug 2010 16:39:31 +0000 (UTC) Cc: 6869@debbugs.gnu.org To: "Stefan Monnier" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 17 18:39:15 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OlPBt-0002ek-2c for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Aug 2010 18:39:09 +0200 Original-Received: from localhost ([127.0.0.1]:39183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OlPBs-00073W-DX for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Aug 2010 12:39:08 -0400 Original-Received: from [140.186.70.92] (port=44710 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OlPBi-00072E-Hb for bug-gnu-emacs@gnu.org; Tue, 17 Aug 2010 12:38:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OlPBh-0005uE-4G for bug-gnu-emacs@gnu.org; Tue, 17 Aug 2010 12:38:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57304) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OlPBh-0005uA-26 for bug-gnu-emacs@gnu.org; Tue, 17 Aug 2010 12:38:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OlOwH-0006ec-Tv; Tue, 17 Aug 2010 12:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Sprague, Webb (OFM)" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Aug 2010 16:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6869 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6869-submit@debbugs.gnu.org id=B6869.128206214025558 (code B ref 6869); Tue, 17 Aug 2010 16:23:01 +0000 Original-Received: (at 6869) by debbugs.gnu.org; 17 Aug 2010 16:22:20 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OlOva-0006eA-Jd for submit@debbugs.gnu.org; Tue, 17 Aug 2010 12:22:19 -0400 Original-Received: from ofmmxalc712.ofm.wa.gov ([198.238.39.33] helo=ofmmxalc712.ofm.wa.lcl) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OlOAU-0006Im-3Z for 6869@debbugs.gnu.org; Tue, 17 Aug 2010 11:33:38 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: bug#6869: Octave mode: incorrect "unbalanced block" warning Thread-Index: Acs97DXPbEQ9FOE5QMe2Xrv87/mSJgANBxsQ X-Mailman-Approved-At: Tue, 17 Aug 2010 12:22:18 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 17 Aug 2010 12:23:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:39576 Archived-At: Hi Stefan. See below... =20 > It's a bug in octave's indentation code, indeed. It gets confused by > the "end" in the following line: >=20 > > x =3D data(:,2:end); Oh -- that makes sense. >=20 > I don't know Octave much, as it so happens but I've recently been > playing with a new indentation code for Octave (using SMIE), so I'm > interested in fixing it. Could you explain to me what is this "end" > (and more generally what the "data(:,2:end)" means: all I can guess is > that it's an array indexing of some sort). There are two uses for "end" that are pretty different: 1. Closing blocks (e.g. "if x=3D=3D1 y=3D3 end") 2. Indexing arrays. Here "end" is evaluated to give the length of a dimension in the array. For example if x=3D[2 3 4 5], then x(end) = =3D=3D 5, x(end-1) =3D=3D 4, etc. =20 Note that ":" means all elements when evaluated as an index, and "x:y" gives the vector of elements between x and y, and "3:end" means [3 4 5 ... end] where end is the max index. So, "data(:,2:end)" means all the rows of data (the first ":") and the columns from 2 to the end. Does that make sense? =09 If you really want to learn octave and don't have much experience with matlab I would suggest Attaway's book on matlab. Octave tracks it pretty closely. Thanks so much for dealing with this! I sort of have my hands full, and emacs indentation code just freaks me out ;)