Ken Mankoff <mank...@gmail.com> writes: >> As to `org-babel-screen-test' perhaps the issue is additional newline >> added after random number. I have not tried stepping through the >> function in debugger though. > > It was not the newline. Adding string-trim to: > > (setq tmp-string (string-trim (with-temp-buffer > (insert-file-contents-literally tmpfile) > (buffer-substring (point-min) (point-max))))) > > > Still fails. Weirdly, the fix is (sleep-for 0.1) in the test. But not in this > loop: > > ;; XXX: need to find a better way to do the following > (while (not (file-readable-p tmpfile)) > (sleep-for 0.1) > ;; do something, otherwise this will be optimized away > (message "org-babel-screen: File not readable yet."))
`org-babel-temp-file' *creates* a file. So, (not (file-readable-p tmpfile)) is always nil and that while loop is always ignored. Rather than checking for `file-readable-p', you may look into modification time or the file size. > Anyway, please see attached patches. Could you follow the commit message format as described in https://orgmode.org/worg/org-contribute.html#commit-messages (In general, please read https://orgmode.org/worg/org-contribute.html and https://orgmode.org/worg/org-maintenance.html as a maintainer) -- Ihor Radchenko // yantar92, Org mode maintainer, 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>