bug#81467: [PATCH] Make bookmark-jump work with other-window/frame/tab-prefix

Stéphane Marks <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <CAN+1HboYTnEkkgkRgdzVW+VEjrTYrzTcHqTPfrxw9MAFzzQSLg@mail.gmail.com>
On Tue, Jul 28, 2026 at 12:36 PM Eshel Yaron <[email protected]> wrote:

> Hi,
>
> Juri Linkov <[email protected]> writes:
>
> >> What if 'display-buffer' to show another unrelated buffer
> >> is called in 'bookmark-handle-bookmark'?
> >
> > It's possible to check the buffer.  Also using the same trick
> > as in 'display-buffer-override-next-command' that temporarily
> > changes 'display-buffer-overriding-action', here is the patch
> > that does the same, but uses the added action as a way to detect
> > if 'display-buffer' was already called with the same buffer:
>
> It doesn't make much sense for bookmark--jump-via to ignore the
> DISPLAY-FUNCTION argument, no matter what the handler does, IMO.
> The contract for bookmark handlers is that someone else (the caller,
> not the handler) displays the bookmarked buffer; if the handler
> nevertheless displays the bookmarked buffer (or any other buffer),
> that's the handler's fault/responsibility.
> I don't think bookmark.el should try to circumvent it.
>
> For this specific bug report, I recommend just fixing the EWW handler.
>

For bufferlo, we have to resort to this nasty business which I think we
should try to avoid.  The advice determines if the bookmark in question is
a bufferlo bookmark and if not respects display-function, otherwise
replaces it with #'ignore.

(defun bufferlo--bookmark--jump-via-advice (oldfn bookmark-name-or-record
display-function)
  "`bookmark--jump-via' advice to nullify `display-function'.
OLDFN BOOKMARK-NAME-OR-RECORD DISPLAY-FUNCTION"
  (when-let* ((bookmark-record (bookmark-get-bookmark
bookmark-name-or-record 'noerror)))
    (if (rassoc (bookmark-type-from-full-record bookmark-record)
                bufferlo--bookmark-type-names)
        (let ((bookmark-fringe-mark nil))
          (funcall oldfn bookmark-record #'ignore))
      (funcall oldfn bookmark-record display-function))))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.