From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#75354: (29.4; eww buffer is not displayed correctly when used from bookmark-jump ) Date: Fri, 10 Jan 2025 05:56:40 +0000 Message-ID: <878qrjnrdz.fsf@posteo.net> References: <87zfk6eekc.fsf@posteo.net> <87h669vjm9.fsf@posteo.net> <8634ht4fkd.fsf@gnu.org> <87sept5s67.fsf@posteo.net> <86y0zl2yix.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32927"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Thierry Volpiatto , 75354@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 10 06:51:22 2025 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 1tW7vV-0008NE-OG for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Jan 2025 06:51:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tW7vE-0005oU-GJ; Fri, 10 Jan 2025 00:51:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tW7vC-0005o0-Th for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2025 00:51:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tW7vB-0005sR-W7 for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2025 00:51:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=g0sM9eyyb1EXjkxbVEYllYYJFVl+hp33y5CqMRUmoRw=; b=fUOx4AT7U6xKeqk3RXv3zTkXMrmUwKgL6Hk8jPdKy2SZhxltAVjUjG64JrEFzKchUBnp9QGUaCvoYjR2t8OORYd0M/1++BU/RjHbFQ4kVXbDX9WSZXoDwSu2TD6yWsf4ggo9v4Ok/PjK2nCU6iIB2Gfo4TzZuyr28wXAsmzUH4yLvjPoQCiDBbOH44ZrOjaiSWNxGJj3zYrxbQlDDLkKTHSraXKHrMQe6xcfM9OZHHwQiZHGlWUbF/7g0H/3ycJAuVL47QIGqr0xPlo9kx26pQciB6nPjApS381l5vS+BuY6Ji5OnQdE2Eb7tTqrMnzaaQ9PTwdIMreK8dCBsl+MOA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tW7vB-0005Dp-L6 for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2025 00:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Jan 2025 05:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75354 X-GNU-PR-Package: emacs Original-Received: via spool by 75354-submit@debbugs.gnu.org id=B75354.173648823320037 (code B ref 75354); Fri, 10 Jan 2025 05:51:01 +0000 Original-Received: (at 75354) by debbugs.gnu.org; 10 Jan 2025 05:50:33 +0000 Original-Received: from localhost ([127.0.0.1]:56129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tW7ui-0005D6-Ek for submit@debbugs.gnu.org; Fri, 10 Jan 2025 00:50:32 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:59315) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tW7uf-0005Cq-Vm for 75354@debbugs.gnu.org; Fri, 10 Jan 2025 00:50:31 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id BC8F8240101 for <75354@debbugs.gnu.org>; Fri, 10 Jan 2025 06:50:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1736488223; bh=4lBEOD3aJkyzE/ej8a7TtnZXBmysgiN/F0luLs9r/D0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=FeeakRKUIy04nFqR+7vQFBRxb/5waI50VtkXx0CnRgOOISm2vAYsV9NAd9Eh9M3n+ I0QGgwzDBp0PWQLH4y85qUcThqbPJQlqMcYN7BHr71j8oSLpSMsXu3Q0S26LxatjtE RrnFAS4hoUNhFL1PAv8vg6bkVg/jepxukE5dwYZ/RNJw+EBXnLmNiw2sTowyj/s9uL 3CdCTzAxQbFV0YP1d3Lh1oT1GITLiY5lLTLE6MWlKJIttDaB1ysRRkOJYd/NgUja60 iVDfnAfN/9961wLNujii2p0beM3todFAj6AnakFISXCC0LGFdE+Fbv+A7etSg9ZTCj geqFz1lk+5ebA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YTrNF3NvFz6tw5; Fri, 10 Jan 2025 06:50:21 +0100 (CET) In-Reply-To: <86y0zl2yix.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 08 Jan 2025 16:03:34 +0200") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298865 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Find here the last patch attached. =2D-=20 Thierry --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Handle-correctly-DISPLAY-FUNCTION-arg-in-bookmark-ju.patch Content-Transfer-Encoding: quoted-printable From=20abcdef6fb004cef7dfd5c58ae8da82a80477e1c8 Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Wed, 8 Jan 2025 10:45:55 +0100 Subject: [PATCH] Handle correctly DISPLAY-FUNCTION arg in bookmark--jump-via * lisp/bookmark.el (bookmark--jump-via): Fix it. This fix bug #75354 where when jumping to a eww bmk to other window (or frame) the buffer is displayed both in other window and current window. Previously bookmark--jump-via was calling DISPLAY-FUNCTION on the current-buffer from the new buffer created by bookmark handler (e.g. eww) now DISPLAY-FUNCTION is called on the new buffer from the current buffer (winconf is saved when calling handler). In addition to make eww bookmarks displayed properly, this fix as well w3m bookmarks and as a side effect fix the eww quit function which restore properly winconf after quitting (previously leaving two windows open). =2D-- lisp/bookmark.el | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 0048330e790..215377635f7 100644 =2D-- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1256,33 +1256,34 @@ Useful for example to unhide text in `outline-mode'= .") =20 (defun bookmark--jump-via (bookmark-name-or-record display-function) "Handle BOOKMARK-NAME-OR-RECORD, then call DISPLAY-FUNCTION. =2DDISPLAY-FUNCTION is called with the current buffer as argument. +DISPLAY-FUNCTION is called with the new buffer as argument. =20 After calling DISPLAY-FUNCTION, set window point to the point specified by BOOKMARK-NAME-OR-RECORD, if necessary, run `bookmark-after-jump-hook', and then show any annotations for this bookmark." =2D (bookmark-handle-bookmark bookmark-name-or-record) =2D ;; Store `point' now, because `display-function' might change it. =2D (let ((point (point))) =2D (save-current-buffer =2D (funcall display-function (current-buffer))) =2D (let ((win (get-buffer-window (current-buffer) 0))) =2D (if win (set-window-point win point)))) =2D ;; FIXME: we used to only run bookmark-after-jump-hook in =2D ;; `bookmark-jump' itself, but in none of the other commands. =2D (when bookmark-fringe-mark =2D (let ((overlays (overlays-in (pos-bol) (1+ (pos-bol)))) =2D temp found) =2D (while (and (not found) (setq temp (pop overlays))) =2D (when (eq 'bookmark (overlay-get temp 'category)) =2D (setq found t))) =2D (unless found =2D (bookmark--set-fringe-mark)))) =2D (run-hooks 'bookmark-after-jump-hook) =2D (if bookmark-automatically-show-annotations + (let (buf point) + (save-window-excursion + (bookmark-handle-bookmark bookmark-name-or-record) + (setq buf (current-buffer) + point (point))) + (funcall display-function buf) + (when-let* ((win (get-buffer-window buf 0))) + (set-window-point win point)) + (when bookmark-fringe-mark + (let ((overlays (overlays-in (pos-bol) (1+ (pos-bol)))) + temp found) + (while (and (not found) (setq temp (pop overlays))) + (when (eq 'bookmark (overlay-get temp 'category)) + (setq found t))) + (unless found + (bookmark--set-fringe-mark)))) + ;; FIXME: we used to only run bookmark-after-jump-hook in + ;; `bookmark-jump' itself, but in none of the other commands. + (run-hooks 'bookmark-after-jump-hook) + (when bookmark-automatically-show-annotations ;; if there is an annotation for this bookmark, ;; show it in a buffer. =2D (bookmark-show-annotation bookmark-name-or-record))) + (bookmark-show-annotation bookmark-name-or-record)))) =20 =20 ;;;###autoload =2D-=20 2.34.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmeAtpgTHHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvk9w/C/wNIfF9CgBjuNSL2IRThDMxy2Hno//0 H4Sl1THHVDoZOqCj3rrJGOGDhPHfhZcycsf1aHOZ8jCvgQERBqch5fsz9n7uLVgU fEJDkRYCtmEIVhvUTDOXsZnYvNSES16Y5vUwdMV+Ias6mM2jL7mucW/0GTnuB2M1 fYdKd18mwAwsuho3sKpKCRQHYWUHlmoXVCqAqUUBlYLc5Wpg3Q1VqBUZISNGPKvF YEh0BuO2+mdoll7DM4Kb3lB5EWYSLYKIo9/3JZ4V7itHdX/H4/gsNUSPz7KUuTV3 FwTVGpmiqNYcJV9lH0f15ZLFlVSRz9qewN8W/WaN9AbPh7qbFSeuFbly9p0j+1SP 4YdZH8biKDZtndBe4b6trYnu8uFegwG54QDZt1AgBNGNQYJTQy8RgqiOSmAjkSbk cl5Nkn/WStqUdIcabq7JM06zp/DGv+c8JkJydl7lfd3IKBgrjQcbDYneDP9vJwGD fw+sR/To2PiZQz2UX90YZrFgMZL+lWSppOg= =Xu87 -----END PGP SIGNATURE----- --==-=-=--