From: "Christopher M. Miles" <numbchild@gmail.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: "Christopher M. Miles" <numbchild@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: [PATCH 2-v4] New: auto display inline images under subtree when `org-cycle'.
Date: Tue, 04 Oct 2022 15:27:11 +0800 [thread overview]
Message-ID: <m2pmf8hwbq.fsf@numbchild@gmail.com> (raw)
In-Reply-To: <87sfk4urvz.fsf@localhost>
[-- Attachment #1: Type: text/plain, Size: 4428 bytes --]
Ihor Radchenko <yantar92@gmail.com> writes:
> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
>> I think the patch is finished. Please review, Ihor. Thanks for helping.
>
> Thanks for the update!
> I have cleaned the manual and ORG-NEWS wordings.
>
> Upon reading the exported version of the manual, I realized that the
> part in 2.2.1 Global and local cycling section sounds very awkward and
> that we do not mention other cycle hooks like hiding archived
> subtrees there. So, I decided to remove it.
>
> I also rewrote the other part in a bit more direct tone and moved the
> index entry.
>
> (In general, it is useful to try reading the exported version of the
> manual with the additions to check if things are still coherent - manual
> is not just a collection of independent statements; we need to make sure
> that it is not confusing the new readers).
>
> I also updated the commit message adding the CHANGELOG entries about the
> manual and ORG-NEWS.
>
It's OK.
> I am attaching the updated version of the patch with my amendments.
Applied your updated patch.
> However, upon testing your patch, tests are still failing on my side.
> Can you please investigate?
But If I use [M-x ert] to run the test "test-org-fold/org-fold-display-inline-images" is passed.
Here is the steps:
1. [M-x load-file RET /path/to/org-mode/testing/org-test.el RET]
2. [C-M-x] to evaluate the target test
3. [M-x ert RET test-org-fold/org-fold-display-inline-images RET] to run this test
I attached the uploaded screencast video link to prove it passed.
https://share.cleanshot.com/tvUUoQ
I tried many different other API functions to cycle or fold/unfold, but none
of them works under command "make test" or command
"make BTEST_RE="test-org-fold/org-fold-display-inline-images" test-dirty".
I have nothing brain to think for this test now. Really can't figure out
why this image is not displayed as overlay. Can you help me to fix this test?
#+begin_src emacs-lisp
(ert-deftest test-org-fold/org-fold-display-inline-images ()
"Test inline images displaying when cycling."
(let* ((org-cycle-inline-images-display t)
(images-dir (expand-file-name "examples/images/" org-test-dir))
(org-logo-image (expand-file-name "Org mode logo mono-color.png" images-dir)))
;; `org-cycle' -(state)-> `'children' display child inline images.
(org-test-with-temp-text
(format "<point>* Heading 1
[[file:%s]]
" org-logo-image)
(org-overview)
(org-cycle)
;; (org-cycle-internal-local)
;; (run-hook-with-args 'org-cycle-hook 'children)
;; (org-cycle-display-inline-images 'children)
(org-next-link)
;; (should org-inline-image-overlays)
(should (overlays-at (point)))
(org-toggle-inline-images)
(should-not (overlays-at (point))))
;; `org-cycle' -(state)-> `'subtree' display subtrees inline images.
(org-test-with-temp-text
(format "<point>* Heading 1
[[file:%s]]
** Subheading 1
[[file:%s]]
** Subheading 2
[[file:%s]]" org-logo-image org-logo-image org-logo-image)
(org-overview)
(org-cycle)
(org-cycle)
;; (org-cycle-internal-global)
;; (run-hook-with-args 'org-cycle-hook 'subtree)
(org-next-link)
(org-next-link)
;; (should org-inline-image-overlays)
(should (overlays-at (point)))
(org-toggle-inline-images)
(should-not (overlays-at (point))))
;; `org-cycle' -(state)-> `'folded' remove inline image overlays.
(org-test-with-temp-text
(format "<point>* Heading 1
[[file:%s]]
** Subheading 1
[[file:%s]]
** Subheading 2
[[file:%s]]" org-logo-image org-logo-image org-logo-image)
(org-overview)
(org-show-subtree)
(org-fold-subtree t)
(run-hook-with-args 'org-cycle-hook 'folded)
(should (null org-inline-image-overlays))
(should (null (overlays-in (point-min) (point-max))))
(org-show-subtree)
(should-not org-inline-image-overlays)
(should-not (overlays-in (point-min) (point-max))))))
#+end_src
--
[ stardiviner ]
I try to make every word tell the meaning that I want to express without misunderstanding.
Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
next prev parent reply other threads:[~2022-10-04 7:58 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 6:34 [QUESTION] How to specific image size attributes under headline scope? Christopher M. Miles
2021-11-22 18:31 ` Timothy
2022-08-18 12:44 ` Christopher M. Miles
[not found] ` <m2o7whra7j.fsf@numbchild>
2022-08-22 17:10 ` Timothy
2022-08-23 0:24 ` Christopher M. Miles
2022-09-11 2:20 ` [SOLVED] " Christopher M. Miles
2022-09-11 2:25 ` Christopher M. Miles
[not found] ` <631d472b.c80a0220.2b4b2.bf86SMTPIN_ADDED_BROKEN@mx.google.com>
2022-09-11 12:34 ` Ihor Radchenko
2022-09-12 1:54 ` [PATCH] " Christopher M. Miles
2022-09-12 1:59 ` [PATCH] New: auto display inline images under subtree when `org-cycle' Christopher M. Miles
[not found] ` <m2wna9bbc2.fsf@numbchild>
2022-09-12 6:03 ` [ISSUE] " Christopher M. Miles
[not found] ` <631e92ee.050a0220.f9c18.92f5SMTPIN_ADDED_BROKEN@mx.google.com>
2022-09-12 10:51 ` Ihor Radchenko
2022-09-13 1:09 ` [PATCH 2] " Christopher M. Miles
[not found] ` <m2leqogiz8.fsf@numbchild>
2022-09-13 1:48 ` [PATCH 3] " Christopher M. Miles
[not found] ` <631fe1c9.050a0220.3ab2b.3f52SMTPIN_ADDED_BROKEN@mx.google.com>
2022-09-15 3:27 ` Ihor Radchenko
2022-09-15 4:53 ` [PATCH 4] " Christopher M. Miles
[not found] ` <6322b0a8.050a0220.59bb8.6923SMTPIN_ADDED_BROKEN@mx.google.com>
2022-09-15 8:47 ` Ihor Radchenko
2022-09-15 9:43 ` [PATCH 5] " Christopher M. Miles
[not found] ` <6322f5ad.c80a0220.5e936.823eSMTPIN_ADDED_BROKEN@mx.google.com>
2022-09-20 7:01 ` [PATCH v6] " Ihor Radchenko
2022-09-20 11:32 ` [PATCH v6] " Christopher M. Miles
[not found] ` <6329c8b0.050a0220.412d.0a6cSMTPIN_ADDED_BROKEN@mx.google.com>
2022-09-21 7:54 ` Ihor Radchenko
2022-09-28 12:55 ` [PATCH 2-v1] " Christopher M. Miles
[not found] ` <633454e3.050a0220.7278b.1fa5SMTPIN_ADDED_BROKEN@mx.google.com>
2022-09-29 3:05 ` Ihor Radchenko
2022-09-29 6:06 ` Christopher M. Miles
2022-09-29 6:57 ` [PATCH 2-v1 (test v1)] " Christopher M. Miles
[not found] ` <63353c69.370a0220.67788.e8a1SMTPIN_ADDED_BROKEN@mx.google.com>
2022-09-30 3:19 ` [PATCH 2-v1] " Ihor Radchenko
2022-09-30 8:27 ` [PATCH 2-v2] " Christopher M. Miles
[not found] ` <6336a955.050a0220.4e72e.2b23SMTPIN_ADDED_BROKEN@mx.google.com>
2022-10-01 3:16 ` Ihor Radchenko
2022-10-01 9:51 ` [PATCH 2-v3] " Christopher M. Miles
[not found] ` <63380f57.370a0220.a9d9a.dee8SMTPIN_ADDED_BROKEN@mx.google.com>
2022-10-03 3:21 ` Ihor Radchenko
2022-10-03 4:37 ` [PATCH 2-v4] " Christopher M. Miles
[not found] ` <633a67d8.050a0220.733e8.e57dSMTPIN_ADDED_BROKEN@mx.google.com>
2022-10-04 4:36 ` Ihor Radchenko
2022-10-04 7:27 ` Christopher M. Miles [this message]
[not found] ` <633be6d3.370a0220.4060.bacdSMTPIN_ADDED_BROKEN@mx.google.com>
2022-10-08 7:53 ` Ihor Radchenko
2022-10-08 9:50 ` Christopher M. Miles
[not found] ` <634149f4.c80a0220.1376.e564SMTPIN_ADDED_BROKEN@mx.google.com>
2022-10-09 7:21 ` Ihor Radchenko
2022-10-10 8:40 ` Christopher M. Miles
[not found] ` <m2v8os5aqy.fsf@numbchild>
2022-10-22 1:29 ` Christopher M. Miles
2022-10-23 4:33 ` Ihor Radchenko
2022-10-23 7:14 ` Christopher M. Miles
2022-10-25 7:23 ` Ihor Radchenko
2022-10-25 14:22 ` [PATCH v3] " Christopher M. Miles
2022-10-26 4:50 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2pmf8hwbq.fsf@numbchild@gmail.com \
--to=numbchild@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=yantar92@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).