GNU bug report logs -
#74246
[PATCH] Reuse display windows in image-dired
Previous Next
Full log
View this message in rfc822 format
> 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
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.