From: joaotavora@gmail.com (João Távora)
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 28814@debbugs.gnu.org
Subject: bug#28814: [BUMP, PATCH] (26.0.90; When *xref* window is needed, original window-switching intent is lost )
Date: Wed, 25 Oct 2017 08:43:57 +0100 [thread overview]
Message-ID: <87y3nzu0xu.fsf@gmail.com> (raw)
In-Reply-To: <13af136e-12fb-4e8d-81ff-63424b1e1943@yandex.ru> (Dmitry Gutov's message of "Wed, 25 Oct 2017 03:24:58 +0300")
Dmitry Gutov <dgutov@yandex.ru> writes:
> OK, but is it the correct thing to do? The thresholds are there for a
> reason, and having a window that's only a few lines tall (which could
> happen in some example) will hardly be more helpful than showing it in
> a different window, even if the user expected xref to use the "other
> window".
Well, I don’t think it’s that bad if a tiny window pops up, considering:
1. The user *did* type C-x 4 . , meaning he specifically requested "a
different window", so that’s life. Tiny windows can pop up via the
existing exception in split-window-sensibly, too.
2. I assume we want to stand by Eli’s wish that the *xref* buffer should
stay visible (and anyway the user has a failsafe C-u RET command that
buries it and should improve the situation).
> This stuff is difficult, and personally I don't like either of the
> easily reachable solutions.
We’re talking about the edge cases here. Would you like a solution where
the user’s intention (1) is disregarded in extreme cases (and thus the
original window is considered even if the user did C-x 4 .)
>> I see and I will try to answer. I proposed two patches previously:
>>
>> * a first one to fix the non-determinism of window popping/selecting
>> behaviour;
>> * a second one to make the *xref* buffer less obstrusive.
>> * (now there is the third one that fixes the frame-popping glitch)
>>
>> IIUC it is the second one that clashes with "the dissapearing *xref*
>> problem" that I have yet to read up on. If we don't come up with a
>> solution for that, I would be OK with a solution that leaves it unsolved
>> but adds some customization point (hook) for the user to put this
>> behaviour in.
>
>Indeed, but there's also a matter of consistency, and of making the
>overall design work in a predictable fashion. More in the follow-up
>email.
Any of the two alternatives are more predictable than what we have
now. A gain in predictability.
> Overall, I don't have strong objections, so if Eli is fine with the
> new behavior all around, I don't mind getting them in (with maybe a
> few modifications), and hopefully we'll reach some better solutions by
> the next release.
>
> For some more context though: previously, I've tried to make it seem
> "like xref buffer was never there" after the user performed the
> navigation, in other respects too:
>
> - As we recall, the xref buffer was buried after the user performed
> the navigation.
>
> - The window configuration was fully restored to the one before the
> xref buffer was shown (with some checks like making sure the user
> didn't change the configuration manually thereafter), and then the
> navigation was performed. After that, using the "originally intended"
> window or frame was much easier.
>
> - All buffers that were opened just to show the xref locations were
> cleaned up (closed) after the navigation was performed.
I see, there’s prior art here. You approach is much more ambitious than
mine and given the hairiness of window code, it’s no wonder it didn’t
work well, if you will excuse the hindsight 20/20 :-)
My approach is less ambitious but works well and predictably for these
(more than) common cases:
The case where I *do want* my current window (and only that one) to get
clobbered.
M-. symbol-with-multiple-definitions RET
n [0 or more times]
p [0 or more times]
RET [the final decision, or C-u RET to ditch the *xref* buffer]
And also the case where I *don’t want* my window to get clobbered, and
don’t care about the other ones.
C-x 4 . symbol-with-multiple-definitions RET
n [0 or more times]
p [0 or more times]
RET [the final decision, or C-u RET to ditch the *xref* buffer]
If it helps, this itch didn’t pop out of thin air: as you know, xref.el
is lifted from SLIME’s UI. SLY, my fork of SLIME, does the same, and a
user complained about SLY’s use of popup windows in a way that finally
convinced me. See https://github.com/joaotavora/sly/issues/121
>> * 0003-Allow-split-window-sensibly-to-split-threshold-in-fu.patch
> If there are other non-dedicated windows, will one of them be used
> (that would seem fine)?
Yes, of course, in keeping with the current spirit that splitting a
small window is a last resort before popping a frame.
> I have to wonder if we have other commands that quit the current
> window when called with a prefix. Particularly commands bound to RET.
I see, it’s a bit odd indeed, but I had no idea of any kind of rule or
policy in that direction.
Anyway, In the thread you pointed me to, there was talk of an ’a’
command but I never saw it. It was some hypothetical
xref-quit-and-goto-xref. I’m perfectly fine with implementing that
instead.
Of course my priority goes towards RET doing xref-quit-and-goto-xref and
something else doing xref-goto-xref. If that default isn’t changed, I’ll
probably to that remap in my init file..
João
next prev parent reply other threads:[~2017-10-25 7:43 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 16:07 bug#28814: 26.0.90; When *xref* window is needed, original window-switching intent is lost João Távora
[not found] ` <handler.28814.B.150791088020837.ack@debbugs.gnu.org>
2017-10-16 17:58 ` bug#28814: Acknowledgement (26.0.90; When *xref* window is needed, original window-switching intent is lost ) João Távora
2017-10-20 9:13 ` bug#28814: [BUMP, PATCH] " João Távora
2017-10-20 10:39 ` Dmitry Gutov
2017-10-23 2:06 ` Dmitry Gutov
2017-10-23 8:23 ` João Távora
2017-10-23 20:03 ` João Távora
2017-10-25 0:24 ` Dmitry Gutov
2017-10-25 7:43 ` João Távora [this message]
2017-10-25 10:24 ` Dmitry Gutov
2017-10-25 13:29 ` João Távora
2017-10-25 14:49 ` Dmitry Gutov
2017-10-25 15:35 ` João Távora
2017-10-25 15:46 ` Dmitry Gutov
2017-10-25 15:11 ` Eli Zaretskii
2017-10-25 15:27 ` João Távora
2017-10-25 15:39 ` Eli Zaretskii
2017-10-25 20:56 ` João Távora
2017-10-26 7:56 ` martin rudalics
2017-10-26 16:42 ` Eli Zaretskii
2017-10-26 22:40 ` Dmitry Gutov
2017-10-27 0:05 ` João Távora
2017-11-02 17:06 ` Dmitry Gutov
2017-10-26 23:59 ` João Távora
2017-10-28 9:41 ` Eli Zaretskii
2017-10-28 19:19 ` João Távora
2017-11-02 17:03 ` João Távora
2017-11-02 17:07 ` Eli Zaretskii
2017-11-02 19:07 ` João Távora
2017-11-02 19:32 ` Eli Zaretskii
2017-11-03 13:47 ` Eli Zaretskii
2017-11-03 16:18 ` João Távora
2017-11-03 19:06 ` Eli Zaretskii
2017-10-26 12:39 ` Dmitry Gutov
2017-10-25 7:46 ` martin rudalics
2017-10-25 13:19 ` João Távora
2017-10-26 7:56 ` martin rudalics
2017-10-25 0:07 ` Dmitry Gutov
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=87y3nzu0xu.fsf@gmail.com \
--to=joaotavora@gmail.com \
--cc=28814@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 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.