From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#52856: 29.0.50; Problematic handling of webkit xwidget bookmarks Date: Thu, 30 Dec 2021 19:18:57 +0800 Message-ID: <87ee5unxwe.fsf@yahoo.com> References: <875yr8wn9e.fsf@gmx.net> <87ilv7ub1o.fsf@yahoo.com> <87sfubfzwt.fsf@gmx.net> <874k6rtzy7.fsf@yahoo.com> <877dbm1i1n.fsf@gmx.net> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4873"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: 52856@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 30 12:20:56 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 1n2tUN-0001An-Cu for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Dec 2021 12:20:55 +0100 Original-Received: from localhost ([::1]:52880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2tUL-00082a-Ts for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Dec 2021 06:20:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2tTb-000828-My for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 06:20:07 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39988) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2tTW-000616-Lc for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 06:20:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n2tTW-000344-DP for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 06:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Dec 2021 11:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52856 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52856-submit@debbugs.gnu.org id=B52856.164086315511706 (code B ref 52856); Thu, 30 Dec 2021 11:20:02 +0000 Original-Received: (at 52856) by debbugs.gnu.org; 30 Dec 2021 11:19:15 +0000 Original-Received: from localhost ([127.0.0.1]:51534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2tSl-00032j-4L for submit@debbugs.gnu.org; Thu, 30 Dec 2021 06:19:15 -0500 Original-Received: from sonic303-21.consmr.mail.ne1.yahoo.com ([66.163.188.147]:35337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2tSi-00032T-57 for 52856@debbugs.gnu.org; Thu, 30 Dec 2021 06:19:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1640863145; bh=uXJnAuMl2FL7TvGoK0WaYQQB7tbnfyQ2H6iHAgiwwNY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=uk+p37h/qifXZbhuMV3qKNKkRcTvmKkMHDQz7s3iwLS/ud3A5aHjAiQWAcMLkYzsvZVlSWrPJc0mK00SzlnoJQ4JVCBBsmLheESrUotsx6kfwuL/hgqC47Kha5p7jezgOWpfBjnS4zoSYHxT1vFRZttOQCD35oDxvjRwTt1ZSnAQN4t3VRRP6TnTfG8Y3DM9yZhAx7VtIvpWFGH5MBkvIxoS+1BgB6l217Bw6xXsxV0bfIQuQS+EmjR4YzUzjLsd8Nj5h4r3tedLvRQE1POhajHtbeB8Bt21xPC9RKEJmtu1TnaOxqR4aq1QhhFzqtoSjrarOPv+hQt/yvDVJ5opsw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1640863145; bh=KG2o970wg199lyoYmqcIHlrvFLN9/x6w7FhAJ0V88qz=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=VsIB7ey+04JW49LOyHuBwTlIpXM81zfJXUYMH4L264s1oNz3ajIFNnkuHHQoGX/4vbZCa3D0AzgyAZ3EtZ2LC5zoTZ9uesoYLIjZxGq9dupvTT4Iin1vDUCDWA+Konggy6sfKjGbwn0FmutONH5Z0JvzH5ZVHLAGIMdei3B0RTigynf3hJdimgzJFzHP+7c9/7ddSRVN2591UrOdr4WF1jEwv4t7PH01dT+sIjj/IyJA4PadAKIgOusA2Ikku5uSgKI6mf20gjoxg3ovcCvLXnJNatuZorF+MyYbWQCg7YaHPlgQEB7M+ecsV1kBToxecoL85pdPHVITt5YGJggpUA== X-YMail-OSG: oCf0Lo8VM1lBnu2YeWahi.6Gsq9KIzGrRFEX4DFtZdy4Dugh3sWm1q_re01mKHY S_JWH8PZe2b604BtFv9rXOQc6IK8S1390BOS0ogzbTRBSujPMUDbLtE0JN3mawHV313_B2_SLqmO R2Td1VAa04T2t4E9BQSVdzxG0cZ..Ra0JRFRnKvdnmdVeBvA2qlKcBKcRTXgxWq.PfkqLdJ4ohKA r2jZ5GlK4f6xjrPedCFyQXKxMTsdMdqChzmVh5rrVuuzJFtLMm9A1msd0svmjb0L.kXYrdvL0PuV Af2iB7Uh9hKXjYsDcruWSdwS2kylmjMajPZvQRhPPzSM5gp5tx.kfjKQCe7fVdzZj0ScFGRLQIdB U4KsmNuAa6pOMXdCJrznYoZXDw2ExzfayWWA86QEK6dcKgSu6sz1EFRYSwUgOC1pKisRJ5M2Nllw PbZ7_GCvEfNX_bHTn6_StWEIbS2TKKB1rBMz2jzY0A7q868M8MbvRBCN_F6NXMgSjWzeecB0MuqN A8.Vrgyhp7HyD.mffle8otIeflWxf8EIVH_1lomL_2KYp7pEcjwpAwYy1hbiUIoh8p25k_vlbRGO _eELDxkcbSELDdWdQns8A2has41C0ZuBhDvIqwGW.KV429FoqhB4uYYzwSyNX6iDOMoVu44N_ajd yJ4OrByBRp10hFHPSz2c6nWJyoe63kEPJ2MmWWWdyGiMFiZudK3ZlcjPjJ_GePP6m1UKBJW2BP2s AtfLW0NMShj9C6eNvqXrCFFhdEGHZcafO3XDa09BYnFyLmJPx37yh1y2wcFftTTIBFfISf9106Wk eGAfUfEmugkdU.Lq6DwBMqQiJ7s9Jy2fRfxAGzq8qV X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ne1.yahoo.com with HTTP; Thu, 30 Dec 2021 11:19:05 +0000 Original-Received: by kubenode516.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 56c3fbb7bc759970ab4189c0df576646; Thu, 30 Dec 2021 11:19:02 +0000 (UTC) In-Reply-To: <877dbm1i1n.fsf@gmx.net> (Stephen Berman's message of "Thu, 30 Dec 2021 11:52:20 +0100") X-Mailer: WebService/1.1.19551 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:223423 Archived-At: Stephen Berman writes: > Thanks for the suggestion, see the patch below. Since the previous > bookmark handler was the only user of `xwidget-webkit-browse-url''s > `new-session' parameter, I removed that, and took the opportunity to > make some other cleanups to that function, see the commit message. > While testing the refactored `xwidget-webkit-new-session' I found that > the xwidget-webkit-clone-* commands were broken because > `xwidget-webkit-current-url' returned the message instead of the URL, so > I fixed that. And I removed from the doc string of > `xwidget-webkit-bookmark-jump-new-session' the suggestion to customize > `xwidget-webkit-last-session-buffer', since, for one thing, it's not a > defcustom, but more importantly, changing it has no effect, since it > gets set by `xwidget-webkit--create-new-session-buffer' (previously by > `xwidget-webkit-new-session'), overriding any user change to its > value. Thanks, but there are a few problems with this change: > 2021-12-30 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. > Adjust xwidget.el code accordingly. Make xwidget-webkit-clone-* > commands work. (Bug#52856) > > * lisp/xwidget.el (xwidget-webkit-browse-url): Remove > `new-session' parameter, since the bookmark handler, which was its > only user, no longer calls this function. Remove superfluous > `browse-url' require from interactive spec and discard the unused > flag returned by `browse-url-interactive-arg'. Incorporate the > code of the now removed `xwidget-webkit-goto-url', since this > function was its only caller. While that might be the case in-tree, external packages and users might be using that parameter -- it should stay. > (xwidget-webkit-goto-url): Remove. The same goes for this. I think it's certain that some external code will be using this function, as the name is rather tempting. I also have some further comments below: > + (progn > + (xwidget-webkit-goto-uri (xwidget-webkit-current-session) url) > + (switch-to-buffer (xwidget-buffer (xwidget-webkit-current-session)))) Since you already define a replacement for `xwidget-webkit-new-session' below that also behaves like this, is there any reason you can't use that here instead? > +(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." I think it would be clearer to say "Jump to the page described by the bookmark record BMK." But I'm not good at writing documentation, so I won't insist. Also, `bmk' should be named `bookmark', or something else to that effect. > + "Return current xwidget webkit URL and display it in a message. > +Also place it on the `kill-ring'." I don't understand why this user command has to be called programmatically, and why it should return the URL. Can't you use `xwidget-webkit-uri' instead? And thanks for the work you've been doing. I really appreciate it.