From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#21526: 24.5; prolog-mode: broken indentation for if-then-else construct Date: Mon, 05 Oct 2015 21:17:10 -0400 Message-ID: References: <8737xwbeo0.fsf@metalevel.at> <87a8rw27vh.fsf@metalevel.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444094302 24789 80.91.229.3 (6 Oct 2015 01:18:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Oct 2015 01:18:22 +0000 (UTC) Cc: 21526@debbugs.gnu.org To: Markus Triska Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 06 03:18:12 2015 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 1ZjGtO-0000XD-Fl for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Oct 2015 03:18:10 +0200 Original-Received: from localhost ([::1]:48418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjGtN-0001D2-JI for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Oct 2015 21:18:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjGtJ-0001Bw-SW for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2015 21:18:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjGtG-0004tE-Ie for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2015 21:18:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjGtG-0004tA-Fh for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2015 21:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZjGtF-0001Vs-To for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2015 21:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Oct 2015 01:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21526 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21526-submit@debbugs.gnu.org id=B21526.14440942355758 (code B ref 21526); Tue, 06 Oct 2015 01:18:01 +0000 Original-Received: (at 21526) by debbugs.gnu.org; 6 Oct 2015 01:17:15 +0000 Original-Received: from localhost ([127.0.0.1]:55659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjGsV-0001Uo-4i for submit@debbugs.gnu.org; Mon, 05 Oct 2015 21:17:15 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:50450) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjGsS-0001Uf-Ge for 21526@debbugs.gnu.org; Mon, 05 Oct 2015 21:17:13 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AsEwA731xV/3aQs2tcgxCEAoVVuzcJh0sEAgKBPDkUAQEBAQEBAYEKQQWDXQEBAwFWIwULCzQSFBgNJIg3CM8jAQEBAQYBAQEBHos6hQUHhC0BBJltmxcjhBQigngBAQE X-IPAS-Result: A0AsEwA731xV/3aQs2tcgxCEAoVVuzcJh0sEAgKBPDkUAQEBAQEBAYEKQQWDXQEBAwFWIwULCzQSFBgNJIg3CM8jAQEBAQYBAQEBHos6hQUHhC0BBJltmxcjhBQigngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="167638040" Original-Received: from 107-179-144-118.cpe.teksavvy.com (HELO fmsmemgm.homelinux.net) ([107.179.144.118]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 05 Oct 2015 21:17:12 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id A024BAECF0; Mon, 5 Oct 2015 21:17:10 -0400 (EDT) In-Reply-To: <87a8rw27vh.fsf@metalevel.at> (Markus Triska's message of "Tue, 06 Oct 2015 01:49:54 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) 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: 208.118.235.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:107343 Archived-At: >> From that position, I press C-M-f, and get: > test :- > ( a, > b > ; ( c, > d > ; e, > f > ), > g, > hHERE > ). That's not a bug, it's a feature: you jumped over all the right-hand-side of the ";". The old behavior is easy to get, but is less useful. Basically the new behavior lets you jump over "any" subtree in the AST, whereas the old behavior only allowed you to jump over those subtrees which are made of a single identifier or are delimited by parentheses. E.g. if you want to swap the order of the two top-level alternatives in the above example, just put point before or after the ";" and hit C-M-t. > I tried navigating several such code snippets with Stefan Bruda's mode, > starting from various positions. In all cases, the important invariant > seems to be preserved that, give or take an offset of at most 1, we can > invert a C-M-f with a subsequent C-M-b in most if not all situations > that are of great practical importance when moving through Prolog code. Not sure what you mean by "offset of at most 1". E.g. with abd toto titi starting at the end of "abd", after C-M-f I don't see how you can get back to within 1 char of the original position with some number of C-M-b. The new behavior is different, there's no doubt about it. I think the fact that it knows about infix operators and their relative precedence is a great improvement, bringing sexp navigation closer to what you get in Lisp. Stefan