Function: tq-enqueue

tq-enqueue is a byte-compiled function defined in tq.el.gz.

Signature

(tq-enqueue TQ QUESTION REGEXP CLOSURE FN &optional DELAY-QUESTION)

Documentation

Add a transaction to transaction queue TQ.

This sends the string QUESTION to the process that TQ communicates with.

When the corresponding answer comes back, we call FN with two arguments: CLOSURE, which may contain additional data that FN needs, and the answer to the question.

REGEXP is a regular expression to match the entire answer; that's how we tell where the answer ends.

If DELAY-QUESTION is non-nil, delay sending this question until the process has finished replying to any previous questions. This produces more reliable results with some processes.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/tq.el.gz
(defun tq-enqueue (tq question regexp closure fn &optional delay-question)
  "Add a transaction to transaction queue TQ.
This sends the string QUESTION to the process that TQ communicates with.

When the corresponding answer comes back, we call FN with two
arguments: CLOSURE, which may contain additional data that FN
needs, and the answer to the question.

REGEXP is a regular expression to match the entire answer;
that's how we tell where the answer ends.

If DELAY-QUESTION is non-nil, delay sending this question until
the process has finished replying to any previous questions.
This produces more reliable results with some processes."
  (let ((sendp (or (not delay-question)
		   (not (tq-queue tq)))))
    (tq-queue-add tq (unless sendp question) regexp closure fn)
    (when sendp
      (process-send-string (tq-process tq) question))))