From: Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 33992@debbugs.gnu.org, "João Távora" <joaotavora@gmail.com>
Subject: bug#33992: 27.0.50; xref-find-definitions wastes too much space
Date: Wed, 15 May 2019 23:57:07 +0300 [thread overview]
Message-ID: <87ftpfqvvg.fsf@mail.linkov.net> (raw)
In-Reply-To: <c90aa358-f266-6c49-983a-47749dfe880e@yandex.ru> (Dmitry Gutov's message of "Fri, 3 May 2019 02:05:55 +0300")
>>>>> Does it feel the same way to you?
>>>>
>>>> The difference is that completions pop up in a small unobtrusive window.
>>>
>>> Small window? I usually have a side-by-side fullscreen split, and if
>>> I initiate completion in one of the windows, *Completion* takes up the
>>> whole other window. Temporarily, of course.
>>
>> The key word here is 'Temporarily'. Unlike *Completions*,
>> the *xref* buffer doesn't go out easily.
>
> I can understand that. So yes, I can see myself preferring some different
> behavior for a particular command.
>
>>>> (defun display-buffer-condition-from-xref (_buffer-name _action)
>>>> (string-match-p "\\`\\*\\(xref\\)\\*\\(\\|<[0-9]+>\\)\\'"
>>>> (buffer-name (current-buffer))))
>>>
>>> This function seems unused.
>>
>> It's unused because it would be useful only in the *xref* buffer
>> created by the xref-find-definitions command, so xref needs to
>> provide a way to distinguish such case.
>
> Shouldn't it be referenced somewhere else in your patch as well?
A patch is proposed in a separate bug#35737.
>>>> (setq display-buffer-alist
>>>> '((display-buffer-condition-xref
>>>> display-buffer-in-direction
>>>
>>> And this function is undefined in my Emacs.
>>
>> This function is implemented by Martin in bug#33870.
>
> OK, found it, tried it. Seems to work okay-ish for xref-find-definitions,
Created a separate bug#35592.
> except xref-quit-and-goto-xref doesn't seem to be functioning too well
> together with your customization (every other time it seemed to use
> a different window to display the location, not the one I called
> xref-find-definitions from).
Yes, it should change its behavior depending on xref--original-command.
>>>> (with-eval-after-load 'xref
>>>> (define-key xref--button-map [(control ?m)] #'xref-quit-and-goto-xref))
>>>>
>>>> How do you like that?
>>>
>>> I might, but since I can't really try your customization myself yet, I'll
>>> repeat a question you might be familiar with already:
>>>
>>> Will this also affect xref-find-references and project-find-regexp?
>>
>> It should not affect them due to (memq this-command '(xref-find-definitions))
>> above.
>
> It would affect them due to the modification of xref--button-map above,
> though. This part I don't like.
>
>> But also to not affect commands active in the *xref* buffer,
>> xref should provide a way to check if the *xref* buffer was created
>> by xref-find-definitions.
>
> Yes, we should retain some extra information, e.g. to support revert-buffer.
Created a separate bug#35702.
next prev parent reply other threads:[~2019-05-15 20:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-05 23:43 bug#33992: 27.0.50; xref-find-definitions wastes too much space Juri Linkov
2019-01-06 11:03 ` João Távora
2019-03-20 21:37 ` Juri Linkov
2019-03-20 23:23 ` João Távora
2019-04-04 0:02 ` Dmitry Gutov
2019-04-04 20:49 ` Juri Linkov
2019-04-04 23:06 ` Dmitry Gutov
2019-04-05 9:44 ` Felician Nemeth
2019-04-05 23:20 ` Dmitry Gutov
2019-04-06 21:08 ` Juri Linkov
2019-04-06 21:03 ` Juri Linkov
2019-05-02 23:05 ` Dmitry Gutov
2019-05-15 20:57 ` Juri Linkov [this message]
2019-05-15 22:37 ` Dmitry Gutov
2019-05-28 20:35 ` Juri Linkov
2019-06-10 0:35 ` 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
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=87ftpfqvvg.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=33992@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=joaotavora@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).