Function: zone-call

zone-call is a byte-compiled function defined in zone.el.gz.

Signature

(zone-call PROGRAM &optional TIMEOUT)

Documentation

Call PROGRAM in a zoned way.

If PROGRAM is a function, call it, interrupting after the amount
 of time in seconds specified by optional arg TIMEOUT, or zone-timeout
 if unspecified, q.v.
PROGRAM can also be a list of elements, which are interpreted like so: If the element is a function or a list of a function and a number,
 apply zone-call recursively.

Source Code

;; Defined in /usr/src/emacs/lisp/play/zone.el.gz
(defun zone-call (program &optional timeout)
  "Call PROGRAM in a zoned way.
If PROGRAM is a function, call it, interrupting after the amount
 of time in seconds specified by optional arg TIMEOUT, or `zone-timeout'
 if unspecified, q.v.
PROGRAM can also be a list of elements, which are interpreted like so:
If the element is a function or a list of a function and a number,
 apply `zone-call' recursively."
  (cond ((functionp program)
         (with-timeout ((or timeout zone-timeout (ash 1 26)))
           (funcall program)))
        ((listp program)
         (mapcar (lambda (elem)
                   (cond ((functionp elem) (zone-call elem))
                         ((and (listp elem)
                               (functionp (car elem))
                               (numberp (cadr elem)))
                          (apply 'zone-call elem))
                         (t (error "Bad `zone-call' elem: %S" elem))))
                 program))))