From: Juri Linkov <juri@linkov.net>
To: martin rudalics <rudalics@gmx.at>
Cc: Morgan Smith <Morgan.J.Smith@outlook.com>,
Eli Zaretskii <eliz@gnu.org>,
74246@debbugs.gnu.org, stefankangas@gmail.com
Subject: bug#74246: [PATCH] Reuse display windows in image-dired
Date: Thu, 12 Dec 2024 18:40:16 +0200 [thread overview]
Message-ID: <87ldwl2bgf.fsf@mail.linkov.net> (raw)
In-Reply-To: <2937c06c-631e-4fce-913d-f9a2fdc1df36@gmx.at> (martin rudalics's message of "Thu, 12 Dec 2024 10:23:59 +0100")
>> grep/xref should remember that window in a buffer-local variable?
>
> As I'd envision it, xref would use a conceptually global variable called
> 'xref-target-window' or 'xref-last-window-used' and grep would do
> something similar.
Please not a global variable. I often use many pairs of
source/target windows at the same time for different grep/xref results.
>> (display-buffer buffer `((nil (category . grep) (previous-window . ,window))))
>>
>> could be customized to match a category and to use the previous window:
>>
>> ((category . grep)
>> (display-buffer-in-previous-window))
>
> Wouldn't that be overkill? The user's customization would have no
> effect IIUC. I'd say
>
> (display-buffer buffer `((nil (category . grep) (some-window . ,window))))
>
> would be grep's proposal and a user's
>
> ((category . grep)
> (display-buffer-in-previous-window))
>
> would try to find a window that previously displayed the buffer first.
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)))
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,
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)))
next prev parent reply other threads:[~2024-12-12 16:40 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 20:19 bug#74246: [PATCH] Reuse display windows in image-dired Morgan Smith
2024-11-09 11:37 ` Eli Zaretskii
2024-11-09 17:36 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-23 12:16 ` Eli Zaretskii
2024-11-28 0:32 ` Morgan Smith
2024-11-28 9:28 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-28 18:27 ` Juri Linkov
2024-11-29 15:53 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 18:03 ` Juri Linkov
2024-12-01 8:46 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-02 7:42 ` Juri Linkov
2024-12-02 11:22 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-03 7:47 ` Juri Linkov
2024-12-03 8:25 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-03 17:24 ` Juri Linkov
2024-12-04 7:59 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-04 17:18 ` Juri Linkov
2024-12-05 9:23 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-05 17:54 ` Juri Linkov
2024-12-06 8:33 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-07 17:13 ` Juri Linkov
2024-12-08 16:55 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-09 19:16 ` Juri Linkov
2024-12-10 15:55 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-10 17:30 ` Juri Linkov
2024-12-11 9:38 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-12 7:52 ` Juri Linkov
2024-12-12 9:23 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-12 16:40 ` Juri Linkov [this message]
2024-12-12 17:24 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-12 18:42 ` Juri Linkov
2024-12-13 9:19 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-14 18:19 ` Juri Linkov
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=87ldwl2bgf.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=74246@debbugs.gnu.org \
--cc=Morgan.J.Smith@outlook.com \
--cc=eliz@gnu.org \
--cc=rudalics@gmx.at \
--cc=stefankangas@gmail.com \
/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).