From 2a99138f1766c23cfdbbc86ea5c277b0fbeed7e2 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 17 Nov 2021 09:10:10 +0800 Subject: [PATCH] Update xwidget webkit history buffer more eagerly * lisp/xwidget.el (xwidget-webkit-callback): Update history buffer on each load-changed event. --- lisp/xwidget.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/xwidget.el b/lisp/xwidget.el index c1d0cd66a93..37cf2e5816a 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -393,15 +393,15 @@ XWIDGET instance, XWIDGET-EVENT-TYPE depends on the originating xwidget." (cond ((eq xwidget-event-type 'load-changed) (let ((title (xwidget-webkit-title xwidget)) (uri (xwidget-webkit-uri xwidget))) + (when-let ((buffer (get-buffer "*Xwidget WebKit History*"))) + (with-current-buffer buffer + (revert-buffer))) ;; This funciton will be called multi times, so only ;; change buffer name when the load actually completes ;; this can limit buffer-name flicker in mode-line. (when (or (string-equal (nth 3 last-input-event) "load-finished") (> (length title) 0)) - (when-let ((buffer (get-buffer "*Xwidget WebKit History*"))) - (with-current-buffer buffer - (revert-buffer))) (with-current-buffer (xwidget-buffer xwidget) (setq xwidget-webkit--title title) (force-mode-line-update) -- 2.39.2