GNU bug report logs - #10460
24.0.92; css-mode sexp movement

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Mon, 9 Jan 2012 01:44:01 UTC

Severity: normal

Found in version 24.0.92

Fixed in version 25.1

Done: Tom Tromey <tom <at> tromey.com>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 10460 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Tom Tromey <tom <at> tromey.com>
Cc: 10460 <at> debbugs.gnu.org, Leo <sdl.web <at> gmail.com>
Subject: Re: bug#10460: 24.0.92; css-mode sexp movement
Date: Mon, 29 Dec 2014 14:13:55 -0500
> I suppose this supplies a bit of wiggle room, if you leniently interpret
> "prefix characters".

SMIE interprets "balanced expression" as "a subnode in the AST".

It can surprise at the beginning, indeed, but in my experience, it's
a useful generalization for languages with infix syntax.

Of course, for infix languages, "a + b * c" might be a proper AST
subnode (whereas stopping after "a + b" wouldn't if there's a "* c"
afterwards), but so is "a", when using forward-sexp we have to choose at
which level of the AST we want to jump forward.  In the above case SMIE
will choose "a" over "a + b * c" (i.e. it will choose the
smallest/deepest subnode).

But when faced with "+ b * c", there is simply no proper subnode ahead.
Here, SMIE extends yet again the concept of "balanced expression" in
order to be able to do something meaningful: it jumps over the whole "+
b * c" (i.e. over the infix op plus its right argument).  This is very
handy in languages with few parentheses, letting you advance by "large"
logical units, just like you would in Lisp where every top-level
statement is wrapped inside parentheses.


        Stefan




This bug report was last modified 10 years and 145 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.