Hs),
maplist(sweep_format_predicate, Hs, Ps).
-sweep_format_predicate(H, S) :-
+sweep_format_predicate(H, [S|SP]) :-
term_variables(H, Vs),
maplist(=('$VAR'('_')), Vs),
term_string(H, S, [quoted(true),
character_escapes(true),
spacing(next_argument),
- numbervars(true)]).
+ numbervars(true)]),
+ term_string(_, S, [subterm_positions(SP)]).
sweep_context_callable([H|T], R) :-
H = [F0|_],
(list beg end col
:exclusive 'no
:annotation-function
- (lambda (_) " Predicate"))))))
+ (lambda (_) " Predicate")
+ :exit-function
+ (lambda (string status)
+ (pcase status
+ ('finished (pcase (cdr (assoc-string string col))
+ (`(compound
+ "term_position"
+ 0 ,length
+ fbeg fend
+ ,holes)
+ (with-silent-modifications
+ (dolist (hole holes)
+ (pcase hole
+ (`(compound "-" ,hbeg ,hend)
+ (put-text-property (- (point) length (- hbeg))
+ (- (point) length (- hend))
+ 'sweeprolog-hole t)))))
+ (backward-char length)
+ (sweeprolog-forward-hole)))))))))))
;;;; Packages