Skip to content

agent-shell-markdown--table-measure-string might prefer string-pixel-width #642

@shipmints

Description

@shipmints

string-pixel-width respects the selected window and also, more importantly, respects face remappings as one has to when using text-scale-mode. In Emacs 31, it uses work buffers which are an order of magnitude faster than temp buffers (reused pool) which eliminates gc pressure. I'm sure there was a reason to avoid the standard function but as the code could have been written by an LLM, it's hard to reason about as it/the author did not add a comment about that. Emacs 31 also has the function truncate-string-pixelwise which you could use to fit strings into constrained specified space.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions