# Own predicate like \`--\>/2\` or \`:-/2\` in he built-in prolog editor

**URL:** <https://swi-prolog.discourse.group/t/own-predicate-like-2-or-2-in-he-built-in-prolog-editor/5818>\
**Category:** Predicate\
**Tags:** emacs\
**Created:** [October 3, 2022, 5:40pm UTC](https://swi-prolog.discourse.group/t/own-predicate-like-2-or-2-in-he-built-in-prolog-editor/5818 "2022-10-03T17:40:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![la\_samlai](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/la_samlai/32/4886_2.png) [@la\_samlai](https://swi-prolog.discourse.group/u/la_samlai)\
**Post date:** [October 3, 2022, 5:40pm UTC](https://swi-prolog.discourse.group/t/own-predicate-like-2-or-2-in-he-built-in-prolog-editor/5818/1 "2022-10-03T17:40:54Z")

</div>

I want to add a new predicate `(<--)/2` similar to `(-->)/2` or `(:-)/2`.  
I use it in [this](https://github.com/lasamlai/peg_syntax) library with the [`term_expansion/2`](https://www.swi-prolog.org/pldoc/doc_for?object=term_expansion/2).  
Unfortunately, the built-in prolog editor does not treat this predicate as a built-in `(-->)/2`.  
The `(<--)/2` predicate is colored red, the left atom is not bold and the targets on the right have no automatic indentation (screenshot below).  
How to fix it?

![obraz](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/b/bf615183190bc3ab9daa725738898253b29a910a.png)

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [October 3, 2022, 7:09pm UTC](https://swi-prolog.discourse.group/t/own-predicate-like-2-or-2-in-he-built-in-prolog-editor/5818/2 "2022-10-03T19:09:58Z")

</div>

To get the highlighting to work you need to add rules for the multifile hooks of library(prolog\_colour). The indentation requires probably changes to the prolog mode in the builtin editor. Fire it up and run `?- edit(prolog_mode).` It is all possible. Requires a bit of work though. For the indentation it may require adding hooks to the defined Prolog mode such that user code can be added to support alternative clause definitions.
