From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.bugs Subject: bug#21526: 24.5; prolog-mode: broken indentation for if-then-else construct Date: Tue, 06 Oct 2015 18:45:16 +0200 Message-ID: <87egh8rlnn.fsf@metalevel.at> 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 1444163367 14036 80.91.229.3 (6 Oct 2015 20:29:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Oct 2015 20:29:27 +0000 (UTC) Cc: 21526@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 06 22:29:16 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 1ZjYrL-0008KL-Ff for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Oct 2015 22:29:15 +0200 Original-Received: from localhost ([::1]:53767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjYrK-0002EV-K3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Oct 2015 16:29:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjYrF-0002EA-Eq for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2015 16:29:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjVNK-0003Hg-EF for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2015 12:47:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjVNK-0003EK-3L for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2015 12:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZjVNJ-0003aB-S6 for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2015 12:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Markus Triska Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Oct 2015 16:46: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.144414992110984 (code B ref 21526); Tue, 06 Oct 2015 16:46:01 +0000 Original-Received: (at 21526) by debbugs.gnu.org; 6 Oct 2015 16:45:21 +0000 Original-Received: from localhost ([127.0.0.1]:57318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjVMe-0002qJ-Cr for submit@debbugs.gnu.org; Tue, 06 Oct 2015 12:45:21 -0400 Original-Received: from static.59.150.47.78.clients.your-server.de ([78.47.150.59]:56012 helo=metalevel.at) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjVMb-0002n0-Ns for 21526@debbugs.gnu.org; Tue, 06 Oct 2015 12:45:18 -0400 Original-Received: by metalevel.at (Postfix, from userid 1000) id 897D8EC103; Tue, 6 Oct 2015 18:45:16 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Mon, 05 Oct 2015 21:17:10 -0400") 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:107391 Archived-At: Stefan Monnier writes: > 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. I would like to test the mode more seriously, and the most impeding aspect of the new navigation is currently that Prolog terms within comments are skipped over way too far, and comments in general make the mode's navigation hard to predict in my view. Consider for example: % Hello, % there. it_is_a_fact. %?- test(a,b).HERE In that sitation, pressing C-M-b yields: HERE% Hello, % there. it_is_a_fact. %?- test(a,b). However, when I press C-M-b for example with: x. % Hello, % there. it_is_a_fact. %?- test(a,b).HERE Then I get: x. % Hello, % there. HEREit_is_a_fact. %?- test(a,b). Thus, syntactic constructs that are comparatively far away from the Prolog terms near point influence the navigation with C-M-b. In this case, placing the fact x/0 at the beginning made the mode NOT jump over a fact and a comment, whereas it otherwise jumps over both of them. In other modes I tested, syntactic elements of the language are handled as expected also within comments when using C-M-b and C-M-f. For example, in the case of Prolog, we have with the recent git version: ?- test(a,b). ?- test(x,y).HERE Pressing C-M-b yields, as expected: ?- test(a,b). HERE?- test(x,y). The reason is clear: The Prolog term ?-(test(x,y)) is the one that immediately precedes point, and pressing C-M-b jumps precisely over it. However, when both of these terms are commented, as in: %?- test(a,b). %?- test(x,y).HERE then pressing C-M-b skips over both of them, and, depending on what appears before these lines, may move away even further than that. This is completely unexpected and unusual in Emacs modes: In other modes I tested (C, Lisp etc.), C-M-b and C-M-f behave very consistently, also if the syntactic elements they usually jump over arise in comments. In the case of Prolog though, it is particularly unfortunate because of tools like ediprolog that encourage users to embed Prolog terms as queries in comments, and pressing C-M-b with the expectation to move to the beginning of such terms will in general move point to a position that is much further away, and from where it is not easy to get back. Please consider reinstating the navigation that was previously available, or making the current navigation work better with comments. Thank you and all the best, Markus