elfeed
elfeed copied to clipboard
Respect `shr-max-image-proportion` when rendering elfeed-entry
I noticed that Elfeed would sometimes refuse to scale down images that were too large to be displayed in a given window; after some discussion on the mailing list, I realized this is because Elfeed renders before displaying a buffer, where it can't glean any information about window size (because there's no window).
Note that there is still an issue with SVG images not respecting shr-max-image-proportion, but that has been fixed in Emacs 30 thanks to @jimporter; that's not Elfeed's problem to fix.
Note that there is still an issue with SVG images not respecting
shr-max-image-proportion, but that has been fixed in Emacs 30 thanks to @jimporter; that's not Elfeed's problem to fix.
Emacs 31, actually, though I don't have any particular opposition to making the change in 30 too. (The code has just diverged somewhat between 30 and 31, to fix some issues with zooming images, so I'd need to write a different patch for 30.)
As for the patch, I haven't tried it myself, but from inspection it should do the right thing. Swapping the order around here shouldn't cause any problems I think: so long as there's no redisplay between the two steps (there shouldn't be), everything will be ok and there won't be anything like a flash of unrendered content.
As per the mailing list mentioned, until the updates get pushed out it seems the way to get elfeed to respect shr-max-image-proportion is to disable the cache:
(setq shr-ignore-cache t)
Let me know if I'm mistaken.
Let me know if I'm mistaken.
Personally, I'd just advise the function with the new implementation here. Then you can still use the image cache.