Skip to content

Allow all buffer names to be customized#237

Open
treydavis wants to merge 1 commit into
editor-code-assistant:masterfrom
treydavis:custom-buffer-names
Open

Allow all buffer names to be customized#237
treydavis wants to merge 1 commit into
editor-code-assistant:masterfrom
treydavis:custom-buffer-names

Conversation

@treydavis
Copy link
Copy Markdown

A single customizable function for all buffer names

@ericdallo
Copy link
Copy Markdown
Member

A couple of issues:

  • There are calls like here in eca.el that pass session positionally but eca-generate-buffer-name-default-function declares it as &key session — throws Keyword argument ... not one of (:session :chat-id) at runtime. Breaks eca--log-error, eca-show-errors, eca-stop (via eca--emacs-errors-exit) and eca-debug-nrepl-connect.
  • eca-chat--closed is private to eca-chat.el but now also setq-local'd from eca.el and eca-process.el. byte-compiler also warns reference to free variable 'eca-generate-buffer-name-function' in eca-chat/eca-process/eca-settings due to load order. Could we move both the flag and the defcustom to eca-util.el?

@treydavis treydavis force-pushed the custom-buffer-names branch from 8369687 to db13c76 Compare May 11, 2026 22:48
@treydavis
Copy link
Copy Markdown
Author

Thanks for the review.

  • Now calling eca-generate-buffer-name-default-function consistently with keyword args
  • moved eca-generate-buffer-name-function, eca-generate-buffer-name-default-function and eca-chat-closed into eca-util.el. (renamed eca-chat--closed to eca-chat-closed)

@ericdallo
Copy link
Copy Markdown
Member

Couple of things before this merges though:

  • Master moved since you opened this - Hitting enter (bound to eca-chat--key-pressed-return) has no effect #242 (eca-doctor) added four uses of eca-chat--closed in eca-chat.el (around 4277/4317/4347/4383). After the rename they'll silently read an unbound var, so this needs a rebase + sweep of those call sites.
  • The three :closed cleanup loops in eca-chat.el / eca-process.el / eca.el used to each be scoped to one buffer family via a name regexp. Switching them all to (buffer-local-value 'eca-chat-closed b) means whichever loop runs first will also kill the other families' :closed buffers. Probably wants to be scoped per family, or the flag split per family.
  • Since eca-chat-closed is now also set on the stderr and emacs-errors buffers, the name and its docstring don't really fit anymore - maybe just eca-buffer-closed?

Nits: settings buffer-name field order silently flipped from <...:tab-key:session-id> to <...:session-id:tab-key> because tab-key is riding on :chat-id - either restore the order or add a dedicated :tab-key / :suffix keyword. Also missing a CHANGELOG.md entry for the new defcustom and the variable rename.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants