GNU bug report logs - #74246
[PATCH] Reuse display windows in image-dired

Previous Next

Package: emacs;

Reported by: Morgan Smith <Morgan.J.Smith <at> outlook.com>

Date: Thu, 7 Nov 2024 20:25:01 UTC

Severity: normal

Tags: patch

Full log


Message #41 received at 74246 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Morgan Smith <Morgan.J.Smith <at> outlook.com>, Eli Zaretskii <eliz <at> gnu.org>,
 74246 <at> debbugs.gnu.org, stefankangas <at> gmail.com
Subject: Re: bug#74246: [PATCH] Reuse display windows in image-dired
Date: Tue, 03 Dec 2024 09:47:15 +0200
>> Please explain why 'display-buffer-last-window' wouldn't help
>> for 'image-dired'?  IIUC, 'image-dired' uses one source buffer
>> that could use the buffer-local variable to remember the last
>> window it used to display an image buffer.
>
> Hmm...  Currently 'image-dired-display-image' does
>
>   (let ((buf (get-buffer image-dired-display-image-buffer))
>         (cur-win (selected-window)))
>     (when buf
>       (kill-buffer buf))
>     (when-let ((buf (find-file-noselect file nil t)))
>       (pop-to-buffer buf)
>       (rename-buffer image-dired-display-image-buffer)
>
> so it kills that buffer and its local variables are gone.

It kills the target buffer, not the source buffer?
The idea was to set a buffer-local variable in the source buffer.

> Otherwise, you're right.  The question is now whether
>
> - 'display-buffer-use-some-window' should use the buffer-local value of
>   'display-buffer-last-window' autonomously, or
>
> - get it via a (some-window . display-buffer-last-window) alist entry.
>
> And obviously whether 'display-buffer' should set the value of
> 'display-buffer-last-window' itself or leave that to the caller.
>
> Maybe something like (some-window . t) could be used to incite
> 'display-buffer-use-some-window' to go for the buffer-local value of
> that variable and 'window--display-buffer' to set it.

Or some more meaningful value e.g. (some-window . reuse)




This bug report was last modified 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.