Skip to content

Fix error in kubed-display-resource-revert #21

Closed
MagielBruntink wants to merge 1 commit into
eshelyaron:masterfrom
MagielBruntink:master
Closed

Fix error in kubed-display-resource-revert #21
MagielBruntink wants to merge 1 commit into
eshelyaron:masterfrom
MagielBruntink:master

Conversation

@MagielBruntink

Copy link
Copy Markdown

kubed-display-resource-revert calls replace-region-contents, I think erroneously. Upon requesting a resource to be displayed, there is an error like the following, which is due to the buffer being used as replace-fn argument.

replace-region-contents: Invalid function: #<killed buffer>

This PR changes that call to replace-buffer-contents instead, which resolved the problem.

eshelyaron added a commit that referenced this pull request Jun 19, 2026
We recently switched to using 'replace-region-contents'
instead of 'replace-buffer-contents', because the latter is
deprecated in Emacs 31.  However, the way we call
'replace-region-contents' is only valid since Emacs 31, so
it failed on Emacs 30.

Reported in #21

* kubed.el (kubed--replace-buffer-contents): New function.
(kubed-display-resource-revert, kubed-display-config): Use it.
@eshelyaron

Copy link
Copy Markdown
Owner

Hi there @MagielBruntink , thanks for the PR!
We switched away from replace-buffer-contents in favor of replace-region-contents recently because replace-buffer-contents is deprecated in Emacs 31, but due to an oversight the new code was incompatible with earlier Emacs versions.
I've pushed a fix that should restore compatibility. Could you please give the latest master a try?

@MagielBruntink

Copy link
Copy Markdown
Author

I have tried the latest master and can confirm that it resolves the issue. Thanks!

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