From c9215889ccd18ba83856004a775461eedea07ad9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Jadi?= Date: Tue, 13 Aug 2013 16:04:50 +0200 Subject: [PATCH] * lisp/xwidget.el (xwidget-display): Return a useful value. * test/automated/xwidget-tests.el (xwidget-view-p): Use `xwidget-display'. --- lisp/xwidget.el | 6 ++++-- test/automated/xwidget-tests.el | 7 +++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/xwidget.el b/lisp/xwidget.el index c0d58972e14..1f0932ca7dd 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -59,12 +59,14 @@ see `make-xwidget' for types suitable for TYPE." ;; ))))) (defun xwidget-display (xwidget) - "Force xwidget to be displayed to create a xwidget_view." + "Force xwidget to be displayed to create a xwidget_view. Return +the window displaying XWIDGET." (let* ((buffer (xwidget-buffer xwidget)) (window (display-buffer buffer)) (frame (window-frame window))) (set-frame-visible frame t) - (redisplay t))) + (redisplay t) + window)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/test/automated/xwidget-tests.el b/test/automated/xwidget-tests.el index 104daa3fc0f..7beaeda000e 100644 --- a/test/automated/xwidget-tests.el +++ b/test/automated/xwidget-tests.el @@ -90,11 +90,10 @@ (with-temp-buffer (insert ?\0) (let* ((xwidget (xwidget-insert 1 type title 100 100)) - (window (display-buffer (current-buffer)))) + (window (xwidget-display xwidget))) (set-xwidget-query-on-exit-flag xwidget nil) - (set-frame-visible (window-frame window) t) - (redisplay t) - (xwidget-view-p (xwidget-view-lookup xwidget window))))) + (xwidget-view-p + (xwidget-view-lookup xwidget window))))) :env (list type title) :graphical t :emacs-args '("-T" "emacs-debug"))))) -- 2.39.2