From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.bugs Subject: bug#10460: 24.0.92; css-mode sexp movement Date: Mon, 29 Dec 2014 12:20:57 -0700 Message-ID: <87387yuusm.fsf@tromey.com> References: <87iogv9kmv.fsf@tromey.com> <877fxav2ft.fsf@tromey.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1419880938 10056 80.91.229.3 (29 Dec 2014 19:22:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Dec 2014 19:22:18 +0000 (UTC) Cc: Tom Tromey , 10460@debbugs.gnu.org, Leo To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 29 20:22:10 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y5ftJ-0002dv-VU for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Dec 2014 20:22:10 +0100 Original-Received: from localhost ([::1]:34556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5ftJ-0003D5-Cz for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Dec 2014 14:22:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5ftF-0003Cx-Mg for bug-gnu-emacs@gnu.org; Mon, 29 Dec 2014 14:22:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y5ftC-0000tp-7n for bug-gnu-emacs@gnu.org; Mon, 29 Dec 2014 14:22:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5ftC-0000tl-0F for bug-gnu-emacs@gnu.org; Mon, 29 Dec 2014 14:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y5ftB-0008PF-RF for bug-gnu-emacs@gnu.org; Mon, 29 Dec 2014 14:22:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tom Tromey Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Dec 2014 19:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10460 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10460-submit@debbugs.gnu.org id=B10460.141988087632248 (code B ref 10460); Mon, 29 Dec 2014 19:22:01 +0000 Original-Received: (at 10460) by debbugs.gnu.org; 29 Dec 2014 19:21:16 +0000 Original-Received: from localhost ([127.0.0.1]:60536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5fsS-0008O4-3T for submit@debbugs.gnu.org; Mon, 29 Dec 2014 14:21:16 -0500 Original-Received: from gproxy10-pub.mail.unifiedlayer.com ([69.89.20.226]:51906) by debbugs.gnu.org with smtp (Exim 4.80) (envelope-from ) id 1Y5fsP-0008Nu-6B for 10460@debbugs.gnu.org; Mon, 29 Dec 2014 14:21:14 -0500 Original-Received: (qmail 9185 invoked by uid 0); 29 Dec 2014 19:21:08 -0000 Original-Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy10.mail.unifiedlayer.com with SMTP; 29 Dec 2014 19:21:08 -0000 Original-Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id ZXM11p00G2f2jeq01XM4YV; Mon, 29 Dec 2014 12:21:08 -0700 X-Authority-Analysis: v=2.1 cv=eOCA0hZ1 c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=udL4O0NGDEAA:10 a=zstS-IiYAAAA:8 a=PnD2wP_eR3oA:10 a=-Ceb2LbMfV4A:10 a=A92cGCtB03wA:10 a=l88yNJYZOeTQYM14NPIA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=Ndg3sSPax43PBOkyJxhUWmAn/IulQB6ezFBWvI4724Y=; b=NJdket84pIcPsgk3eSNdOhqYbiWzAehc9khOgLB+AMfYKzqCHGEW/zWVySmWcWEs4yWlBa3jVlwJ9KMBHyngRzLIY9MBwRd/V82H6KYBmWJIcXFiQ9F4UjqAWAqUTe/d; Original-Received: from [71.33.142.103] (port=41505 helo=pokyo) by box522.bluehost.com with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.82) (envelope-from ) id 1Y5fsC-0006PG-W0; Mon, 29 Dec 2014 12:21:01 -0700 X-Attribution: Tom In-Reply-To: (Stefan Monnier's message of "Mon, 29 Dec 2014 14:13:55 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 71.33.142.103 authed with tom+tromey.com} X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97811 Archived-At: >> I suppose this supplies a bit of wiggle room, if you leniently interpret >> "prefix characters". Stefan> SMIE interprets "balanced expression" as "a subnode in the AST". Stefan> It can surprise at the beginning, indeed, but in my experience, it's Stefan> a useful generalization for languages with infix syntax. I disagree of course, but I will try not to belabor the point. Stefan> Of course, for infix languages, "a + b * c" might be a proper AST Stefan> subnode (whereas stopping after "a + b" wouldn't if there's a "* c" Stefan> afterwards), but so is "a", when using forward-sexp we have to choose at Stefan> which level of the AST we want to jump forward. In the above case SMIE Stefan> will choose "a" over "a + b * c" (i.e. it will choose the Stefan> smallest/deepest subnode). I noticed this asymmetry and was going to bring it up in this reply. Now you've foiled my riposte. What I mean is that, in the example in this bug, if you do backward-sexp, then forward-sexp just advances over the "a" and not the braced pair. However, this asymmetry does seem less regular, and IMO therefore less useful, than a simpler lexically-based movement scheme. Also conformity with other modes is a distinct plus -- I necessarily touch code in many languages, and it slows me down when one mode or another violates my expectations. Stefan> But when faced with "+ b * c", there is simply no proper subnode ahead. Stefan> Here, SMIE extends yet again the concept of "balanced expression" in Stefan> order to be able to do something meaningful: it jumps over the whole "+ Stefan> b * c" (i.e. over the infix op plus its right argument). This is very Stefan> handy in languages with few parentheses, letting you advance by "large" Stefan> logical units, just like you would in Lisp where every top-level Stefan> statement is wrapped inside parentheses. It's handy to have movement commands that means "symbol or balanced paren-like things". I always thought that was *-sexp. Tom