From: Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 35737@debbugs.gnu.org
Subject: bug#35737: xref--original-command
Date: Fri, 24 May 2019 21:40:27 +0300 [thread overview]
Message-ID: <87r28nenzk.fsf@mail.linkov.net> (raw)
In-Reply-To: <e68a0748-5aa8-2938-cdc4-776c19ac105e@yandex.ru> (Dmitry Gutov's message of "Fri, 24 May 2019 04:59:40 +0300")
>>> But please wait a little, I'd like to show a patch for bug#35702 that can
>>> also provide a basic for the same distinction in functionality but without
>>> this variable.
>>
>> OK.
>
> Please see the latest commits.
Thanks, I tried xref revert and it works fine.
Also I agree with Eli regarding the command name,
documentation and NEWS.
> In particular, there is now a xref-show-definitions-function.
>
> So in addition to display-buffer-alist, you can change it to give
> xref-find-definitions a particular behavior.
But I don't want to write a new function. I just need to check
if the xref buffer was created by a particular command.
If the solution requires writing a new function, then much easier
would be to use 'advice-add':
(advice-add 'xref-find-definitions :after
(lambda (&rest _args)
(with-current-buffer (window-buffer)
(setq-local xref--original-command 'xref-find-definitions))))
> Or to propose a new default behavior, suggest a patch for
> xref--show-defs-buffer. It could do its own things instead of delegating to
> xref--show-xref-buffer, i.e. use a distinct new major mode and somewhat
> different keymap. And also call pop-to-buffer with different arguments.
If despite a chain of indirections, xref still can't distinguish
different commands that created the xref buffer, I'd rather close
this feature request and use 'advice-add' in customization.
next prev parent reply other threads:[~2019-05-24 18:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-14 20:53 bug#35737: xref--original-command Juri Linkov
2019-05-15 1:07 ` Dmitry Gutov
2019-05-15 21:04 ` Juri Linkov
2019-05-15 22:30 ` Dmitry Gutov
2019-05-16 19:58 ` Juri Linkov
2019-05-24 1:59 ` Dmitry Gutov
2019-05-24 18:40 ` Juri Linkov [this message]
2019-05-24 22:48 ` Dmitry Gutov
2019-05-27 19:59 ` Juri Linkov
2019-05-27 21:13 ` Dmitry Gutov
2019-05-27 23:21 ` Dmitry Gutov
2019-05-28 2:41 ` Eli Zaretskii
2019-05-28 7:46 ` Dmitry Gutov
2019-05-28 15:01 ` Eli Zaretskii
2019-05-28 20:30 ` Juri Linkov
2019-05-30 17:33 ` Dmitry Gutov
2019-06-09 23:44 ` 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=87r28nenzk.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=35737@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.