[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3] New: auto display inline images under subtree when `org-cy
From: |
Ihor Radchenko |
Subject: |
Re: [PATCH 3] New: auto display inline images under subtree when `org-cycle'. |
Date: |
Thu, 15 Sep 2022 11:27:41 +0800 |
"Christopher M. Miles" <numbchild@gmail.com> writes:
> Ihor, My new patch still have some issue in the 'fold state which I
> added "FIXME" marker. Hope can get some solution from you.
I will comment only on the first patch for now.
> "EXPORT_OPTIONS" "EXPORT_TEXT" "EXPORT_FILE_NAME"
> "EXPORT_TITLE" "EXPORT_AUTHOR" "EXPORT_DATE" "UNNUMBERED"
> "ORDERED" "NOBLOCKING" "COOKIE_DATA" "LOG_INTO_DRAWER" "REPEAT_TO_STATE"
> - "CLOCK_MODELINE_TOTAL" "STYLE" "HTML_CONTAINER_CLASS")
> + "CLOCK_MODELINE_TOTAL" "STYLE" "HTML_CONTAINER_CLASS"
> + "ORG-IMAGE-ACTUAL-WIDTH")
This change should also be mentioned in the commit message.
> @@ -16164,14 +16165,19 @@ buffer boundaries with possible narrowing."
> (org-element-property :begin par)
> (re-search-forward attr-re par-end t)))
> (match-string 1)))
> + ;; support subtree-level property "ORG-IMAGE-ACTUAL-WIDTH"
> specified width.
> + (subtree-property-width
> + (ignore-errors (org-property-or-variable-value
> 'ORG-IMAGE-ACTUAL-WIDTH)))
You are checking the property too late. I suggest to let-bind
org-image-actual-width around the whole `cond' instead.
That way, subtree-local value of ORG-IMAGE-ACTUAL-WIDTH will have an
effect of setting `org-image-actual-width' value.
Also, is there any particular reason why you wrap
`org-property-or-variable-value' into `ignore-errors'?
Finally, you can simply do
(org-property-or-variable-value 'org-image-actual-width)
It will return the property value _or_ org-image-actual-width value.
> - (car org-image-actual-width))
> + ;; Try to use subtree-level width before fallback.
> + (or subtree-property-width
> + ;; Fallback to `org-image-actual-width' if no interprable
> width is given.
> + (car org-image-actual-width)))
With my last suggestion, this code will not be needed.
Also, this change should be documented in etc/NEWS and also in
"12.7 Images" section of the manual.
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
- [SOLVED] Re: [QUESTION] How to specific image size attributes under headline scope?, Christopher M. Miles, 2022/09/10
- [SOLVED] Re: [QUESTION] How to specific image size attributes under headline scope?, Christopher M. Miles, 2022/09/10
- Re: [SOLVED] Re: [QUESTION] How to specific image size attributes under headline scope?, Ihor Radchenko, 2022/09/11
- [PATCH] Re: [SOLVED] Re: [QUESTION] How to specific image size attributes under headline scope?, Christopher M. Miles, 2022/09/11
- [PATCH] New: auto display inline images under subtree when `org-cycle'., Christopher M. Miles, 2022/09/11
- Message not available
- Re: [PATCH] New: auto display inline images under subtree when `org-cycle'., Ihor Radchenko, 2022/09/12
- [PATCH 2] New: auto display inline images under subtree when `org-cycle'., Christopher M. Miles, 2022/09/12
- Message not available
- [PATCH 3] New: auto display inline images under subtree when `org-cycle'., Christopher M. Miles, 2022/09/12
- Message not available
- Message not available
- Re: [PATCH 3] New: auto display inline images under subtree when `org-cycle'.,
Ihor Radchenko <=
- [PATCH 4] New: auto display inline images under subtree when `org-cycle'., Christopher M. Miles, 2022/09/15
- Message not available
- Re: [PATCH 4] New: auto display inline images under subtree when `org-cycle'., Ihor Radchenko, 2022/09/15
- [PATCH 5] New: auto display inline images under subtree when `org-cycle'., Christopher M. Miles, 2022/09/15
- Message not available
- [PATCH v6] Re: [PATCH 5] New: auto display inline images under subtree when `org-cycle'., Ihor Radchenko, 2022/09/20
- Re: [PATCH v6] New: auto display inline images under subtree when `org-cycle'., Christopher M. Miles, 2022/09/20
- Message not available
- Re: [PATCH v6] New: auto display inline images under subtree when `org-cycle'., Ihor Radchenko, 2022/09/21
- [PATCH 2-v1] New: auto display inline images under subtree when `org-cycle'., Christopher M. Miles, 2022/09/28
- Message not available
- Re: [PATCH 2-v1] New: auto display inline images under subtree when `org-cycle'., Ihor Radchenko, 2022/09/28
- Re: [PATCH 2-v1] New: auto display inline images under subtree when `org-cycle'., Christopher M. Miles, 2022/09/29
- Re: [PATCH 2-v1 (test v1)] New: auto display inline images under subtree when `org-cycle'., Christopher M. Miles, 2022/09/29