From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#52856: 29.0.50; Problematic handling of webkit xwidget bookmarks Date: Tue, 28 Dec 2021 20:19:25 +0100 Message-ID: <875yr8wn9e.fsf@gmx.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22185"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: 52856@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 28 20:21:29 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n2I2K-0005bV-Mk for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Dec 2021 20:21:28 +0100 Original-Received: from localhost ([::1]:49210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2I2J-0003Dj-Nd for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Dec 2021 14:21:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2I13-0003B4-Rx for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2021 14:20:11 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2I0w-0001sl-Sl for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2021 14:20:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n2I0w-000077-K2 for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2021 14:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Dec 2021 19:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52856 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1640719172394 (code B ref -1); Tue, 28 Dec 2021 19:20:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Dec 2021 19:19:32 +0000 Original-Received: from localhost ([127.0.0.1]:47435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2I0S-00006I-F1 for submit@debbugs.gnu.org; Tue, 28 Dec 2021 14:19:32 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:50752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2I0Q-00006B-V4 for submit@debbugs.gnu.org; Tue, 28 Dec 2021 14:19:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2I0Q-00035L-Q4 for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2021 14:19:30 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:54405) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2I0O-0001pz-Oa for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2021 14:19:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1640719166; bh=9zxSr6wBHDHmdun+UpQGc2bvCJDzF7G227hI+rSKry8=; h=X-UI-Sender-Class:From:To:Subject:Date; b=jI8iVjetl+p+Q6LoAsQkljFon4mfd51ltOLK2v1jjbKmeXRwjiN5EUh2ayGfRZi2u iidvZ9j4IvEF0csLp2N/2iyPer5pe3niaYsKLhGhRkZV1en5pYyiW51LujqGS5Y+Hz xV8NSd7ZgXf8daUOgxoHLDgo5wEtYhmOuRv22vRg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobelfs ([89.246.36.122]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N2V0H-1mIPbe3Y23-013vxp for ; Tue, 28 Dec 2021 20:19:25 +0100 X-Provags-ID: V03:K1:R2OglMxZz8KO0FIHhuKMlXK6FAfTWEzK8u4G4iQbhdn3mzx7Nvs zNZBYkJHYbgwbzMVdYmTraBR8WL9g8IJi8CD2QWSEAjUrLCbiLvFYcNQt4fAT8dy2QfZViy rrC+5lVH1QpdsXw6g04lUs1Z7dCAsX1XPczqqBPRLSlVUbw66Eq+ghJNedcbPXOS3+c9YK9 LqDcB+K4aNupjbomsdc8A== X-UI-Out-Filterresults: notjunk:1;V03:K0:Ri8QP9GRJIE=:ly3SAQTy30JX4d01uifVbC W2/0W69VG/M/0d8T9k8gq1fDPOQpYePXNVo4iMIYNXOnIzG2sNW8r4CaUfwJWGXaI98+WxpJ9 Cpql9/hHQVfg+C+Vjfed7lRA7Q93II02i+kW5dzymhaYlGpD152RZQsZKgfpGc831Ax/qQal6 q/8qNd7GzbNz6DDIc71R0jQDq+6EqrBDIagFB2QsuZQqQpdVMW9p5XkuTa29FukkjFXrQ+VlC y1y3KHq3/OgUMynGHMV3f7a6ayhTxDZtxksFc78EijDKrITAH+6DWljJ4fxszOp/7j865Gm/C mDBDTnvNbIOEAaZOlWdMCaUfyXLSEdaxgAHuaBfECFzteV3q1WJ5hLZ6BOyBnCpluFSu3M3n6 lfAMNTuGk8fUePQ/QeVKvEKZnVfNmSbZjIWN+E1OSWascVjSnBIR/lfB0+3JJM+/xDd+cqolF DJvEoLSHNLUw3rBMLOiMuT/T7ZXew/WDtGY+DbdhlUNdrSXvZg3cw1mwUtla4sWFEXConkjKf E5imKCAj9XL2KwKGMDRNhC+cfp86vODYIadodUofHfWGLEo5GZaHXyx+30OGyLhghmCdyB3zq CPBB/5CEJ4hknjp/o+hpATMpB30WREFuds6VHmtXkqqSXnAXJmhroca8fq7RkIPX426fy8x61 d0a6XORz96J+9sytGF0lUuxmXqDOFD1hKWTCnypVwHPVDb91vUuaO0EBeFFUQEaN6sb7vG1uc WM9pnV3PXVvB5NGG/F3sUtjUZ1HV7g9jxmyLh3dfkWRC/67hRIAXwgx9hFloaG9Z0iNuJaYi Received-SPF: pass client-ip=212.227.15.19; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:223274 Archived-At: --=-=-= Content-Type: text/plain 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 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Description: xwidget.el patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/xwidget.el b/lisp/xwidget.el index ce9839ebd3..eed35b7312 100644 =2D-- 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 --=-=-= Content-Type: text/plain 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 --=-=-=--