GNU bug report logs - #52856
29.0.50; Problematic handling of webkit xwidget bookmarks

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Tue, 28 Dec 2021 19:20:02 UTC

Severity: normal

Tags: patch

Found in version 29.0.50

Done: Stephen Berman <stephen.berman <at> gmx.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#52856: closed (29.0.50; Problematic handling of webkit
 xwidget bookmarks)
Date: Fri, 31 Dec 2021 09:31:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 31 Dec 2021 10:29:57 +0100
with message-id <87bl0xazqi.fsf <at> gmx.net>
and subject line Re: bug#52856: 29.0.50; Problematic handling of webkit xwidget bookmarks
has caused the debbugs.gnu.org bug report #52856,
regarding 29.0.50; Problematic handling of webkit xwidget bookmarks
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
52856: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=52856
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stephen Berman <stephen.berman <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Problematic handling of webkit xwidget bookmarks
Date: Tue, 28 Dec 2021 20:19:25 +0100
[Message part 3 (text/plain, inline)]
If you make a bookmark to a webkit xwidget (i.e. to a URL displayed by
the xwidget) and then use `bookmark-jump-other-window' or
`bookmark-jump-other-frame' to jump to the bookmarked URL, the xwidget
is displayed in both the original window and the other window or other
frame.  Also, if you try to jump to the bookmark in an Emacs session
before loading xwidget.el, it fails with an unknown symbol error.  The
patch below fixes these issues for me.

2021-12-28  Stephen Berman  <stephen.berman <at> gmx.net>

	Fix handling of webkit xwidget bookmarks

	Make jumping to a bookmarked webkit xwidget in another window or
	another frame show the xwidget only in that window or frame.  Also
	make jumping to the bookmarked xwidget possible before explicitly
	loading xwidget.el (bug#xxxx).

	* lisp/xwidget.el (xwidget-webkit-bookmark-jump-handler): New
	autoloaded function.
	(xwidget-webkit-bookmark-make-record): Use it.

[Message part 4 (text/x-patch, inline)]
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index ce9839ebd3..eed35b7312 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -540,15 +540,26 @@ xwidget-webkit-bookmark-jump-new-session
   :type 'boolean)

 (defun xwidget-webkit-bookmark-make-record ()
-  "Create bookmark record in webkit xwidget.
-See `xwidget-webkit-bookmark-jump-new-session' for whether this
-should create a new session or not."
+  "Create a bookmark record for a webkit xwidget."
   (nconc (bookmark-make-record-default t t)
          `((page . ,(xwidget-webkit-uri (xwidget-webkit-current-session)))
-           (handler  . (lambda (bmk)
-                         (xwidget-webkit-browse-url
-                          (bookmark-prop-get bmk 'page)
-                          xwidget-webkit-bookmark-jump-new-session))))))
+           (handler . xwidget-webkit-bookmark-jump-handler))))
+
+;;;###autoload
+(defun xwidget-webkit-bookmark-jump-handler (bmk)
+  "Function for jumping to the webkit xwidget bookmarked by BMK.
+If `xwidget-webkit-bookmark-jump-new-session' is non-nil, create
+a new xwidget-webkit session, otherwise use an existing session."
+  (let* ((curbuf (current-buffer))
+	 (url (bookmark-prop-get bmk 'page))
+	 (xwbuf (if xwidget-webkit-bookmark-jump-new-session
+		    (with-temp-buffer
+		      (xwidget-webkit-new-session url)
+		      (current-buffer))
+		  (xwidget-webkit-goto-url url)
+		  (current-buffer))))
+    (switch-to-buffer curbuf)
+    (set-buffer xwbuf)))

 ;;; xwidget webkit session

[Message part 5 (text/plain, inline)]

In GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.29, cairo version 1.17.4)
 of 2021-12-23 built on strobelfs
Repository revision: 2fa7feca336dd16c57ffef072e0f0da6fffe4c5f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Linux From Scratch 10.2-rc1

Configured using:
 'configure --with-xwidgets 'CFLAGS=-Og -g3'
 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/qt5/lib/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XPM
XWIDGETS GTK3 ZLIB
[Message part 6 (message/rfc822, inline)]
From: Stephen Berman <stephen.berman <at> gmx.net>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 52856-done <at> debbugs.gnu.org
Subject: Re: bug#52856: 29.0.50; Problematic handling of webkit xwidget
 bookmarks
Date: Fri, 31 Dec 2021 10:29:57 +0100
On Fri, 31 Dec 2021 08:56:58 +0800 Po Lu <luangruo <at> yahoo.com> wrote:

> Stephen Berman <stephen.berman <at> gmx.net> writes:
>
>> How's this: "Jump to the web page bookmarked by the bookmark record
>> BOOKMARK."?
>
> Sure.
>
>> Thanks.  Here's the latest version:
>
> Thanks, LGTM.  Have you signed the copyright papers yet?

Yes, and I also have write access to the Savannah repo, so I went ahead
and pushed the change to master as commit 95ee6e8b90 and am closing the
bug.  Thanks for your feedback and advice.

Steve Berman


This bug report was last modified 3 years and 144 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.