alphapapa / pocket-reader.el

Emacs client for Pocket reading list (getpocket.com)
GNU General Public License v3.0
223 stars 12 forks source link

Fontify based on rendered column widths #40

Closed bcc32 closed 1 year ago

bcc32 commented 2 years ago

When tabulated-list-mode renders a line, it considers the remaining available space in the selected window and may reduce the width of a column compared to the width specified in tabulated-list-format. As a result, fontifying or otherwise calculating offsets based on the widths in tabulated-list-format can lead to colors bleeding over into the next column.

Delete function pocket-reader--column-data, which returns the "theoretical" start and end positions of each column, and instead use the actual text properties in the buffer.

Fixes #36.

alphapapa commented 2 years ago

Thanks.

I don't see the text-property-search library in some Emacs versions I'm using, as well as the prop-match-beginning/end functions. What version were they added in? If we use them, we'll have to increase the minimum Emacs version.

bcc32 commented 2 years ago

Ah, good catch. They were introduced in emacs 27.1. I can also reimplement them using next-single-property-change, which is much older (I'm not sure when it was added, but they got a new function argument 19.22, so it's safe to say they're very old).

alphapapa commented 1 year ago

Thanks.