Mercurial > emacs
annotate lisp/emacs-lisp/tq.el @ 71414:6328b7a0d755
(Version, mh-version): Update for release 8.0.1.
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Wed, 21 Jun 2006 05:12:13 +0000 |
parents | db4c2d467e9a |
children | e5542d6aad7f c156f6a9e7b5 |
rev | line source |
---|---|
743 | 1 ;;; tq.el --- utility to maintain a transaction queue |
2 | |
64751
5b1a238fcbb4
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
3 ;; Copyright (C) 1985, 1986, 1987, 1992, 2002, 2003, 2004, |
68648
067115a6e738
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64751
diff
changeset
|
4 ;; 2005, 2006 Free Software Foundation, Inc. |
841 | 5 |
783
59dc833c4e0c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
743
diff
changeset
|
6 ;; Author: Scott Draves <spot@cs.cmu.edu> |
39461 | 7 ;; Maintainer: FSF |
783
59dc833c4e0c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
743
diff
changeset
|
8 ;; Adapted-By: ESR |
814
38b2499cb3e9
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
783
diff
changeset
|
9 ;; Keywords: extensions |
783
59dc833c4e0c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
743
diff
changeset
|
10 |
841 | 11 ;; This file is part of GNU Emacs. |
12 | |
13 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
14 ;; it under the terms of the GNU General Public License as published by | |
15 ;; the Free Software Foundation; either version 2, or (at your option) | |
16 ;; any later version. | |
17 | |
18 ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 ;; GNU General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
14169 | 24 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64085 | 25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
26 ;; Boston, MA 02110-1301, USA. | |
841 | 27 |
28 ;;; Commentary: | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
39568
diff
changeset
|
29 |
70034
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
30 ;; This file manages receiving a stream asynchronously, parsing it |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
31 ;; into transactions, and then calling the associated handler function |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
32 ;; upon the completion of each transaction. |
743 | 33 |
39568
e67950065cf9
Change ;;; to ;; for outline-minor-mode.
Gerd Moellmann <gerd@gnu.org>
parents:
39461
diff
changeset
|
34 ;; Our basic structure is the queue/process/buffer triple. Each entry |
70034
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
35 ;; of the queue part is a list of question, regexp, closure, and |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
36 ;; function that is consed to the last element. |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
37 |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
38 ;; A transaction queue may be created by calling `tq-create'. |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
39 |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
40 ;; A request may be added to the queue by calling `tq-enqueue'. If |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
41 ;; the `delay-question' argument is non-nil, we will wait to send the |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
42 ;; question to the process until it has finished sending other input. |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
43 ;; Otherwise, once a request is enqueued, we send the given question |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
44 ;; immediately to the process. |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
45 |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
46 ;; We then buffer bytes from the process until we see the regexp that |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
47 ;; was provided in the call to `tq-enqueue'. Then we call the |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
48 ;; provided function with the closure and the collected bytes. If we |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
49 ;; have indicated that the question from the next transaction was not |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
50 ;; sent immediately, send it at this point, awaiting the response. |
743 | 51 |
783
59dc833c4e0c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
743
diff
changeset
|
52 ;;; Code: |
743 | 53 |
70034
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
54 ;;; Accessors |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
55 |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
56 ;; This part looks like (queue . (process . buffer)) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
57 (defun tq-queue (tq) (car tq)) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
58 (defun tq-process (tq) (car (cdr tq))) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
59 (defun tq-buffer (tq) (cdr (cdr tq))) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
60 |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
61 ;; The structure of `queue' is as follows |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
62 ;; ((question regexp closure . fn) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
63 ;; <other queue entries>) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
64 ;; question: string to send to the process |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
65 (defun tq-queue-head-question (tq) (car (car (tq-queue tq)))) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
66 ;; regexp: regular expression that matches the end of a response from |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
67 ;; the process |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
68 (defun tq-queue-head-regexp (tq) (car (cdr (car (tq-queue tq))))) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
69 ;; closure: additional data to pass to function |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
70 (defun tq-queue-head-closure (tq) (car (cdr (cdr (car (tq-queue tq)))))) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
71 ;; fn: function to call upon receiving a complete response from the |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
72 ;; process |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
73 (defun tq-queue-head-fn (tq) (cdr (cdr (cdr (car (tq-queue tq)))))) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
74 |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
75 ;; Determine whether queue is empty |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
76 (defun tq-queue-empty (tq) (not (tq-queue tq))) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
77 |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
78 ;;; Core functionality |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
79 |
1187
519c04d69cdc
Doc fixes. Make tq-create autoload.
Richard M. Stallman <rms@gnu.org>
parents:
841
diff
changeset
|
80 ;;;###autoload |
743 | 81 (defun tq-create (process) |
1187
519c04d69cdc
Doc fixes. Make tq-create autoload.
Richard M. Stallman <rms@gnu.org>
parents:
841
diff
changeset
|
82 "Create and return a transaction queue communicating with PROCESS. |
519c04d69cdc
Doc fixes. Make tq-create autoload.
Richard M. Stallman <rms@gnu.org>
parents:
841
diff
changeset
|
83 PROCESS should be a subprocess capable of sending and receiving |
519c04d69cdc
Doc fixes. Make tq-create autoload.
Richard M. Stallman <rms@gnu.org>
parents:
841
diff
changeset
|
84 streams of bytes. It may be a local process, or it may be connected |
519c04d69cdc
Doc fixes. Make tq-create autoload.
Richard M. Stallman <rms@gnu.org>
parents:
841
diff
changeset
|
85 to a tcp server on another machine." |
743 | 86 (let ((tq (cons nil (cons process |
87 (generate-new-buffer | |
88 (concat " tq-temp-" | |
89 (process-name process))))))) | |
90 (set-process-filter process | |
49851
fec321336b72
(tq-create): Fix quoted lambda.
Juanma Barranquero <lekktu@gmail.com>
parents:
49598
diff
changeset
|
91 `(lambda (proc string) |
52493
04f194e85b4d
(tq-create): Fix mixed up unquote style.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52401
diff
changeset
|
92 (tq-filter ',tq string))) |
743 | 93 tq)) |
94 | |
70034
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
95 (defun tq-queue-add (tq question re closure fn) |
743 | 96 (setcar tq (nconc (tq-queue tq) |
70034
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
97 (cons (cons question (cons re (cons closure fn))) nil))) |
743 | 98 'ok) |
99 | |
70034
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
100 (defun tq-queue-pop (tq) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
101 (setcar tq (cdr (car tq))) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
102 (let ((question (tq-queue-head-question tq))) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
103 (when question |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
104 (process-send-string (tq-process tq) question))) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
105 (null (car tq))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
39568
diff
changeset
|
106 |
70034
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
107 (defun tq-enqueue (tq question regexp closure fn &optional delay-question) |
1187
519c04d69cdc
Doc fixes. Make tq-create autoload.
Richard M. Stallman <rms@gnu.org>
parents:
841
diff
changeset
|
108 "Add a transaction to transaction queue TQ. |
519c04d69cdc
Doc fixes. Make tq-create autoload.
Richard M. Stallman <rms@gnu.org>
parents:
841
diff
changeset
|
109 This sends the string QUESTION to the process that TQ communicates with. |
70034
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
110 |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
111 When the corresponding answer comes back, we call FN with two |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
112 arguments: CLOSURE, which may contain additional data that FN |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
113 needs, and the answer to the question. |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
114 |
1187
519c04d69cdc
Doc fixes. Make tq-create autoload.
Richard M. Stallman <rms@gnu.org>
parents:
841
diff
changeset
|
115 REGEXP is a regular expression to match the entire answer; |
70034
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
116 that's how we tell where the answer ends. |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
117 |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
118 If DELAY-QUESTION is non-nil, delay sending this question until |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
119 the process has finished replying to any previous questions. |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
120 This produces more reliable results with some processes." |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
121 (let ((sendp (or (not delay-question) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
122 (not (tq-queue-head-question tq))))) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
123 (tq-queue-add tq (unless sendp question) regexp closure fn) |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
124 (when sendp |
db4c2d467e9a
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-220
Miles Bader <miles@gnu.org>
parents:
68648
diff
changeset
|
125 (process-send-string (tq-process tq) question)))) |
743 | 126 |
127 (defun tq-close (tq) | |
1187
519c04d69cdc
Doc fixes. Make tq-create autoload.
Richard M. Stallman <rms@gnu.org>
parents:
841
diff
changeset
|
128 "Shut down transaction queue TQ, terminating the process." |
743 | 129 (delete-process (tq-process tq)) |
130 (kill-buffer (tq-buffer tq))) | |
131 | |
132 (defun tq-filter (tq string) | |
133 "Append STRING to the TQ's buffer; then process the new data." | |
20693
b48b8060e70d
(tq-filter): Use with-current-buffer.
Richard M. Stallman <rms@gnu.org>
parents:
17216
diff
changeset
|
134 (with-current-buffer (tq-buffer tq) |
b48b8060e70d
(tq-filter): Use with-current-buffer.
Richard M. Stallman <rms@gnu.org>
parents:
17216
diff
changeset
|
135 (goto-char (point-max)) |
b48b8060e70d
(tq-filter): Use with-current-buffer.
Richard M. Stallman <rms@gnu.org>
parents:
17216
diff
changeset
|
136 (insert string) |
b48b8060e70d
(tq-filter): Use with-current-buffer.
Richard M. Stallman <rms@gnu.org>
parents:
17216
diff
changeset
|
137 (tq-process-buffer tq))) |
743 | 138 |
139 (defun tq-process-buffer (tq) | |
140 "Check TQ's buffer for the regexp at the head of the queue." | |
141 (set-buffer (tq-buffer tq)) | |
142 (if (= 0 (buffer-size)) () | |
143 (if (tq-queue-empty tq) | |
144 (let ((buf (generate-new-buffer "*spurious*"))) | |
145 (copy-to-buffer buf (point-min) (point-max)) | |
146 (delete-region (point-min) (point)) | |
147 (pop-to-buffer buf nil) | |
14430
408eeedc18cd
(tq-process-buffer): Fix error format string.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
148 (error "Spurious communication from process %s, see buffer %s" |
408eeedc18cd
(tq-process-buffer): Fix error format string.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
149 (process-name (tq-process tq)) |
408eeedc18cd
(tq-process-buffer): Fix error format string.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
150 (buffer-name buf))) |
743 | 151 (goto-char (point-min)) |
152 (if (re-search-forward (tq-queue-head-regexp tq) nil t) | |
153 (let ((answer (buffer-substring (point-min) (point)))) | |
154 (delete-region (point-min) (point)) | |
17216
ef3033d89075
(tq-process-buffer): Catch errors running tq-queue-head-fn.
Richard M. Stallman <rms@gnu.org>
parents:
16235
diff
changeset
|
155 (unwind-protect |
ef3033d89075
(tq-process-buffer): Catch errors running tq-queue-head-fn.
Richard M. Stallman <rms@gnu.org>
parents:
16235
diff
changeset
|
156 (condition-case nil |
ef3033d89075
(tq-process-buffer): Catch errors running tq-queue-head-fn.
Richard M. Stallman <rms@gnu.org>
parents:
16235
diff
changeset
|
157 (funcall (tq-queue-head-fn tq) |
ef3033d89075
(tq-process-buffer): Catch errors running tq-queue-head-fn.
Richard M. Stallman <rms@gnu.org>
parents:
16235
diff
changeset
|
158 (tq-queue-head-closure tq) |
ef3033d89075
(tq-process-buffer): Catch errors running tq-queue-head-fn.
Richard M. Stallman <rms@gnu.org>
parents:
16235
diff
changeset
|
159 answer) |
ef3033d89075
(tq-process-buffer): Catch errors running tq-queue-head-fn.
Richard M. Stallman <rms@gnu.org>
parents:
16235
diff
changeset
|
160 (error nil)) |
ef3033d89075
(tq-process-buffer): Catch errors running tq-queue-head-fn.
Richard M. Stallman <rms@gnu.org>
parents:
16235
diff
changeset
|
161 (tq-queue-pop tq)) |
743 | 162 (tq-process-buffer tq)))))) |
163 | |
841 | 164 (provide 'tq) |
165 | |
52401 | 166 ;;; arch-tag: 65dea08c-4edd-4cde-83a5-e8a15b993b79 |
743 | 167 ;;; tq.el ends here |