From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 16 20:00:55 2010 Received: (at submit) by debbugs.gnu.org; 17 Aug 2010 00:00:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ol9br-0007Qq-6s for submit@debbugs.gnu.org; Mon, 16 Aug 2010 20:00:55 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ol9Y0-0007Od-RA for submit@debbugs.gnu.org; Mon, 16 Aug 2010 19:56:57 -0400 Received: from lists.gnu.org ([199.232.76.165]:59920) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ol9Yz-0006f8-Fc for submit@debbugs.gnu.org; Mon, 16 Aug 2010 19:57:57 -0400 Received: from [140.186.70.92] (port=42823 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ol9Yx-0003x6-Tv for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2010 19:57:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.5 required=5.0 tests=BAYES_20, RECEIVED_FROM_WINDOWS_HOST, T_RP_MATCHES_RCVD autolearn=no version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ol9Yw-0005qF-NY for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2010 19:57:55 -0400 Received: from ofmmxalc712.ofm.wa.gov ([198.238.39.33]:6597 helo=ofmmxalc712.ofm.wa.lcl) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ol9Yw-0005px-FG for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2010 19:57:54 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Octave mode: incorrect "unbalanced block" warning Date: Mon, 16 Aug 2010 16:35:49 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Octave mode: incorrect "unbalanced block" warning Thread-Index: Acs9m8HsYCQX6XNWRAChwRGUdI7oyQ== From: "Sprague, Webb (OFM)" To: X-detected-operating-system: by eggs.gnu.org: Windows XP SP1+, 2000 SP3 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.4 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 16 Aug 2010 20:00:53 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Hi there, I am getting "unbalanced block" warnings when I hit tab on the "endfunction" at the end of an m-file (function is cut-and-pasted below). It is on windows, but I don't think that is the cause of *this* bug. I have tested the function and it works fine, so I don't think it is my octave code. I also don't think it is because it is an endfunction -- I have gotten other "unbalanced block" warnings with for loops and such, they are just harder to duplicate for bug reports. Usually indentation works fine, but sometimes it goes wonky for some reason. (version) gives: "GNU Emacs 23.2.1 (i386-mingw-nt5.1.2600) of 2010-05-08 on G41R2F1" Thanks to the coders and maintainers for working on this! function res =3D tcomp (fn) %% res =3D tcomp (fn) %% imports components and rearranges them. =20 if nargin ~=3D 1 print_usage() endif data =3D dlmread(fn, 3, 0); x =3D data(:,2:end); cnty =3D repmat(x(:,1)(:), 10, 1); pop =3D x(:,1:10)(:); bir =3D x(:,11:20)(:); dth =3D x(:,21:30)(:); imig =3D x(:,31:40)(:); dmig =3D x(:,41:50)(:); gq =3D x(:,51:60)(:); =20 yrs =3D repmat(2000:2009, 39, 1)(:); res =3D [yrs, cnty, pop, bir, dth, imig, dmig, gq]; endfunction From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 17 05:11:04 2010 Received: (at 6869) by debbugs.gnu.org; 17 Aug 2010 09:11:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OlICF-0002bs-Dp for submit@debbugs.gnu.org; Tue, 17 Aug 2010 05:11:03 -0400 Received: from impaqm1.telefonica.net ([213.4.138.1]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OlICD-0002bW-Tg for 6869@debbugs.gnu.org; Tue, 17 Aug 2010 05:11:02 -0400 Received: from IMPmailhost5.adm.correo ([10.20.102.126]) by IMPaqm1.telefonica.net with bizsmtp id vMAq1e00l2jdgqJ01MBg04; Tue, 17 Aug 2010 11:11:40 +0200 Received: from ceviche.home ([88.7.8.175]) by IMPmailhost5.adm.correo with BIZ IMP id vMBe1e00b3mb5G81lMBf6F; Tue, 17 Aug 2010 11:11:39 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="monnier$movistar.es" |auth_email="monnier@movistar.es" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Received: by ceviche.home (Postfix, from userid 20848) id 89830660F0; Tue, 17 Aug 2010 11:11:38 +0200 (CEST) From: Stefan Monnier To: "Sprague\, Webb \(OFM\)" Subject: Re: bug#6869: Octave mode: incorrect "unbalanced block" warning Message-ID: References: Date: Tue, 17 Aug 2010 11:11:38 +0200 In-Reply-To: (Webb Sprague's message of "Mon, 16 Aug 2010 16:35:49 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 6869 Cc: 6869@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > I am getting "unbalanced block" warnings when I hit tab on the > "endfunction" at the end of an m-file (function is cut-and-pasted > below). It is on windows, but I don't think that is the cause of *this* > bug. I have tested the function and it works fine, so I don't think it > is my octave code. It's a bug in octave's indentation code, indeed. It gets confused by the "end" in the following line: > x = data(:,2:end); 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). The Octave manual doesn't seem to talk about it. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 17 12:22:20 2010 Received: (at 6869) by debbugs.gnu.org; 17 Aug 2010 16:22:20 +0000 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 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 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: bug#6869: Octave mode: incorrect "unbalanced block" warning Date: Tue, 17 Aug 2010 08:34:35 -0700 Message-ID: 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 References: From: "Sprague, Webb (OFM)" To: "Stefan Monnier" X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 6869 X-Mailman-Approved-At: Tue, 17 Aug 2010 12:22:18 -0400 Cc: 6869@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) 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 ;) From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 17 12:22:20 2010 Received: (at 6869) by debbugs.gnu.org; 17 Aug 2010 16:22:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OlOvc-0006eC-3I for submit@debbugs.gnu.org; Tue, 17 Aug 2010 12:22:20 -0400 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 1OlOJY-0006Mb-9D for 6869@debbugs.gnu.org; Tue, 17 Aug 2010 11:43:00 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: bug#6869: Octave mode: incorrect "unbalanced block" warning Date: Tue, 17 Aug 2010 08:44:00 -0700 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: bug#6869: Octave mode: incorrect "unbalanced block" warning Thread-Index: Acs97DXPbEQ9FOE5QMe2Xrv87/mSJgANBxsQAACfkPA= References: From: "Sprague, Webb (OFM)" To: "Stefan Monnier" X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: 6869 X-Mailman-Approved-At: Tue, 17 Aug 2010 12:22:18 -0400 Cc: 6869@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.2 (---) There is another nuance -- Matlab uses "end" for closing blocks only, while Octave allows "endxxx" where xxx signifies the opening ("endif", "endfunction" etc). Octave also allows the plain "end" for blocks. > -----Original Message----- > From: Sprague, Webb (OFM) > Sent: Tuesday, August 17, 2010 8:35 AM > To: 'Stefan Monnier' > Cc: 6869@debbugs.gnu.org > Subject: RE: bug#6869: Octave mode: incorrect "unbalanced block" > warning >=20 > 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: > > > > > x =3D data(:,2:end); >=20 > 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). >=20 > There are two uses for "end" that are pretty different: >=20 > 1. Closing blocks (e.g. "if x=3D=3D1 y=3D3 end") >=20 > 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. >=20 > Does that make sense? >=20 > 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. >=20 > Thanks so much for dealing with this! I sort of have my hands full, > and emacs indentation code just freaks me out ;) From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 18 10:15:10 2010 Received: (at 6869) by debbugs.gnu.org; 18 Aug 2010 14:15:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OljQ6-00056a-IG for submit@debbugs.gnu.org; Wed, 18 Aug 2010 10:15:10 -0400 Received: from impaqm2.telefonica.net ([213.4.138.2]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OljQ3-00055z-KV for 6869@debbugs.gnu.org; Wed, 18 Aug 2010 10:15:08 -0400 Received: from IMPmailhost6.adm.correo ([10.20.102.127]) by IMPaqm2.telefonica.net with bizsmtp id vqAs1e00A2kvMAa3MqGBGf; Wed, 18 Aug 2010 16:16:11 +0200 Received: from ceviche.home ([83.61.35.93]) by IMPmailhost6.adm.correo with BIZ IMP id vqGA1e00220aCvn1mqGAv6; Wed, 18 Aug 2010 16:16:11 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="monnier$movistar.es" |auth_email="monnier@movistar.es" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Received: by ceviche.home (Postfix, from userid 20848) id 0E818660E9; Wed, 18 Aug 2010 16:16:10 +0200 (CEST) From: Stefan Monnier To: "Sprague\, Webb \(OFM\)" Subject: Re: bug#6869: Octave mode: incorrect "unbalanced block" warning Message-ID: References: Date: Wed, 18 Aug 2010 16:16:10 +0200 In-Reply-To: (Webb Sprague's message of "Tue, 17 Aug 2010 08:34:35 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 6869 Cc: 6869@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > 2. Indexing arrays. Here "end" is evaluated to give the length of a > dimension in the array. For example if x=[2 3 4 5], then x(end) == 5, > x(end-1) == 4, etc. Thanks, I see it in the Matlab doc now. It's missing from the Octave doc, AFAICT. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 08:23:31 2010 Received: (at 6869) by debbugs.gnu.org; 31 Aug 2010 12:23:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OqPsB-000784-HV for submit@debbugs.gnu.org; Tue, 31 Aug 2010 08:23:31 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OqPs8-00077z-TP for 6869@debbugs.gnu.org; Tue, 31 Aug 2010 08:23:29 -0400 Received: from ceviche.home (vpn-132-204-232-70.acd.umontreal.ca [132.204.232.70]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o7VCP3gX017318; Tue, 31 Aug 2010 08:25:03 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 7D3D6660DF; Tue, 31 Aug 2010 14:24:58 +0200 (CEST) From: Stefan Monnier To: "Sprague\, Webb \(OFM\)" Subject: Re: bug#6869: Octave mode: incorrect "unbalanced block" warning Message-ID: References: Date: Tue, 31 Aug 2010 14:24:58 +0200 In-Reply-To: (Webb Sprague's message of "Mon, 16 Aug 2010 16:35:49 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3611=0 X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 6869 Cc: 6869@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > I am getting "unbalanced block" warnings when I hit tab on the > "endfunction" at the end of an m-file (function is cut-and-pasted > below). It is on windows, but I don't think that is the cause of *this* Can you try the latest code on the Emacs trunk? It uses a completely different code to navigate and indent Octave code. The behavior should be similar, except that things like the removal of octave-forward-block (merged into forward-sexp). Please confirm if it fixes this bug. And please report any new bugs separately. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 14:51:15 2010 Received: (at control) by debbugs.gnu.org; 20 Sep 2010 18:51:15 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OxlSM-0006ni-Rl for submit@debbugs.gnu.org; Mon, 20 Sep 2010 14:51:15 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OxlSL-0006nZ-Cm for control@debbugs.gnu.org; Mon, 20 Sep 2010 14:51:13 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1OxlUk-0000nS-EL; Mon, 20 Sep 2010 14:53:42 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19607.44470.157189.223640@fencepost.gnu.org> Date: Mon, 20 Sep 2010 14:53:42 -0400 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: blue X-Ran: Fa]3,* List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.2 (-----) close 7033 close 6869 24.1 From unknown Sat Jun 21 03:23:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 19 Oct 2010 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator