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

From: Dmitry Gutov <[email-masked]>
Date: Tue, 28 May 2019 00:13:34 +0300

On 27.05.2019 22:59, Juri Linkov wrote:

> Thanks.  I wonder why you renamed xref--revert-xref-buffer
> to a such strange name xref-refresh-results?  Why not simply
> xref-revert-buffer?

Strange?

I had to think how to describe the new command in NEWS, and these are 
the terms I came up with. Hence the name. Do you not think these words 
are appropriate?

"revert buffer" sounds like undoing changes, and we're repeating a 
search and refreshing (or maybe reloading) the results.

> The goal was to improve the default behavior to make customization easier.

That's why I added xref-show-definitions-function.

Customizing display-buffer-alist is an arcane art. The hook this 
variable provides should be easier to understand for an average user.

So, to clarify, you're not interested in changing the *visible* default 
behavior, at least for now?

>> 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.
> 
> The idea was to make xref more customizable differently for different
> commands: xref-find-definitions, xref-find-references, project-find-regexp.

I get the idea, but not the goal. I know why we'd want to make 
xref-find-definitions and project-find-regexp to behave differently. The 
rest, I'm not so clear.

Anyway, I was hoping my efforts in improving the default behavior would 
benefit your goals as well, but it seems the split between 
xref--show-xrefs and xref--show-defs goes against them. That's too bad.

You still have your alternative solution, though.