Subject: bug#52856: 29.0.50; Problematic handling of webkit xwidget bookmarks

From: Po Lu <[email-masked]>
Date: Wed, 29 Dec 2021 19:25:52 +0800

Stephen Berman <[email-masked]> writes:

> I did, but that just ensures that jumping to the bookmarked xwidget
> creates a new xwidget session -- it does not prevent the xwidget from
> being displayed both in the other window/frame and in the originally
> selected window.  My patch ensures that the bookmarked xwidget is
> displayed only in the other window/frame, which is consistent with the
> behavior of `bookmark-jump-other-window' and `bookmark-jump-other-frame'
> with other types of bookmarks (e.g. to PDFs in the pdf-tools package),
> regardless of whether a new xwidget session is created.

Okay, thanks -- some comments below:

> +		    (with-temp-buffer
> +		      (xwidget-webkit-new-session url)
> +		      (current-buffer))

Why with-temp-buffer?

xwidget-webkit-new-session creates a new buffer and switches to it,
which is not appropriate if you want to obtain a buffer containing the
new xwidget.  I suggest that you write a new function that creates the
buffer, displays the xwidget, and returns the buffer, preferably also
updating xwidget-webkit-new-session to use it as well.

> +    (switch-to-buffer curbuf)
> +    (set-buffer xwbuf)))

See above.