From: Thierry Volpiatto <thievol@posteo.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Thierry Volpiatto <thievol@posteo.net>, 75354@debbugs.gnu.org
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 [thread overview]
Message-ID: <878qrjnrdz.fsf@posteo.net> (raw)
In-Reply-To: <86y0zl2yix.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 08 Jan 2025 16:03:34 +0200")
[-- Attachment #1.1: Type: text/plain, Size: 54 bytes --]
Find here the last patch attached.
--
Thierry
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Handle-correctly-DISPLAY-FUNCTION-arg-in-bookmark-ju.patch --]
[-- Type: text/x-diff, Size: 3740 bytes --]
From abcdef6fb004cef7dfd5c58ae8da82a80477e1c8 Mon Sep 17 00:00:00 2001
From: Thierry Volpiatto <thievol@posteo.net>
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).
---
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
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1256,33 +1256,34 @@ Useful for example to unhide text in `outline-mode'.")
(defun bookmark--jump-via (bookmark-name-or-record display-function)
"Handle BOOKMARK-NAME-OR-RECORD, then call DISPLAY-FUNCTION.
-DISPLAY-FUNCTION is called with the current buffer as argument.
+DISPLAY-FUNCTION is called with the new buffer as argument.
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."
- (bookmark-handle-bookmark bookmark-name-or-record)
- ;; Store `point' now, because `display-function' might change it.
- (let ((point (point)))
- (save-current-buffer
- (funcall display-function (current-buffer)))
- (let ((win (get-buffer-window (current-buffer) 0)))
- (if win (set-window-point win point))))
- ;; FIXME: we used to only run bookmark-after-jump-hook in
- ;; `bookmark-jump' itself, but in none of the other commands.
- (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))))
- (run-hooks 'bookmark-after-jump-hook)
- (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.
- (bookmark-show-annotation bookmark-name-or-record)))
+ (bookmark-show-annotation bookmark-name-or-record))))
;;;###autoload
--
2.34.1
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]
prev parent reply other threads:[~2025-01-10 5:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-04 16:20 bug#75354: 29.4; eww buffer is not displayed correctly when used from bookmark-jump Thierry Volpiatto
2025-01-08 7:40 ` bug#75354: (29.4; eww buffer is not displayed correctly when used from bookmark-jump ) Thierry Volpiatto
2025-01-08 13:10 ` Eli Zaretskii
2025-01-08 13:52 ` Thierry Volpiatto
2025-01-08 14:03 ` Eli Zaretskii
2025-01-08 14:47 ` Thierry Volpiatto
2025-01-10 5:56 ` Thierry Volpiatto [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878qrjnrdz.fsf@posteo.net \
--to=thievol@posteo.net \
--cc=75354@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).