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: Wed, 30 Sep 2015 22:40:31 +0200 Message-ID: <87bncjbpz4.fsf@metalevel.at> References: <87y4fo9zt6.fsf@metalevel.at> <87vbarwy9v.fsf@metalevel.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1443686586 18087 80.91.229.3 (1 Oct 2015 08:03:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Oct 2015 08:03:06 +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 Thu Oct 01 10:02:58 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 1ZhYpL-0000iZ-Oq for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Oct 2015 10:02:55 +0200 Original-Received: from localhost ([::1]:40430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhYpL-0007j1-Ac for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Oct 2015 04:02:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhOBY-0005G8-F0 for bug-gnu-emacs@gnu.org; Wed, 30 Sep 2015 16:41:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhOBU-0005Mo-Dm for bug-gnu-emacs@gnu.org; Wed, 30 Sep 2015 16:41:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhOBT-0005MP-V1 for bug-gnu-emacs@gnu.org; Wed, 30 Sep 2015 16:41:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZhOBT-0006Z5-EV for bug-gnu-emacs@gnu.org; Wed, 30 Sep 2015 16:41:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Markus Triska Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Sep 2015 20:41:03 +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.144364563725196 (code B ref 21526); Wed, 30 Sep 2015 20:41:03 +0000 Original-Received: (at 21526) by debbugs.gnu.org; 30 Sep 2015 20:40:37 +0000 Original-Received: from localhost ([127.0.0.1]:49588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhOB0-0006YI-Om for submit@debbugs.gnu.org; Wed, 30 Sep 2015 16:40:35 -0400 Original-Received: from static.59.150.47.78.clients.your-server.de ([78.47.150.59]:53546 helo=metalevel.at) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhOAy-0006Y9-G6 for 21526@debbugs.gnu.org; Wed, 30 Sep 2015 16:40:33 -0400 Original-Received: by metalevel.at (Postfix, from userid 1000) id 683F2EC0FF; Wed, 30 Sep 2015 22:40:31 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Wed, 30 Sep 2015 16:19:44 -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:107113 Archived-At: Stefan Monnier writes: > Is there a precedence table somewhere that includes "multifile" > and friends? The one I have doesn't include it. You can generate such a table directly from Prolog, using for example: ?- current_op(P, T, N), portray_clause(P-T-N), false. This yields the precedence (smaller = tighter), types and names of all operators that are available by default. Users may change these precedences, but it is unusual and bad practice to change the precedence of default operators. So I would use this as a good approximation. Using SWI-Prolog, you obtain for example: 250-yfx- (?). 1-fx- ($). 990-xfx- (:=). 200-fy- (@). 1150-fx- (volatile). 700-xfx- (=@=). 200-xfy- (^). 700-xfx- (@>). 100-yfx- ('.'). 1150-fx- (meta_predicate). 400-yfx- (rdiv). 500-yfx- (\/). 1150-fx- (initialization). 600-xfy- (:). 1200-xfx- (-->). 700-xfx- (=..). 400-yfx- (*). 700-xfx- (@>=). 1100-xfy- (;). 700-xfx- (\=@=). 700-xfx- (>:<). 1150-fx- (dynamic). 700-xfx- (@<). 700-xfx- (:<). 700-xfx- (@=<). 400-yfx- (xor). 1150-fx- (discontiguous). 700-xfx- (>=). 400-yfx- (//). 700-xfx- (>). 400-yfx- (div). 1150-fx- (module_transparent). 1200-fx- (?-). 500-yfx- (/\). 400-yfx- (/). 200-fy- (+). 500-yfx- (+). 1150-fx- (multifile). 400-yfx- (<<). 1150-fx- (public). 1200-fx- (:-). 1200-xfx- (:-). 400-yfx- (rem). 1000-xfy- (','). 1150-fx- (thread_initialization). 700-xfx- (\=). 700-xfx- (=). 1050-xfy- (*->). 700-xfx- (=<). 700-xfx- (<). 1050-xfy- (->). 700-xfx- (as). 1150-fx- (thread_local). 400-yfx- (>>). 200-fy- (-). 500-yfx- (-). 700-xfx- (is). 900-fy- (\+). 200-fy- (\). 700-xfx- (=:=). 400-yfx- (mod). 200-xfx- (**). 700-xfx- (\==). 700-xfx- (==). 1105-xfy- ('|'). 700-xfx- (=\=). In SWI-Prolog, try the query: ?- help(op/3). to see what these type indicators (xfx, fx etc.) mean. I hope this helps you to indent according to operator precedence. All the best, Markus