joshcho / ChatGPT.el

ChatGPT in Emacs
GNU General Public License v3.0
396 stars 34 forks source link

I have no clue why this elisp function make ERROR: nil #30

Closed mindgitrwx closed 1 year ago

mindgitrwx commented 1 year ago

This is simple elisp function that I added. This function suppose to send a line string on the current cursor to the chatgpt--query.

(defun chatgpt-query-by-line ()
  "Run the current line to chatgpt--query"
  (interactive)
  (let ((query (thing-at-point 'line)))
    (when (string-match "[a-zA-Z0-9]" query)
      (setq query (substring query (match-beginning 0))))
    (message "Querying ChatGPT... %s" query)
    (chatgpt--query query)))

But everytime I send the command, this make error

Example of the line

ERROR: nil
AXIOM-XD commented 1 year ago

I have the same issue but without this kind of extra code you wrote.

tkhaos commented 1 year ago

Maybe this https://github.com/joshcho/ChatGPT.el/issues/39 can fix your issue.