emacs-openai / codegpt

Use GPT-3 inside Emacs
GNU General Public License v3.0
86 stars 12 forks source link

Error when trying to add custom template to codegpt-action-alist #2

Closed Artawower closed 1 year ago

Artawower commented 1 year ago

I am trying to add new template for quick action: (add-to-list 'codegpt-action-alist '("JSDoc" . "Write JSDoc for this method"))

But when i try execute it i face with next error:

Debugger entered--Lisp error: (void-function nil)
  nil(9146 9243)
  codegpt(9146 9243)
  funcall-interactively(codegpt 9146 9243)
  command-execute(codegpt record)
  execute-extended-command(nil "codegpt" nil)
  funcall-interactively(execute-extended-command nil "codegpt" nil)
  command-execute(execute-extended-command)

Am I missing something?

jcs090218 commented 1 year ago

Oh, variable codegpt-action-alist is a constant (defconst), and should not be configured.

I think it's a good feature to dynamic generates the custom functions, etc.

jcs090218 commented 1 year ago

Improved in #4. Thanks for your contribution! ❤️