karthink / gptel

A simple LLM client for Emacs
GNU General Public License v3.0
1.63k stars 151 forks source link

Jump to file from context buffer not working. #482

Open metachip opened 4 hours ago

metachip commented 4 hours ago

Please update gptel first -- errors are often fixed by the time they're reported.

Bug Description

Jump to file from context buffer not working. This appears to work for buffers and regions, but not files.

Backend

None

Steps to Reproduce

When I add a file to context, and then try to jump to the file from the context window, an error occurs.

The reported error is

funcall-interactively: Wrong type argument: overlayp, "~/Downloads/Roadmap-V1.png"

Additional Context

Emacs 28.2

Backtrace

Debugger entered--Lisp error: (wrong-type-argument overlayp nil)
  gptel-context-visit()
  funcall-interactively(gptel-context-visit)
  command-execute(gptel-context-visit)

Log Information

No response

metachip commented 4 hours ago

Another minor problem likely to be in the same part of the source code: The gptel-context buffer is not updated when context is deleted. That is, when context is deleted using =d= and =C-c C-c= the context buffer is not updated. The deleted context is still shown. The context buffer only appears to be updated when =gptel-add= or =gptel-add-file= is used. Doing a manual update =g= in the context also updates the context buffer.

karthink commented 4 hours ago

funcall-interactively: Wrong type argument: overlayp, "~/Downloads/Roadmap-V1.png"

Thanks, I'll fix this.

That is, when context is deleted using =d= and =C-c C-c= the context buffer is not updated

What do you mean by the "context buffer" here? The buffer showing all the context chunks, or the source buffer for one of these chunks?

metachip commented 4 hours ago

The buffer showing all the context chunks.

karthink commented 4 hours ago

Then I don't understand this:

That is, when context is deleted using =d= and =C-c C-c= the context buffer is not updated

After C-c C-c the context buffer goes away. So what do you mean by "it's not updated"?

metachip commented 4 hours ago

Not if it's open in two windows or one (re)selects it without adding anything else to it. It still exists, with stale data. Not a major problem, but confusing.

karthink commented 3 hours ago

Got it, thanks for reporting this too. I'll fix both bugs when I can.