comparison lisp/net/dbus.el @ 104081:4c431a52ce37

* net/dbus.el (dbus-call-method-non-blocking): Handle the case the function returns nil. (dbus-handle-event): Handle special return value :ignore. Reported by Jan Moringen <jan.moringen@uni-bielefeld.de>.
author Michael Albinus <michael.albinus@gmx.de>
date Mon, 27 Jul 2009 10:02:38 +0000
parents df3f6041e002
children 709480950021
comparison
equal deleted inserted replaced
104080:917282acffdc 104081:4c431a52ce37
182 'dbus-call-method-asynchronously 182 'dbus-call-method-asynchronously
183 bus service path interface method 183 bus service path interface method
184 'dbus-call-method-non-blocking-handler args))) 184 'dbus-call-method-non-blocking-handler args)))
185 ;; Wait until `dbus-call-method-non-blocking-handler' has put the 185 ;; Wait until `dbus-call-method-non-blocking-handler' has put the
186 ;; result into `dbus-return-values-table'. 186 ;; result into `dbus-return-values-table'.
187 (while (not (gethash key dbus-return-values-table nil)) 187 (while (eq (gethash key dbus-return-values-table :ignore) :ignore)
188 (read-event nil nil 0.1)) 188 (read-event nil nil 0.1))
189 189
190 ;; Cleanup `dbus-return-values-table'. Return the result. 190 ;; Cleanup `dbus-return-values-table'. Return the result.
191 (prog1 191 (prog1
192 (gethash key dbus-return-values-table nil) 192 (gethash key dbus-return-values-table nil)
366 ;; Apply the handler. 366 ;; Apply the handler.
367 (setq result (apply (nth 8 event) (nthcdr 9 event))) 367 (setq result (apply (nth 8 event) (nthcdr 9 event)))
368 ;; Return a message when it is a message call. 368 ;; Return a message when it is a message call.
369 (when (= dbus-message-type-method-call (nth 2 event)) 369 (when (= dbus-message-type-method-call (nth 2 event))
370 (dbus-ignore-errors 370 (dbus-ignore-errors
371 (apply 'dbus-method-return-internal 371 (if (eq result :ignore)
372 (nth 1 event) (nth 3 event) (nth 4 event) 372 (dbus-method-return-internal
373 (if (consp result) result (list result)))))) 373 (nth 1 event) (nth 3 event) (nth 4 event))
374 (apply 'dbus-method-return-internal
375 (nth 1 event) (nth 3 event) (nth 4 event)
376 (if (consp result) result (list result)))))))
374 ;; Error handling. 377 ;; Error handling.
375 (dbus-error 378 (dbus-error
376 ;; Return an error message when it is a message call. 379 ;; Return an error message when it is a message call.
377 (when (= dbus-message-type-method-call (nth 2 event)) 380 (when (= dbus-message-type-method-call (nth 2 event))
378 (dbus-ignore-errors 381 (dbus-ignore-errors