GNU bug report logs -
#21526
24.5; prolog-mode: broken indentation for if-then-else construct
Previous Next
Reported by: Markus Triska <triska <at> metalevel.at>
Date: Sun, 20 Sep 2015 16:21:01 UTC
Severity: minor
Found in version 24.5
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> iro.umontreal.ca> 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
This bug report was last modified 4 years and 269 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.