unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: martin rudalics <rudalics@gmx.at>, Eli Zaretskii <eliz@gnu.org>
Cc: Helmut Eller <eller.helmut@gmail.com>, emacs-devel@gnu.org
Subject: Re: xref and displaying locations in appropriate window or frame
Date: Mon, 25 Jan 2016 20:04:30 +0300	[thread overview]
Message-ID: <56A6559E.5040301@yandex.ru> (raw)
In-Reply-To: <56A5EFEE.2080607@gmx.at>

On 01/25/2016 12:50 PM, martin rudalics wrote:

> If the *xref* buffer usually fills its window in both dimensions there's
> no need to do anything.

Usually or not, depends on which commands you use, and what you search 
for. Probably not most of the time.

>   -----
> |  O  |
> |-----|
> |  T  |
> |-----|
> |  X  |
>   -----
>
> and subsequently T should be reused for the remaining targets.  This
> will work when the user has customized ‘split-height-threshold’
> appropriately - otherwise O will be used for showing T.

That's fine.

> In a "horizontally" orientd frame you would go from
>
>   ------------
> |     O      |
> |            |
> |            |
> |            |
>   ------------
>
> via
>
>   ------------
> |     O      |
> |            |
> |------------|
> |     X      |
>   ------------

That's not so fine: I'd prefer to go to

   ------------
  |  O  |   X  |
  |     |      |
  |     |      |
  |     |      |
   ------------

at this step instead. Which is how Emacs normally allocates windows.

Note the benefit: as long as the contents of O fit in its width (no 
exceedingly-long lines), we get to see more of its contents.

Ideally, on the next step we get a layout like this:

  ------------
|   O |   X  |
|     |------|
|     |      |
|     |   T  |
  ------------

But I can live with O being split instead.

Having X in the split below O might be even better (giving T a 
full-height window), but I don't see a easy way to that configuration.

Note, however, that from the X-below-O configuration I quoted above you 
can't each either of the good target configurations.

> to
>
>   ------------
> |  O  |   T  |
> |     |      |
> |------------|
> |     X      |
>   ------------

This would be a waste of space on the right side of X.

> Now suppose that both O and N exist.  In this case you would, in the
> vertically oriented case, go from
>
>   -----
> |  O  |
> |     |
> |-----|
> |  N  |
> |     |
>   -----
>
> via
>
>   -----
> |  O  |
> |-----|
> |  N  |
> |-----|
> |  X  |
>   -----
>
> to
>
>   -----
> |  O  |
> |-----|
> |  T  |
> |-----|
> |  X  |
>   -----

This is also fine.

> The second tricky case is to make sure that for a new target always the
> previous T window gets used via ‘display-buffer-use-some-window’.  To
> make this happen you will either have to mark the O and X windows as
> dedicated or make sure the T window is the LRU window when displaying
> the next target.  (I silently assumed that N will be automatically used
> for displaying T initially because O was selected and X would have to be
> selected by you when it's created.)

Dedicated it is, then.

>  > Maybe the actual solution is indeed to use a different display
>  > mechanism for xref-find-definitions with several options. Then it
>  > could use an actual temporary electric window at the bottom of the
>  > current window that gets deleted as soon as we're done.
>
> At least that's how I would customize the display of *xref*.  Whatever
> you choose for the default might be entirely different based on the
> needs of a majority of users.

Unless someone would like to send a patch, I'll hold off on implementing 
this, because we've not really stabilized on anything, including the 
calling convention of xref-show-xrefs-function.

And the above feature would be closely related to that variable.

>  > We don't use temp-buffer-resize-mode in Compilation or Grep buffers,
>  > right? Even though Grep likewise might return only a few matches.
>
> IIUC these buffers get filled asynchronously.  How should
> ‘temp-buffer-resize-mode’ work with such buffers?

Resize after every bit of output? Admittedly, it can be annoying.

> Do you produce *xref* asynchronously?

Not yet, we I hope we manage to do that. Only working synchronously is 
one of its drawbacks compared to Grep.

>  > Were the Help windows actually _temporary_ sometime?
>
> Depends on the semantics of "temporary".

I'd only call that a window that usually disappears before the next 
command. But that's just me.

>  > If I have a frame with two full-height windows side-by-side, and I'm
>  > calling project-find-regexp which returns a lot of results, I'd want
>  > it to be displayed in the "other" window, rather than necessarily
>  > split the current one.
>
> I thought the other window is where you eventually wanted to show the
> target buffer.

I don't think that when the user calls any other-window command, they 
have a specific window in mind (for that, they'd have to know the window 
numbering somehow). IMHO, -other-window just means "some other window in 
the current frame".

>  > Or, if I have just one window in a maximized frame, and do the search,
>  > and I've customized the split thresholds appropriately, I want
>  > split-window-right to be called, and see *xref* to the right.
>
> Once more: Where would you show the target buffer then?

We'd split one of the windows again and show the target buffer in the 
new window. See my diagram at the beginning of this email.

>  > Instead of having the "split below" performed, and seeing *xref* use
>  > full width, and only half the height of the current frame.
>
> Hopefully less than half the height when you fit the window to its
> buffer.

Like mentioned, xref's contents can be long (even if they usually 
aren't, in xref-find-definitions output).

>  >> Yes.  But the one-window-per-frame user might get a new frame then.
>  >> She's not your target (because of the assumption that the original
>  >> window and the *xref* window are already there when you want to display
>  >> the other buffer).
>  >
>  > Wouldn't she want a new frame anyway?
>
> I thought about people who work with one and only one window.  We
> shouldn't create a no-way-out situation for them.

I'm accepting suggestions on what to do in this case. We should handle 
the more common ones first, however.

> One problem with dedicated windows is that if an application and the
> user both start dedicating the same window to its buffer there might be
> conflicts.  I doubt that such conflicts can be "fixed" easily.

So, then problem will occur when I un-dedicate it at the end, in 
unwind-protect? I suppose I can save its dedication status, and then 
restore it.

>  > Maybe it does make sense, maybe it doesn't. I'm fine with it, though,
>  > because I don't mind doing doing my vertical splits manually.
>
> ‘display-buffer’ can't split it.  The very first example above will work
> only if the user has customized ‘split-height-threshold’.  Otherwise, T
> will be shown in the O window.

Indeed. Anyway, I'd be fine with changing the default, as long as 
side-by-side splits are still preferred.

>  > But *Grep* works fine in that situation, doesn't it?
>
> I never use it.  My grep hits appear in a side window where I just list
> the files where at least one hit occurred.  Selecting a file shows all
> hits in that file.  Selecting a particular hit shows that hit in the
> window on the right.

All right, *Compilation*, then?

(I'm not too enamored with your description of Grep solution--too many 
steps--but that's beside the point.)

>  > quit-window is different, and it works as expected anyway, I'd say: if
>  > the window configuration hasn't changed too much, it will undo the
>  > action that displayed it. If the window configuration did change too
>  > much, it will just bury the current buffer. Everybody happy.
>
> Did you try it after manually switching to such a buffer?

Yes. Like I said, when I switch to it manually and press `q', it just 
buries the Help buffer. Is there a particular problem scenario you have 
in mind?

>  > I can easily imagine having several *xref* buffers at the same time
>  > (we'll just have to add more coherent naming).
>
> Then I'd say: Maybe some prefixed command to "bring back" an existing
> *xref* buffer would be more useful than simply switching to it.

IMHO, the users won't bother, and will either switch to that buffer 
manually, or just repeat the search.



  reply	other threads:[~2016-01-25 17:04 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-09 19:36 tags-loop-continue Eli Zaretskii
2016-01-09 19:59 ` tags-loop-continue Ingo Lohmar
2016-01-09 20:22 ` tags-loop-continue Dmitry Gutov
2016-01-09 20:42   ` tags-loop-continue Eli Zaretskii
2016-01-09 20:49     ` tags-loop-continue Dmitry Gutov
2016-01-09 20:52       ` tags-loop-continue Dmitry Gutov
2016-01-09 21:19       ` tags-loop-continue Dmitry Gutov
2016-01-10  3:45         ` tags-loop-continue Eli Zaretskii
2016-01-10  4:00           ` tags-loop-continue Dmitry Gutov
2016-01-10  6:29             ` tags-loop-continue Drew Adams
2016-01-10 14:35               ` tags-loop-continue Dmitry Gutov
2016-01-10 15:26                 ` tags-loop-continue Ingo Lohmar
2016-01-10 16:09                   ` tags-loop-continue Eli Zaretskii
2016-01-10 16:08                 ` tags-loop-continue Eli Zaretskii
2016-01-10 16:18                   ` tags-loop-continue Dmitry Gutov
2016-01-10 17:53                 ` tags-loop-continue Drew Adams
2016-01-10 18:12                   ` tags-loop-continue Dmitry Gutov
2016-01-11  7:21                     ` tags-loop-continue Eric Abrahamsen
2016-01-10 15:54             ` tags-loop-continue Eli Zaretskii
2016-01-10 16:14               ` tags-loop-continue Dmitry Gutov
2016-01-10 17:08                 ` tags-loop-continue Eli Zaretskii
2016-01-10 18:19                   ` tags-loop-continue Dmitry Gutov
2016-01-10 19:01                     ` tags-loop-continue Eli Zaretskii
2016-01-14  0:41                   ` tags-loop-continue Dmitry Gutov
2016-01-14 16:00                     ` tags-loop-continue Eli Zaretskii
2016-01-14 16:07                       ` tags-loop-continue Dmitry Gutov
2016-01-14 17:17                         ` tags-loop-continue Eli Zaretskii
2016-01-14 17:26                           ` tags-loop-continue Dmitry Gutov
2016-01-14 17:39                             ` tags-loop-continue Dmitry Gutov
2016-01-14 18:36                               ` tags-loop-continue Eli Zaretskii
2016-01-14 18:46                                 ` tags-loop-continue Dmitry Gutov
2016-01-14 18:31                             ` tags-loop-continue Eli Zaretskii
2016-01-14 18:44                               ` tags-loop-continue Dmitry Gutov
2016-01-14 19:02                                 ` tags-loop-continue Eli Zaretskii
2016-01-14 19:15                                   ` tags-loop-continue Dmitry Gutov
2016-01-14 19:18                                     ` tags-loop-continue Dmitry Gutov
2016-01-14 19:41                                     ` tags-loop-continue Eli Zaretskii
2016-01-14 20:09                                       ` tags-loop-continue Dmitry Gutov
2016-01-14 20:21                                         ` tags-loop-continue Eli Zaretskii
2016-01-18 19:19                                           ` tags-loop-continue Dmitry Gutov
2016-01-20 11:19                                             ` tags-loop-continue Eli Zaretskii
2016-01-21  4:59                                               ` tags-loop-continue Dmitry Gutov
2016-01-21 17:02                                                 ` tags-loop-continue Eli Zaretskii
2016-01-21 17:12                                                   ` tags-loop-continue Dmitry Gutov
2016-01-21 17:47                                                     ` tags-loop-continue Eli Zaretskii
2016-01-21 18:58                                                       ` tags-loop-continue Dmitry Gutov
2016-01-21 19:02                                                         ` tags-loop-continue Eli Zaretskii
2016-01-21 19:11                                                           ` tags-loop-continue Dmitry Gutov
2016-01-21 19:56                                                             ` tags-loop-continue Eli Zaretskii
2016-01-21 20:15                                                               ` tags-loop-continue Dmitry Gutov
2016-01-21 20:36                                                                 ` tags-loop-continue Eli Zaretskii
2016-01-21 21:17                                                                   ` tags-loop-continue Dmitry Gutov
2016-01-21 21:26                                                                     ` tags-loop-continue Dmitry Gutov
2016-01-22  6:59                                                                       ` tags-loop-continue Eli Zaretskii
2016-01-22 10:13                                                                         ` tags-loop-continue Dmitry Gutov
2016-01-22 14:08                                                                           ` tags-loop-continue Eli Zaretskii
2016-01-22 17:51                                                                             ` tags-loop-continue John Wiegley
2016-01-22 18:35                                                                               ` tags-loop-continue Dmitry Gutov
2016-01-24  1:26                                                                             ` next-error-function integration in xref removed Dmitry Gutov
2016-01-26 17:34                                                                               ` John Wiegley
2016-01-22  1:54                                                                   ` tags-loop-continue John Wiegley
2016-01-22  2:00                                                                     ` tags-loop-continue Dmitry Gutov
2016-01-22  5:34                                                                       ` tags-loop-continue John Wiegley
2016-01-21  5:15                                               ` tags-loop-continue Dmitry Gutov
2016-01-21 17:07                                                 ` tags-loop-continue Eli Zaretskii
2016-01-24  2:19                                                   ` xref and displaying locations in appropriate window or frame Dmitry Gutov
2016-01-24 10:55                                                     ` martin rudalics
2016-01-24 13:02                                                       ` Dmitry Gutov
2016-01-24 14:38                                                         ` martin rudalics
2016-01-24 14:53                                                           ` martin rudalics
2016-01-24 17:08                                                           ` Dmitry Gutov
2016-01-24 18:12                                                             ` martin rudalics
2016-01-24 19:01                                                               ` Dmitry Gutov
2016-01-25  9:50                                                                 ` martin rudalics
2016-01-25 17:04                                                                   ` Dmitry Gutov [this message]
2016-01-25 18:18                                                                     ` martin rudalics
2016-01-25 19:28                                                                       ` Ingo Lohmar
2016-01-26 10:05                                                                         ` martin rudalics
2016-01-26 23:31                                                                           ` Dmitry Gutov
2016-01-27  9:10                                                                             ` martin rudalics
2016-01-27 17:33                                                                               ` Dmitry Gutov
2016-01-27 18:08                                                                                 ` martin rudalics
2016-01-27 18:35                                                                                   ` Dmitry Gutov
2016-01-27 22:45                                                                                   ` Juri Linkov
2016-01-27 23:13                                                                                     ` Dmitry Gutov
2016-01-28  9:42                                                                                     ` martin rudalics
2016-01-28 15:03                                                                                       ` Drew Adams
2016-01-29  0:05                                                                                       ` Juri Linkov
2016-01-29  7:27                                                                                         ` martin rudalics
2016-01-29 23:36                                                                                           ` Juri Linkov
2016-01-29  1:57                                                                                       ` Dmitry Gutov
2016-01-29  7:27                                                                                         ` martin rudalics
2016-01-29 13:59                                                                                           ` Dmitry Gutov
2016-01-29 23:40                                                                                             ` Juri Linkov
2016-01-25 22:39                                                                       ` Dmitry Gutov
2016-01-26 10:05                                                                         ` martin rudalics
2016-01-27  1:00                                                                           ` Dmitry Gutov
2016-01-27  9:10                                                                             ` martin rudalics
2016-01-27 18:43                                                                               ` Dmitry Gutov
2016-01-24 15:43                                                     ` Eli Zaretskii
2016-01-24 17:27                                                       ` Dmitry Gutov
2016-01-24 17:58                                                         ` Eli Zaretskii
2016-01-24 18:03                                                           ` Dmitry Gutov
2016-02-21  0:24                                                       ` Dmitry Gutov
2016-02-21 23:49                                                   ` tags-loop-continue Dmitry Gutov
2016-02-22 17:20                                                     ` tags-loop-continue Eli Zaretskii
2016-01-17 23:12                       ` tags-loop-continue Stefan Monnier
2016-01-18  1:37                         ` tags-loop-continue Dmitry Gutov
2016-01-18  2:20                           ` tags-loop-continue Stefan Monnier
2016-01-18  2:28                             ` tags-loop-continue Dmitry Gutov
2016-01-18  2:48                               ` tags-loop-continue Stefan Monnier
2016-01-18  2:57                                 ` tags-loop-continue Dmitry Gutov
2016-01-18 15:46                                   ` tags-loop-continue Eli Zaretskii

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=56A6559E.5040301@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    --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 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).