[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "Non-standard UI"
Re: "Non-standard UI"
Sun, 8 Mar 2020 12:38:00 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0
On 08.03.2020 2:53, Juri Linkov wrote:
rgrep/vc-git-grep provides good UI.
No, it doesn't. It's the bare-bone-est UI possible, and it wastes a lot of
horizontal space. It doesn't provide a means to search-and-replace. And
it's not fit for programmatic construction, so Xref can't use it.
If you don't like the grep output format, you can replace 'grep-filter'
with your own process filter that would transform it to any other format.
Or I can reuse the existing code.
The suggestion is not bad, but the grep-filter approach isn't going to
work for Xref, at least, because the data format is a list of values.
And there's not much point in writing code to re-create Xref's UI in yet
another way, if it can't replace the existing builder.
Overall, grep itself is fast, and we've done enough optimization on the
way its results are processed that it being synchronous shouldn't be a
significant problem on modern systems with small-to-medium projects, at
least. But, of course, we could do better.
We already had 2 different formats: grep and occur, and now came a new
3rd format: xref. I think any attempt to standardize on the output format
should be welcome.
Of course. But that would take some concerted effort, and not a
All three have some valuable features (Occur's inline editing feature
comes to mind), but they also have each own domain of application thus
far. So it would require work to make the features work everywhere (e.g.
have Occur's inline editing work without visiting all files in advance).
Of course, a general UI should be customizable enough
to provide look and feel of any of the current formats.
So far, Xref provides variables xref-show-xrefs-function and
xref-show-definitions-function, and I know for a fact that there are
third-party packages out there that take advantage of these variables.
Why not take the best parts from these contenders?
Take async part of finding matches from grep and
transform its output to any format you like.
I surely wouldn't refuse an extension of Xref API to asynchronous
fetching of results. It's unlikely to work though grep-filter, though.