s-kostyaev / ellama

Ellama is a tool for interacting with large language models from Emacs.
GNU General Public License v3.0
359 stars 25 forks source link

Remove advice and introduce a session-mode #62

Closed Stebalien closed 5 months ago

Stebalien commented 5 months ago

This fixes #61 and #60 by:

  1. Introducing an ellama-session-mode activated in all session buffers and an ellama-instant-mode activated in all instant buffers.
  2. Binding [remap keyboard-quit] in those minor-modes instead of advising it.
  3. Hooking into the save and kill buffer hooks instead of advising those functions.
Stebalien commented 5 months ago

Note: this code "works" but I haven't really tested the session saving part. Please test and make changes.

Stebalien commented 5 months ago

Open question: should we have a separate minor mode for "instant" mode? Or rename ellama-session-mode to something like ellama-buffer-mode?

I'm thinking "yes" because, personally, I'd want some additional keybindings in sessions. So, something like ellama-session-mode and ellama-instant-mode?

Stebalien commented 5 months ago

I'm thinking "yes" because, personally, I'd want some additional keybindings in sessions. So, something like ellama-session-mode and ellama-instant-mode?

Done.

s-kostyaev commented 5 months ago

Looks good, thank you. I will test it soon.

s-kostyaev commented 5 months ago

@Stebalien Thank you!