unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Juri Linkov <juri@linkov.net>
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: Wed, 11 Dec 2024 10:38:21 +0100	[thread overview]
Message-ID: <eea8debd-654a-4c0b-ba1b-ce4bcc9142c3@gmx.at> (raw)
In-Reply-To: <877c87o52j.fsf@mail.linkov.net>

 > I still don't understand how a local variable in one target buffer could
 > help to display another buffer in the same window from grep/xref list.

By having grep do the following:

- Issue a first request to display a buffer from that list,

- remember the window used,

- set the local variable in the target buffer to the remembered value
   before calling 'display-buffer' again.

It could do that if it wanted to communicate the window to use in a
buffer local variable thus avoiding to pass an extra value via the
alist.

 >> Would you like that?  I think displaying *backtrace* in the same window
 >> is always a bad idea.
 >
 > Only when 'display-buffer-below-selected' fails that is extremely rare.

I assumed that the user had customized it.

 >>>> pass the symbol of the function calling 'display-buffer' with some
 >>>> unique number identifying the nth call of 'display-buffer' within that
 >>>> function.  Everything else is guesswork.
 >>>
 >>> There is already such a symbol: 'category'.

'category' is much broader.

 >> But this one is already handled by 'buffer-match-p'.  We can't set it
 >> willy-nilly to some arbitrary value.  Otherwise, that function might
 >> match it in an unexpected way.
 >
 > 'display-buffer-reuse-category-window' could reuse the 'category' symbol.
 > Or '(some-window . reuse-category)'.

Let me turn the table and ask you: Both grep/xref know very well which
window was used for displaying the last match.  What speaks again to
have them just remember that window after each call and propose it via a
(some-window . ,window) alist entry in the next call together with
'display-buffer-use-some-window'?  I think the main advantage of such an
approach is that grep/xref would be in complete control of a good
proposal for such a window, something most users could hardly resist.

 > Not either, but preferably the last used window.

Not preferably, IMHO.

 >> 'image-dired' _is_ different because it always uses the same buffer for
 >> showing images stored in different files.  I know of no other function
 >> doing that.  Do you?
 >
 > I don't remember any other function doing such non-standard things.

So IMHO we should exploit that fact in its 'display-buffer' call.

martin





      reply	other threads:[~2024-12-11  9:38 UTC|newest]

Thread overview: 26+ 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 [this message]

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=eea8debd-654a-4c0b-ba1b-ce4bcc9142c3@gmx.at \
    --to=bug-gnu-emacs@gnu.org \
    --cc=74246@debbugs.gnu.org \
    --cc=Morgan.J.Smith@outlook.com \
    --cc=eliz@gnu.org \
    --cc=juri@linkov.net \
    --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).