# Keybindings

**URL:** <https://swi-prolog.discourse.group/t/keybindings/7786>\
**Category:** General\
**Created:** [September 17, 2024, 3:25pm UTC](https://swi-prolog.discourse.group/t/keybindings/7786 "2024-09-17T15:25:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![z5h](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/z5h/32/5445_2.png) [@z5h](https://swi-prolog.discourse.group/u/z5h)\
**Post date:** [September 17, 2024, 3:25pm UTC](https://swi-prolog.discourse.group/t/keybindings/7786/1 "2024-09-17T15:25:31Z")

</div>

Can someone walk me through EXACTLY how to change a keybinding in PceEmacs?  
The documentation is simply not clear and complete.

None of ChatGPT o1, Claude, Gemeni, could change a single keybinding with multiple attempts and feedback on errors.  
We made multiple attempts at modifying Defaults, using multiple variations of syntax, we tried creating custom emacs modes or modifying emacs mode, we tried using “consult” with files, we tried `send` ing to various @stuff from the command line.

Bonus points for anyone who can show the exact sequence of documentation I’d read to learn how to make this happen.

---

<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:** [September 17, 2024, 4:09pm UTC](https://swi-prolog.discourse.group/t/keybindings/7786/2 "2024-09-17T16:09:27Z")

</div>

Well, AFAIK, you cannot set key-bindings through the `Defaults` file. You can add Prolog files to refine modes. I have some of that stuff, so I’ve pushed it to [GitHub - JanWielemaker/my-pceemacs-lib](https://github.com/JanWielemaker/my-pceemacs-lib)

---

<div class="post-metadata">

**Author:** ![z5h](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/z5h/32/5445_2.png) [@z5h](https://swi-prolog.discourse.group/u/z5h)\
**Post date:** [September 17, 2024, 5:56pm UTC](https://swi-prolog.discourse.group/t/keybindings/7786/3 "2024-09-17T17:56:18Z")

</div>

Thank you.

After much experimenting, I finally see that the file’s name must be exactly `fundamental_mode.pl`, and it must be in the `emacs` subdirectory, and it mustn’t be sourced manually.

Then it “just works”.

Which documentation should I have picked that up from?

---

<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:** [September 17, 2024, 6:47pm UTC](https://swi-prolog.discourse.group/t/keybindings/7786/4 "2024-09-17T18:47:53Z")

</div>

> [@z5h](#):
>
> Then it “just works”.

If a mode is loaded it will look there to load user refinements. No clue whether or not that is documented. Probably somewhere ☹
