emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
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-v3] New: auto display inline images under subtree when `org-cycle'.
Date: Sat, 01 Oct 2022 17:51:52 +0800	[thread overview]
Message-ID: <m2k05jyif4.fsf@numbchild@gmail.com> (raw)
In-Reply-To: <87bkqw2pzc.fsf@localhost>


[-- Attachment #1.1: Type: text/plain, Size: 28 bytes --]


I attached the new patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-org.el-Support-auto-display-inline-images-when-cycli.patch --]
[-- Type: text/x-patch, Size: 20036 bytes --]

From 67a00b91f53412435a5fd29406cf583a85f2de6d Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Wed, 28 Sep 2022 20:46:52 +0800
Subject: [PATCH] org.el: Support auto display inline images when cycling

* lisp/org.el (org-toggle-inline-images): Support region.
(org-display-inline-images): Fix refresh argument logic.
(org-remove-inline-images): Support region.

* lisp/org-keys.el (org-toggle-inline-images): Update arguments.

* lisp/org-cycle.el (org-cycle-inline-images-display): Add new option to
control whether auto display inline images when cycling.
(org-cycle-display-inline-images): Add new hook function to auto display
inline images when cycling.
(org-cycle-hook): Add `org-cycle-display-inline-images' into cycling
hook by default.

* testing/lisp/test-org-fold.el (test-org-fold/org-fold-display-inline-images):
Add test for inline image displaying when cycling.
---
 etc/ORG-NEWS                                  |   4 ++
 lisp/org-cycle.el                             |  38 +++++++++++++-
 lisp/org-keys.el                              |   2 +-
 lisp/org.el                                   |  21 +++++---
 .../images/Org mode logo mono-color.png       | Bin 0 -> 7523 bytes
 testing/lisp/test-org-fold.el                 |  49 ++++++++++++++++++
 6 files changed, 103 insertions(+), 11 deletions(-)
 create mode 100755 testing/examples/images/Org mode logo mono-color.png

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index cab64317f..ec2764b3b 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -307,6 +307,10 @@ to pass the contents of a named code block as a string argument.
 The new property =ORG-IMAGE-ACTUAL-WIDTH= can override the global
 variable ~org-image-actual-width~ value for inline images display width.
 
+*** New ~org-cycle-hook~ function ~org-cycle-display-inline-images~ for auto displaying subtree inline images
+
+This behavior is toggled by custom option ~org-cycle-inline-images-display~.
+
 *** New ~org-babel-tangle-finished-hook~ hook run at the very end of ~org-babel-tangle~
 
 This provides a proper counterpart to ~org-babel-pre-tangle-hook~, as
diff --git a/lisp/org-cycle.el b/lisp/org-cycle.el
index 656ca83f2..212d25a44 100644
--- a/lisp/org-cycle.el
+++ b/lisp/org-cycle.el
@@ -208,8 +208,9 @@ the values `folded', `children', or `subtree'."
   :type 'hook)
 
 (defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees
-		   org-cycle-show-empty-lines
-		   org-cycle-optimize-window-after-visibility-change)
+                            org-cycle-show-empty-lines
+                            org-cycle-optimize-window-after-visibility-change
+                            org-cycle-display-inline-images)
   "Hook that is run after `org-cycle' has changed the buffer visibility.
 The function(s) in this hook must accept a single argument which indicates
 the new state that was set by the most recent `org-cycle' command.  The
@@ -229,6 +230,13 @@ normal outline commands like `show-all', but not with the cycling commands."
   :group 'org-cycle
   :type 'boolean)
 
+(defcustom org-cycle-inline-images-display nil
+  "Non-nil means auto display inline images under subtree when cycling."
+  :group 'org-startup
+  :group 'org-cycle
+  :package-version '(Org . "9.6")
+  :type 'boolean)
+
 (defvar org-cycle-tab-first-hook nil
   "Hook for functions to attach themselves to TAB.
 See `org-ctrl-c-ctrl-c-hook' for more information.
@@ -776,6 +784,32 @@ STATE should be one of the symbols listed in the docstring of
 		       "Subtree is archived and stays closed.  Use \
 `\\[org-cycle-force-archived]' to cycle it anyway."))))))
 
+(defun org-cycle-display-inline-images (state)
+  "Auto display inline images under subtree when cycling.
+It works when `org-cycle-inline-images-display' is non-nil."
+  (when org-cycle-inline-images-display
+    (pcase state
+      ('children
+       (org-with-wide-buffer
+        (org-narrow-to-subtree)
+        ;; If has nested headlines, beg,end only from parent headline
+        ;; to first child headline which reference to upper
+        ;; let-binding `org-next-visible-heading'.
+        (org-display-inline-images
+         nil nil
+         (point-min) (progn (org-next-visible-heading 1) (point)))))
+      ('subtree
+       (org-with-wide-buffer
+        (org-narrow-to-subtree)
+        ;; If has nested headlines, also inline display images under all sub-headlines.
+        (org-display-inline-images nil nil (point-min) (point-max))))
+      ('folded
+       (org-with-wide-buffer
+        (org-narrow-to-subtree)
+        (if (numberp (point-max))
+            (org-remove-inline-images (point-min) (point-max))
+          (ignore)))))))
+
 (provide 'org-cycle)
 
 ;;; org-cycle.el ends here
diff --git a/lisp/org-keys.el b/lisp/org-keys.el
index d65379a72..79e34cbd1 100644
--- a/lisp/org-keys.el
+++ b/lisp/org-keys.el
@@ -204,7 +204,7 @@
 (declare-function org-toggle-radio-button "org" (&optional arg))
 (declare-function org-toggle-comment "org" ())
 (declare-function org-toggle-fixed-width "org" ())
-(declare-function org-toggle-inline-images "org" (&optional include-linked))
+(declare-function org-toggle-inline-images "org" (&optional include-linked beg end))
 (declare-function org-latex-preview "org" (&optional arg))
 (declare-function org-toggle-narrow-to-subtree "org" ())
 (declare-function org-toggle-ordered-property "org" ())
diff --git a/lisp/org.el b/lisp/org.el
index 036384a04..36db62f0c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16071,16 +16071,16 @@ SNIPPETS-P indicates if this is run to create snippet images for HTML."
 
 (defvar-local org-inline-image-overlays nil)
 
-(defun org-toggle-inline-images (&optional include-linked)
+(defun org-toggle-inline-images (&optional include-linked beg end)
   "Toggle the display of inline images.
 INCLUDE-LINKED is passed to `org-display-inline-images'."
   (interactive "P")
   (if org-inline-image-overlays
       (progn
-	(org-remove-inline-images)
+	(org-remove-inline-images beg end)
 	(when (called-interactively-p 'interactive)
 	  (message "Inline image display turned off")))
-    (org-display-inline-images include-linked)
+    (org-display-inline-images include-linked nil beg end)
     (when (called-interactively-p 'interactive)
       (message (if org-inline-image-overlays
 		   (format "%d images displayed inline"
@@ -16170,8 +16170,8 @@ BEG and END define the considered part.  They default to the
 buffer boundaries with possible narrowing."
   (interactive "P")
   (when (display-graphic-p)
-    (unless refresh
-      (org-remove-inline-images)
+    (when refresh
+      (org-remove-inline-images beg end)
       (when (fboundp 'clear-image-cache) (clear-image-cache)))
     (let ((end (or end (point-max))))
       (org-with-point-at (or beg (point-min))
@@ -16322,11 +16322,16 @@ buffer boundaries with possible narrowing."
       (delete ov org-inline-image-overlays)
       (delete-overlay ov))))
 
-(defun org-remove-inline-images ()
+(defun org-remove-inline-images (&optional beg end)
   "Remove inline display of images."
   (interactive)
-  (mapc #'delete-overlay org-inline-image-overlays)
-  (setq org-inline-image-overlays nil))
+  (let* ((beg (or beg (point-min)))
+         (end (or end (point-max)))
+         (overlays (overlays-in beg end)))
+    (dolist (ov overlays)
+      (when (memq ov org-inline-image-overlays)
+        (setq org-inline-image-overlays (delq ov org-inline-image-overlays))
+        (delete-overlay ov)))))
 
 (defvar org-self-insert-command-undo-counter 0)
 (defvar org-speed-command nil)
diff --git a/testing/examples/images/Org mode logo mono-color.png b/testing/examples/images/Org mode logo mono-color.png
new file mode 100755
index 0000000000000000000000000000000000000000..9ac57e6a205257fd2fd21944a025190aa2f2db49
GIT binary patch
literal 7523
zcmV-p9h~BcP)<h;3K|Lk000e1NJLTq004gg004vt1^@s6x#;xC00006VoOIv0RI60
z0RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_000McNliru-UA2#E(`i0Rb&7F9Pmj*
zK~#9!?VWjaT=kXbKli;_RoZ1Owk*pVHjC|GjNP%p32}xH2%(42B+ewHGb90QPSV}U
z%sF&2Jvr$~LiY^WSiGFj-AU-4^d#wS2nkDo1h82pFkXQeTaslhmMmFYsn+*?^T+R3
zk}OMhl`WNItL{04QK?k#_ulvZ?tbqNa+ISS<tRrv%2AGTl%pJ7m?XJJFt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>kk#{;_ig1$ba)MKe!@-%<cC0R2kMy!)TAJKsqp
tQiFeup{K}Ej&hWv9OWoSIl2(({{sZ59n%b9$Nm5S002ovPDHLkV1oBJp5p)j

literal 0
HcmV?d00001

diff --git a/testing/lisp/test-org-fold.el b/testing/lisp/test-org-fold.el
index 0fa800dee..ffcfde56b 100644
--- a/testing/lisp/test-org-fold.el
+++ b/testing/lisp/test-org-fold.el
@@ -604,6 +604,55 @@ Unfolded Paragraph.
             (org-fold-check-before-invisible-edit kind)
             (should (org-invisible-p (1- (point))))))))))
 
+(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-next-link)
+      (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-next-link)
+      (org-next-link)
+      (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-cycle)
+    ;;       (org-cycle)
+    ;;       (org-cycle)
+    ;;       ;; TODO: how to detect inline image overlays are deleted after folded?
+    ;;       )
+    ))
+
 (provide 'test-org-fold)
 
 ;;; test-org-fold.el ends here
-- 
2.37.2


[-- Attachment #1.3: Type: text/plain, Size: 21071 bytes --]


Ihor Radchenko <yantar92@gmail.com> writes:

> "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.
>

Done

>> +      ('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.
>

Done

>> +;;; 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?
>

Removed, Done

>> +        (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
>

Added image file and link now.

>> +    ;; `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.

I commented out the third test if someone can do this. I don't now how to test in fold state.

==================================================================================================

Because I got error when running command "make test". I checked org-mode
source code repo, the ob-vala.el is removed, don't know where it is
introduced.

#+begin_example
~/Code/Emacs/org-mode:subtree-display-inline-images λ make test 
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C doc clean;  /Applications/Xcode.app/Contents/Developer/usr/bin/make -C lisp clean;
rm -f *.pdf *.html *.info *_letter.tex org-version.inc org-version.tex \
	      *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs *.toc \
              *.tp *.tps *.vr *.vrs *.log *.ps
rm -f org-version.el org-loaddefs.el org-version.elc org-loaddefs.elc org-install.elc
rm -f *.elc
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C lisp compile
rm -f org-version.el org-loaddefs.el org-version.elc org-loaddefs.elc org-install.elc
org-version: 9.6-pre (release_9.5.5-845-g67a00b)
Loading /Users/stardiviner/Code/Emacs/org-mode/lisp/org-compat.el (source)...
Loading /Users/stardiviner/Code/Emacs/org-mode/mk/org-fixup.el (source)...
org-loaddefs: 9.6-pre (release_9.5.5-845-g67a00b)
Loading /Users/stardiviner/Code/Emacs/org-mode/lisp/org-compat.el (source)...
Loading /Users/stardiviner/Code/Emacs/org-mode/mk/org-fixup.el (source)...
/Applications/Xcode.app/Contents/Developer/usr/bin/make compile-dirall
==================== dirall ====================
Checking /Users/stardiviner/Code/Emacs/org-mode/lisp...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-C.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-R.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-awk.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-calc.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-clojure.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-comint.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-core.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-css.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-ditaa.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-dot.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-emacs-lisp.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-eshell.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-eval.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-exp.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-forth.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-fortran.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-gnuplot.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-groovy.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-haskell.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-java.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-js.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-julia.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-latex.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-lilypond.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-lisp.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-lob.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-lua.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-makefile.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-matlab.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-maxima.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-ocaml.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-octave.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-org.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-perl.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-plantuml.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-processing.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-python.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-ref.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-ruby.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-sass.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-scheme.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-screen.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-sed.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-shell.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-sql.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-sqlite.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-table.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob-tangle.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ob.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/oc-basic.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/oc-biblatex.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/oc-bibtex.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/oc-csl.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/oc-natbib.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/oc.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-bbdb.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-bibtex.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-docview.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-doi.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-eshell.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-eww.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-gnus.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-info.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-irc.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-man.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-mhe.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-rmail.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol-w3m.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ol.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-agenda.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-archive.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-attach-git.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-attach.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-capture.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-clock.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-colview.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-compat.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-crypt.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-ctags.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-cycle.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-datetree.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-duration.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-element.el...

In org-element--cache-active-p:
org-element.el:5682:11: Warning: defsubst `org-element--cache-active-p' was used before it was defined
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-entities.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-faces.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-feed.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-fold-core.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-fold.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-footnote.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-goto.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-habit.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-id.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-indent.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-inlinetask.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-keys.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-lint.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-list.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-loaddefs.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-macro.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-macs.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-mobile.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-mouse.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-num.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-pcomplete.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-persist.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-plot.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-protocol.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-refile.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-src.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-table.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-tempo.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-timer.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org-version.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/org.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox-ascii.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox-beamer.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox-html.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox-icalendar.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox-koma-letter.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox-latex.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox-man.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox-md.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox-odt.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox-org.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox-publish.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox-texinfo.el...
Compiling /Users/stardiviner/Code/Emacs/org-mode/lisp/ox.el...
Done (Total of 125 files compiled, 2 skipped)
install -m 755 -d /var/folders/ym/f3v5_yk1279g5ls70x3hzblh0000gn/T//tmp-orgtest
TMPDIR=/var/folders/ym/f3v5_yk1279g5ls70x3hzblh0000gn/T//tmp-orgtest emacs  -Q -batch --eval '(setq vc-handled-backends nil org-startup-folded nil)'  --eval '(add-to-list '"'"'load-path (concat default-directory "lisp"))' --eval '(add-to-list '"'"'load-path (concat default-directory "testing"))'  -l org-batch-test-init --eval '(setq org-batch-test t org-babel-load-languages (quote ( (awk . t)  (C . t)  (fortran . t)  (maxima . t)  (lilypond . t)  (octave . t)  (perl . t)  (python . t)  (vala . t)  (emacs-lisp . t)  (shell . t)  (org . t))) org-test-select-re "\\(org\\|ob\\)" )' -l org-loaddefs.el -l cl -l testing/org-test.el -l ert -l org -l ox  --eval '(org-test-run-batch-tests org-test-select-re)'
Package cl is deprecated

Error: file-missing ("Cannot open load file" "No such file or directory" "ob-vala")
  mapbacktrace(#f(compiled-function (evald func args flags) #<bytecode -0xc87083326512f81>))
  debug-early-backtrace()
  debug-early(error (file-missing "Cannot open load file" "No such file or directory" "ob-vala"))
  require(ob-vala)
  org-babel-do-load-languages(org-babel-load-languages ((awk . t) (C . t) (fortran . t) (maxima . t) (lilypond . t) (octave . t) (perl . t) (python . t) (vala . t) (emacs-lisp . t) (shell . t) (org . t)))
  custom-initialize-reset(org-babel-load-languages (funcall #'#f(compiled-function () #<bytecode 0x1dc00016fe914>)))
  custom-declare-variable(org-babel-load-languages (funcall #'#f(compiled-function () #<bytecode 0x1dc00016fe914>)) "Languages which can be evaluated in Org buffers.\n\\<org-mode-map>\nThis list can be used to load support for any of the available\nlanguages with babel support (see info node `(org) Languages').  Each\nlanguage will depend on a different set of system executables and/or\nEmacs modes.\n\nWhen a language is \"loaded\", code blocks in that language can\nbe evaluated with `org-babel-execute-src-block', which is bound\nby default to \\[org-ctrl-c-ctrl-c].\n\nThe `org-babel-no-eval-on-ctrl-c-ctrl-c' option can be set to\nremove code block evaluation from \\[org-ctrl-c-ctrl-c].  By\ndefault, only Emacs Lisp is loaded, since it has no specific\nrequirement." :group org-babel :set org-babel-do-load-languages :version "24.1" :type (alist :tag "Babel Languages" :key-type (choice (const :tag "Awk" awk) (const :tag "C" C) (const :tag "R" R) (const :tag "Calc" calc) (const :tag "Clojure" clojure) (const :tag "CSS" css) (const :tag "Ditaa" ditaa) (const :tag "Dot" dot) (const :tag "Emacs Lisp" emacs-lisp) (const :tag "Forth" forth) (const :tag "Fortran" fortran) (const :tag "Gnuplot" gnuplot) (const :tag "Haskell" haskell) (const :tag "Java" java) (const :tag "Javascript" js) (const :tag "LaTeX" latex) (const :tag "Lilypond" lilypond) (const :tag "Lisp" lisp) (const :tag "Makefile" makefile) (const :tag "Maxima" maxima) (const :tag "Matlab" matlab) (const :tag "Ocaml" ocaml) (const :tag "Octave" octave) (const :tag "Org" org) (const :tag "Perl" perl) (const :tag "Pico Lisp" picolisp) (const :tag "PlantUML" plantuml) (const :tag "Python" python) (const :tag "Ruby" ruby) (const :tag "Sass" sass) (const :tag "Scala" scala) (const :tag "Scheme" scheme) (const :tag "Screen" screen) (const :tag "Shell Script" shell) (const :tag "Sql" sql) (const :tag "Sqlite" sqlite) (const :tag "Stan" stan)) :value-type (boolean :tag "Activate" :value t)))
  byte-code("\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315&\13\210\300\316\302\303\317DD\320\314\321\312\313\306\322&\11\210\323\324\325\"\210\323\326\325\"\207" [custom-declare-variable org-babel-load-languages funcall function #f(compiled-function () #<bytecode 0x1dc00016fe914>) "Languages which can be evaluated in Org buffers.\n\\<org-mode-map>\nThis list can be used to load support for any of the available\nlanguages with babel support (see info node `(org) Languages').  Each\nlanguage will depend on a different set of system executables and/or\nEmacs modes.\n\nWhen a language is \"loaded\", code blocks in that language can\nbe evaluated with `org-babel-execute-src-block', which is bound\nby default to \\[org-ctrl-c-ctrl-c].\n\nThe `org-babel-no-eval-on-ctrl-c-ctrl-c' option can be set to\nremove code block evaluation from \\[org-ctrl-c-ctrl-c].  By\ndefault, only Emacs Lisp is loaded, since it has no specific\nrequirement." :group org-babel :set org-babel-do-load-languages :version "24.1" :type (alist :tag "Babel Languages" :key-type (choice (const :tag "Awk" awk) (const :tag "C" C) (const :tag "R" R) (const :tag "Calc" calc) (const :tag "Clojure" clojure) (const :tag "CSS" css) (const :tag "Ditaa" ditaa) (const :tag "Dot" dot) (const :tag "Emacs Lisp" emacs-lisp) (const :tag "Forth" forth) (const :tag "Fortran" fortran) (const :tag "Gnuplot" gnuplot) (const :tag "Haskell" haskell) (const :tag "Java" java) (const :tag "Javascript" js) (const :tag "LaTeX" latex) (const :tag "Lilypond" lilypond) (const :tag "Lisp" lisp) (const :tag "Makefile" makefile) (const :tag "Maxima" maxima) (const :tag "Matlab" matlab) (const :tag "Ocaml" ocaml) (const :tag "Octave" octave) (const :tag "Org" org) (const :tag "Perl" perl) (const :tag "Pico Lisp" picolisp) (const :tag "PlantUML" plantuml) (const :tag "Python" python) (const :tag "Ruby" ruby) (const :tag "Sass" sass) (const :tag "Scala" scala) (const :tag "Scheme" scheme) (const :tag "Screen" screen) (const :tag "Shell Script" shell) (const :tag "Sql" sql) (const :tag "Sqlite" sqlite) (const :tag "Stan" stan)) :value-type (boolean :tag "Activate" :value t)) org-clone-delete-id #f(compiled-function () #<bytecode 0x1dc00016fe914>) "Remove ID property of clones of a subtree.\nWhen non-nil, clones of a subtree don't inherit the ID property.\nOtherwise they inherit the ID property with a new unique\nidentifier." boolean org-id autoload org-release "org-version.el" org-git-version] 12)
  require(org)
  eval-buffer(#<buffer  *load*> nil "/Users/stardiviner/Code/Emacs/org-mode/testing/org-test.el" nil t)
  load-with-code-conversion("/Users/stardiviner/Code/Emacs/org-mode/testing/org-test.el" "/Users/stardiviner/Code/Emacs/org-mode/testing/org-test.el" nil t)
  load("/Users/stardiviner/Code/Emacs/org-mode/testing/org-test.el" nil t)
  command-line-1(("--eval" "(setq vc-handled-backends nil org-startup-folded nil)" "--eval" "(add-to-list 'load-path (concat default-directory \"lisp\"))" "--eval" "(add-to-list 'load-path (concat default-directory \"testing\"))" "-l" "org-batch-test-init" "--eval" "(setq org-batch-test t org-babel-load-languages (quote ( (awk . t)  (C . t)  (fortran . t)  (maxima . t)  (lilypond . t)  (octave . t)  (perl . t)  (python . t)  (vala . t)  (emacs-lisp . t)  (shell . t)  (org . t))) org-test-select-re \"\\\\(org\\\\|ob\\\\)\" )" "-l" "org-loaddefs.el" "-l" "cl" "-l" "testing/org-test.el" "-l" "ert" "-l" "org" "-l" "ox" "--eval" "(org-test-run-batch-tests org-test-select-re)"))
  command-line()
  normal-top-level()
Cannot open load file: No such file or directory, ob-vala
make: *** [test] Error 255
~/Code/Emacs/org-mode:subtree-display-inline-images λ 
#+end_example

==================================================================================================

So I use another method =[M-x ert-run-tests-interactively]=.

The first test is passed, but the second test failed. I got bellowing
error output. I don't know why it failed. Ihor, If you can fix this
test, please tell me. Thanks

#+begin_example
Selector: test-org-fold/org-fold-display-inline-images
Passed:  0
Failed:  1 (1 unexpected)
Skipped: 0
Total:   1/1

Started at:   2022-10-01 17:46:30+0800
Finished.
Finished at:  2022-10-01 17:46:31+0800

F

F test-org-fold/org-fold-display-inline-images
    Test inline images displaying when cycling.
    (ert-test-failed
     ((should
       (overlays-at
        (point)))
      :form
      (overlays-at 130)
      :value nil))
#+end_example

-- 

[ 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 --]

  reply	other threads:[~2022-10-01  9:59 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                                       ` Christopher M. Miles [this message]
     [not found]                                       ` <63380f57.370a0220.a9d9a.dee8SMTPIN_ADDED_BROKEN@mx.google.com>
2022-10-03  3:21                                         ` [PATCH 2-v3] " 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
     [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=m2k05jyif4.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).