]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix effect-free warning in ob-screen.el while loop
authorBasil L. Contovounesios <contovob@tcd.ie>
Tue, 14 Apr 2020 14:26:04 +0000 (15:26 +0100)
committerBasil L. Contovounesios <contovob@tcd.ie>
Fri, 17 Apr 2020 10:38:25 +0000 (11:38 +0100)
The warning was introduced and detected by an optimizer addition
proposed in the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-12/msg00711.html

* lisp/org/ob-screen.el (org-babel-screen-test): Avoid 'value
returned from (format "...") is unused' warning by doing something
more useful than busy string manipulation while waiting for an
asynchronous subprocess to make the temporary file readable.

lisp/org/ob-screen.el

index ad00ee070d4cfbd166faba32cdb65e97042ea318..837c18f840790c100072f33679e975493dbb4f02 100644 (file)
@@ -126,7 +126,7 @@ The terminal should shortly flicker."
     ;; XXX: need to find a better way to do the following
     (while (not (file-readable-p tmpfile))
       ;; do something, otherwise this will be optimized away
-      (format "org-babel-screen: File not readable yet."))
+      (sit-for 0.1))
     (setq tmp-string (with-temp-buffer
                        (insert-file-contents-literally tmpfile)
                        (buffer-substring (point-min) (point-max))))