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: 70949@debbugs.gnu.org
Subject: bug#70949: display-buffer-choose-some-window
Date: Fri, 31 May 2024 11:45:44 +0200 [thread overview]
Message-ID: <7feb9b0b-8186-499f-8477-2d4f51cec13d@gmx.at> (raw)
In-Reply-To: <86frty34km.fsf@mail.linkov.net>
> Not a variable, but a window parameter. A buffer-local variable
> can't be used because for example 'vc-diff-internal' uses such
> call sequence:
>
> (set-buffer buffer)
> (pop-to-buffer (current-buffer))
>
> so 'display-buffer' is called from 'pop-to-buffer' in the wrong buffer.
So what we want to do here is to make 'vc-diff' work in the context of
'vc-dir'. There you have a set of "interesting" files you want to
compare with their base versions. 'vc-diff' calls 'vc-deduce-fileset'
to find the set of files to compare. If that function returns a single
file or a single-file list, we continue as usual. But if that function
returns a list of files, 'vc-diff' knows that it is in or enters a mode
where it should use one and the same window to show a sequence of diffs.
In that latter case, 'vc-diff' could pass an extra optional argument to
'vc-diff-internal', telling it that it has to call 'pop-to-buffer' with
a 'display-buffer-in-previous-window' action and a 'previous-window'
alist entry whose value is 'vc-diff'. That's all 'vc-diff' can do.
'display-buffer-in-previous-window' could now try to find a window whose
'previous-window' parameter is (or includes the value) 'vc-diff'. If it
finds such a window, it displays the diff there. Otherwise, it has to
display the diff in the usual manner - just as if the 'previous-window'
entry didn't exist. In either case 'display-buffer' would set (or add)
a '(previous-window . vc-diff) parameter for the window used.
'quit-window' would eventually remove that 'previous-window' parameter
or entry provided the buffer shown in the window is a vc-diff buffer.
Note: I don't know how 'vc-deduce-fileset' gets the next file in a set
of files to diff. I simply assume that it does TRT here.
martin
next prev parent reply other threads:[~2024-05-31 9:45 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 16:56 bug#70949: display-buffer-choose-some-window Juri Linkov
2024-05-15 8:06 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-15 16:49 ` Juri Linkov
2024-05-16 8:20 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-17 6:40 ` Juri Linkov
2024-05-18 9:21 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-20 6:15 ` Juri Linkov
2024-05-20 8:01 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-20 16:54 ` Juri Linkov
2024-05-21 8:21 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-21 17:18 ` Juri Linkov
2024-05-22 7:39 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-23 6:16 ` Juri Linkov
2024-05-23 7:22 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-23 17:27 ` Juri Linkov
2024-05-24 9:32 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-24 17:38 ` Juri Linkov
2024-05-26 8:54 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-27 17:52 ` Juri Linkov
2024-05-28 8:05 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-28 16:19 ` Juri Linkov
2024-05-29 8:49 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-30 6:34 ` Juri Linkov
2024-05-30 8:54 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-31 6:18 ` Juri Linkov
2024-05-31 9:45 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-06-02 6:39 ` Juri Linkov
2024-06-04 8:20 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-04 16:43 ` Juri Linkov
2024-06-05 8:46 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-05 16:48 ` Juri Linkov
2024-06-06 9:19 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-07 6:37 ` Juri Linkov
2024-06-07 8:23 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-07 16:45 ` Juri Linkov
2024-06-08 9:12 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-09 17:04 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7feb9b0b-8186-499f-8477-2d4f51cec13d@gmx.at \
--to=bug-gnu-emacs@gnu.org \
--cc=70949@debbugs.gnu.org \
--cc=juri@linkov.net \
--cc=rudalics@gmx.at \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.