Subject: Re: bug#35737: xref--original-command

From: Dmitry Gutov <[email-masked]>
Date: Sat, 25 May 2019 01:48:28 +0300

On 24.05.2019 21:40, Juri Linkov wrote:

> Thanks, I tried xref revert and it works fine.
> Also I agree with Eli regarding the command name,
> documentation and NEWS.

Should be good now.

> 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.

I think you need to make a choice here.

Do you want to customize your personal Emacs, or do you want to improve 
the default behavior?

If it's the former, I think the advice you posted will work as well as 
any other solution.

I was kind of expecting the latter.

> 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.

Do we really need to be able to distinguish between xref-find-references 
and project-find-regexp as well?

TBH, xref--original-command is easy to add, but then we'll have an 
internal variable that isn't used anywhere. Somebody will just delete it 
someday.