[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#74246: [PATCH] Reuse display windows in image-dired
From: |
martin rudalics |
Subject: |
bug#74246: [PATCH] Reuse display windows in image-dired |
Date: |
Thu, 12 Dec 2024 18:24:39 +0100 |
User-agent: |
Mozilla Thunderbird |
> Please not a global variable. I often use many pairs of
> source/target windows at the same time for different grep/xref
> results.
I do that too. Just that my "source window" is a sidebar of the target
window.
> Still too limited solution when the users can't store the last window
> for other commands. Better would be to add a new alist entry that
> will force 'display-buffer' to remember the last window from any call:
>
> (display-buffer buffer `((nil (category . compilation)
> (remember-last-window . t))))
>
> or by user customization of display-buffer-alist:
>
> ((category . compilation)
> (nil (remember-last-window . t)))
In that case the 'last-window' parameter maintained by 'display-buffer'
would have to become a list of categories. Then what about two grep
operations running in parallel as you mention above: Would they share
the same target window?
> And a function that stores/restores the last window could be customizable as
well.
> So the users could decide whether to save it in a buffer-local variable,
... buffer-local where - in the source or the target buffer?
> or in the window parameter. This option could be like 'xref-history-storage'
> that provides the choice of 'xref-global-history' or
'xref-window-local-history':
>
> ((category . compilation)
> (nil (remember-last-window . global)))
>
> or
>
> ((category . compilation)
> (nil (remember-last-window . window-local)))
>
> or
>
> ((category . compilation)
> (nil (remember-last-window . buffer-local)))
Just think of describing this in the manual.
But I already see: We'll have to maintain a buffer-local variable, say
'xref-last-window' in the source buffer, have xref consult that variable
and pass it as (last-window . ,xref-last-window) to 'display-buffer'.
The value returned by 'display-buffer' would then become the new value
of 'xref-last-window' in the source buffer. Would that be OK with you?
martin
- bug#74246: [PATCH] Reuse display windows in image-dired, (continued)
- bug#74246: [PATCH] Reuse display windows in image-dired, martin rudalics, 2024/12/06
- bug#74246: [PATCH] Reuse display windows in image-dired, Juri Linkov, 2024/12/07
- bug#74246: [PATCH] Reuse display windows in image-dired, martin rudalics, 2024/12/08
- bug#74246: [PATCH] Reuse display windows in image-dired, Juri Linkov, 2024/12/09
- bug#74246: [PATCH] Reuse display windows in image-dired, martin rudalics, 2024/12/10
- bug#74246: [PATCH] Reuse display windows in image-dired, Juri Linkov, 2024/12/10
- bug#74246: [PATCH] Reuse display windows in image-dired, martin rudalics, 2024/12/11
- bug#74246: [PATCH] Reuse display windows in image-dired, Juri Linkov, 2024/12/12
- bug#74246: [PATCH] Reuse display windows in image-dired, martin rudalics, 2024/12/12
- bug#74246: [PATCH] Reuse display windows in image-dired, Juri Linkov, 2024/12/12
- bug#74246: [PATCH] Reuse display windows in image-dired,
martin rudalics <=
- bug#74246: [PATCH] Reuse display windows in image-dired, Juri Linkov, 2024/12/12
- bug#74246: [PATCH] Reuse display windows in image-dired, martin rudalics, 2024/12/13
- bug#74246: [PATCH] Reuse display windows in image-dired, Juri Linkov, 2024/12/14