]> git.eshelyaron.com Git - emacs.git/commitdiff
Update xwidget webkit history buffer more eagerly
authorPo Lu <luangruo@yahoo.com>
Wed, 17 Nov 2021 01:10:10 +0000 (09:10 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 17 Nov 2021 01:10:10 +0000 (09:10 +0800)
* lisp/xwidget.el (xwidget-webkit-callback): Update history
buffer on each load-changed event.

lisp/xwidget.el

index c1d0cd66a932e8b8951b893d13ccca0bbdd46dcc..37cf2e5816a32c9913c2a2b55c593bbba002179d 100644 (file)
@@ -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)