s-kostyaev / ellama

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

Prefix key is undefined #88

Closed lockie closed 3 months ago

lockie commented 3 months ago

Hello and thanks for awesome package! I have small issue. I've set ellama-keymap-prefix to "C-c a", but when starting Emacs and pressing that key it says "C-c a is undefined". But after having manually run e.g. M-x ellama-chat it works just fine. I'm not an Elisp expert, but it looks like it has something to do with autoloads mechanism.

Here's the relevant piece of my config:

(use-package ellama
  :ensure t
  :init
  (setq-default ellama-keymap-prefix "C-c a")
  (setq-default ellama-language "English")
  (setq-default ellama-spinner-type 'rotating-line)
  (setq-default ellama-auto-scroll t)
  (require 'llm-ollama)
  (setq-default ellama-provider
          (make-llm-ollama
           :chat-model "mistral"
           :embedding-model "mistral"))
  (setq-default ellama-naming-provider
        (make-llm-ollama
          :chat-model "mistral"
          :embedding-model "mistral"))
  (setq-default ellama-providers
                '(("mistral" . (make-llm-ollama
                                :chat-model "mistral"
                                :embedding-model "mistral"))
                  ("wizardlm-uncensored" . (make-llm-ollama
                                            :chat-model "wizardlm-uncensored"
                                            :embedding-model "wizardlm-uncensored"))))
  (setq-default ellama-naming-scheme 'ellama-generate-name-by-llm)
  (setq-default ellama-translation-provider (make-llm-ollama
                                             :chat-model "mistral"
                                             :embedding-model "mistral"))
  :general
  (:states '(normal visual insert emacs)
   :prefix "SPC"
   :non-normal-prefix "M-m"
   "xl" 'ellama-chat))

I'm using Emacs 28.2.

s-kostyaev commented 3 months ago

It works for me without :general part on emacs 29.2. Try to debug your configuration:

emacs --debug-init
lockie commented 3 months ago

Huh, the problem was indeed in general.el, I'll try to figure that out. Thanks!