[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix regex for determining image width from attribute
From: |
Timothy |
Subject: |
Re: [PATCH] Fix regex for determining image width from attribute |
Date: |
Mon, 22 Nov 2021 03:20:36 +0800 |
User-agent: |
mu4e 1.6.9; emacs 28.0.50 |
Hi Matt,
> A recent patch started computing the inline image width from any attr_
> line. This is incorrect, as it matches settings like attr_latex, or
> attr_html. We only want to look for settings specifically for the org
> buffer. This patch fixes that.
Once again, thank you for the patch. The fact that the current regexp matches
`#+attr_latex' and `#+attr_html' is in fact by design though*. This is because I
consider it safe to assume that a `#+attr_*' which gives non-integer width
between
0 and 2 can be safely assumed to be that proportion of the page width. e.g.
`#+attr_latex: :width 0.7\linewidth' or `#+attr_html: :width 70%'.
This way, a good guess can be made without having do have both an
`#+attr_latex/html' /and/ an `#+attr_org' line for the width. Should this
assumption
be incorrect, a subsequent `#+attr_org' line will override the other `#+attr_*'.
Should there be edge-cases where this assumption doesn’t hold, I’d be interested
in patches that improves the logic here. As long as this holds more often than
not though, this should be a net positive for user experience as I see it.
Do please let me know if there are any good examples of unintended /
counter-intuitive behaviour you’re aware of.
All the best,
Timothy
* Well, it’s worked this way for a while, and I made a deliberate choice to keep
this behaviour when expanding the width to recognise proportional values.
- [PATCH] Fix regex for determining image width from attribute, Matt Huszagh, 2021/11/21
- Re: [PATCH] Fix regex for determining image width from attribute,
Timothy <=
- Re: [PATCH] Fix regex for determining image width from attribute, Matt Huszagh, 2021/11/21
- Re: [PATCH] Fix regex for determining image width from attribute, Timothy, 2021/11/22
- Re: [PATCH] Fix regex for determining image width from attribute, Matt Huszagh, 2021/11/22
- Re: [PATCH] Fix regex for determining image width from attribute, Timothy, 2021/11/22
- Re: [PATCH] Fix regex for determining image width from attribute, Matt Huszagh, 2021/11/22
- Re: [PATCH] Fix regex for determining image width from attribute, Kyle Meyer, 2021/11/22
- Re: [PATCH] Fix regex for determining image width from attribute, Timothy, 2021/11/23
- Re: [PATCH] Fix regex for determining image width from attribute, Matt Huszagh, 2021/11/23
- Re: [PATCH] Fix regex for determining image width from attribute, Timothy, 2021/11/23
- Re: [PATCH] Fix regex for determining image width from attribute, Matt Huszagh, 2021/11/23