Function: org-babel-screen-test

org-babel-screen-test is an interactive and byte-compiled function defined in ob-screen.el.gz.

Signature

(org-babel-screen-test)

Documentation

Test if the default setup works.

The terminal should shortly flicker.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-screen.el.gz
(defun org-babel-screen-test ()
  "Test if the default setup works.
The terminal should shortly flicker."
  (interactive)
  (let* ((random-string (format "%s" (random 99999)))
         (tmpfile (org-babel-temp-file "ob-screen-test-"))
         (body (concat "echo '" random-string "' > " tmpfile "\nexit\n"))
         tmp-string)
    (org-babel-execute:screen body org-babel-default-header-args:screen)
    ;; 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
      (message "org-babel-screen: File not readable yet."))
    (setq tmp-string (with-temp-buffer
                       (insert-file-contents-literally tmpfile)
                       (buffer-substring (point-min) (point-max))))
    (delete-file tmpfile)
    (message (concat "org-babel-screen: Setup "
                     (if (string-match random-string tmp-string)
                         "WORKS."
		       "DOESN'T work.")))))