[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2-v2] New: auto display inline images under subtree when `org
From: |
Ihor Radchenko |
Subject: |
Re: [PATCH 2-v2] New: auto display inline images under subtree when `org-cycle'. |
Date: |
Sat, 01 Oct 2022 11:16:07 +0800 |
"Christopher M. Miles" <numbchild@gmail.com> writes:
> I attached new version patch.
Thanks!
> +(defcustom org-cycle-inline-images-display nil
> + "Non-nil means auto display inline images under subtree when cycling."
> + :group 'org-startup
> + :group 'org-cycle
> + :type 'boolean)
Please add :package-version tag as well.
> + ('folded
> + (save-excursion
> + (save-restriction
> + (org-narrow-to-subtree)
> + ;; FIXME: sometimes `point-max' is EOF.
Do you still need this FIXME?
Also, you can use `org-with-wide-buffer' instead of
save-excursion/restriction.
> +;;; TODO: reference `test-org-fold/org-fold-reveal-broken-structure'
> +(ert-deftest test-org-fold/org-fold-display-inline-images ()
> + "Test inline images displaying when cycling."
> + (let ((org-fold-core-style 'text-properties)
Why do you need to set `org-fold-core-style' explicitly here?
> + (org-cycle-inline-images-display t))
> + ;; `org-cycle' -(state)-> `'children' display child inline images.
> + (org-test-with-temp-text
> + "<point>* Heading 1
> +[[file:image.png]]"
This will not work in real tests. image.png will not exist.
You will need to provide a reference image in testing/examples
> + ;; `org-cycle' -(state)-> `'folded' remove inline image overlays.
> + (org-test-with-temp-text
> + "<point>* Heading 1
> +[[file:image.png]]
> +** Subheading 1
> +[[file:image2.png]]
> +** Subheading 2
> +[[file:image3.png]]"
> + (org-overview)
> + (org-cycle)
> + (org-cycle)
> + (org-cycle)
> + ;; TODO: how to detect inline image overlays are deleted after folded?
> + (should (overlays-at (point)))
> + (org-toggle-inline-images)
> + (should-not (overlays-at (point))))))
This latest test will not work. The point is at BOB.
--
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
- [PATCH 5] New: auto display inline images under subtree when `org-cycle'., (continued)
- [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
- Message not available
- Re: [PATCH 2-v1] New: auto display inline images under subtree when `org-cycle'., Ihor Radchenko, 2022/09/29
- Re: [PATCH 2-v2] New: auto display inline images under subtree when `org-cycle'., Christopher M. Miles, 2022/09/30
- Message not available
- Re: [PATCH 2-v2] New: auto display inline images under subtree when `org-cycle'.,
Ihor Radchenko <=
- Message not available
- [ISSUE] Re: [PATCH] New: auto display inline images under subtree when `org-cycle'., Christopher M. Miles, 2022/09/12