unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 20489@debbugs.gnu.org
Subject: bug#20489: 25.0.50; next-error-find-buffer chooses non-current buffer without good reason
Date: Wed, 03 Feb 2016 02:35:43 +0200	[thread overview]
Message-ID: <87d1se62co.fsf@mail.linkov.net> (raw)
In-Reply-To: <56B00903.7050706@yandex.ru> (Dmitry Gutov's message of "Tue, 2 Feb 2016 04:40:19 +0300")

>> The primary question is not how many users asked for it many years ago,
>> but how many users are using it now.
>
> You're welcome to poll, but so far we only have the data about
> a single user.

Yes, a single user who wants to remove it ;)

>> Obviously, get-mru-“next-error”-window, i.e. a combination of both.
>
> I have no idea what that means, really. Are we going to store a reference
> to a window instead of a reference to a buffer? And then take the reference
> to the buffer from that window?

Just traverse all windows in the order of recency until finding a window
with next-error-function.

>>> And, again, this ignores the Flycheck case.
>>
>> Alas, this means we have to trade visibility of next-error-last-buffer
>> for window-local values.
>
> What means? And why?

In case of Flycheck it's next-error-last-buffer is the current buffer
and is always visible.

>>> With your approach, no window will affect other windows. Even if I ran M-x
>>> rgrep, and I see its buffer in the current frame, I'll also have to
>>> remember which window it ended at. And if I never clicked on a link in the
>>> *grep* buffer, I can't use C-x ` in any window, I'm assuming.
>>
>> C-x ` in any window will use the global value, i.e. the last navigation.
>
> So, not only we'll have local values, we'll also have a global one?

When there is no local values, then indeed use a global one.

> Upon invoking that command, will focus immediately jump to the one window
> associated with the navigation buffer?

Naturally.

>>> Suppose I use flycheck-next-error in foo.el. And I have a *grep* buffer
>>> visible, and I jumped to bar.el from it. And the next error in *grep* is in
>>> foo.el. What happens when I, having returned to bar.el's window, call
>>> next-error again? Does it jump to foo.el's window? Does it display foo.el
>>> in the window where bar.el previously was?
>>
>> It will display foo.el in the window where bar.el previously was.
>
> Aren't you at all worried about running out of windows (and not being
> allowed to split them)? In our last discussion with Martin, he expressed
> concern that some users use one window per frame. In this scenario, you'll
> need at least 3. And with two navigational buffers visible, the number of
> necessary windows will grow to 5.

I meant reusing an existing window with a file buffer, not creating a new
window.  I see no reason not to use this behavior by default.

>> AFAIS, this is the point of the current discussion on emacs-devel -
>> to fix xref's window management to work like *compilation* and visit
>> navigated windows predictably.
>
> *compilation* isn't afraid to use different windows when it's
> convenient. It definitely reuses another window if the buffer it's going to
> jump to is already displayed.

What I see is that *compilation* always reuses another window to not replace
the navigational *compilation* buffer with a file buffer.  Do you know
under what circumstances this behavior might fail.

>>> But if we have a new command, I could also allow selecting from some of the
>>> existing buffers which contain "nonlocal" next-error-function's.
>>
>> Why only “nonlocal”?
>
> Because otherwise there'll be too many options too choose from. To use
> a different buffer, the user can switch to it first anyway.
>
> Nonlocal next-error-functions represent groups of windows that are somehow
> related (parts of the same problem, matches for the same input, or so
> on). And with them, we can at least expect that the next error still might
> be in the current buffer.

This is why I proposed window-local variables to bind a group of windows
to their parent navigational window.





  reply	other threads:[~2016-02-03  0:35 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-02 23:17 bug#20489: 25.0.50; next-error-find-buffer chooses non-current buffer without good reason Dmitry Gutov
2015-05-03  5:49 ` Stefan Monnier
2015-05-03 12:56   ` Dmitry Gutov
2015-05-04 22:03     ` Ted Zlatanov
2015-05-04 22:22       ` Dmitry Gutov
2015-05-04 22:33         ` Ted Zlatanov
2015-05-05 15:05           ` Dmitry Gutov
2015-05-05 15:15             ` Ted Zlatanov
2016-01-24 21:10 ` Juri Linkov
2016-01-25  6:23   ` Dmitry Gutov
2016-01-25 21:55     ` Juri Linkov
2016-01-25 23:36       ` Dmitry Gutov
2016-01-27  0:57         ` Juri Linkov
2016-01-27  2:43           ` Dmitry Gutov
2016-01-27 22:57             ` Juri Linkov
2016-01-27 23:28               ` Dmitry Gutov
2016-01-28 23:59                 ` Juri Linkov
2016-01-29  0:35                   ` Dmitry Gutov
2016-01-29 23:44                     ` Juri Linkov
2016-01-30  0:57                       ` Dmitry Gutov
2016-01-30 23:43                         ` Juri Linkov
2016-01-31  0:39                           ` Dmitry Gutov
2016-01-31 21:57                             ` Juri Linkov
2016-01-31 22:38                               ` Dmitry Gutov
2016-02-02  0:44                                 ` Juri Linkov
2016-02-02  1:40                                   ` Dmitry Gutov
2016-02-03  0:35                                     ` Juri Linkov [this message]
2016-02-04  1:00                                       ` Dmitry Gutov
2016-02-22  0:01 ` Dmitry Gutov
2016-02-22 17:22   ` Eli Zaretskii
2016-02-22 17:30     ` Dmitry Gutov
2016-02-22 17:39       ` Eli Zaretskii
2016-02-22 18:09         ` Dmitry Gutov
2016-02-22 18:11           ` Dmitry Gutov
2016-02-22 19:07           ` Eli Zaretskii
2016-02-27 10:14   ` Eli Zaretskii
2016-02-29  3:15     ` Dmitry Gutov
2016-02-29 16:23       ` Eli Zaretskii
2016-02-29 23:30         ` Dmitry Gutov
2017-11-06 21:53 ` Juri Linkov
2018-02-15 22:16   ` Juri Linkov
2018-02-27  1:21     ` Dmitry Gutov
2018-02-27  1:54       ` Dmitry Gutov
2018-02-27 18:07         ` Dmitry Gutov
2018-02-27 21:16         ` Juri Linkov
2018-02-28  2:13           ` Dmitry Gutov
2018-02-28 21:17             ` Juri Linkov
2018-03-02  1:19               ` Dmitry Gutov
2018-03-06 22:17                 ` Juri Linkov
2018-03-07 14:11                   ` Dmitry Gutov
2018-03-07 21:11                     ` Juri Linkov
2018-03-12 22:08                       ` Dmitry Gutov
2018-02-28 21:25             ` Juri Linkov
2018-03-01 22:58               ` Juri Linkov
2018-03-02  1:26                 ` Dmitry Gutov
2018-03-06 22:25                   ` Juri Linkov
2018-03-07 14:08                     ` Dmitry Gutov
2018-03-07 21:03                       ` Juri Linkov
2018-02-28 21:32             ` Juri Linkov
2018-03-02  0:54               ` Dmitry Gutov
2018-03-01 23:04             ` Juri Linkov
2018-03-02  1:30               ` Dmitry Gutov
2018-02-28 17:33           ` Richard Stallman
2018-02-21 21:30   ` 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=87d1se62co.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=20489@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /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).