From: Po Lu Date: Wed, 17 Nov 2021 01:10:10 +0000 (+0800) Subject: Update xwidget webkit history buffer more eagerly X-Git-Tag: emacs-29.0.90~2852^2~247 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2a99138f1766c23cfdbbc86ea5c277b0fbeed7e2;p=emacs.git Update xwidget webkit history buffer more eagerly * lisp/xwidget.el (xwidget-webkit-callback): Update history buffer on each load-changed event. --- 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)