Closed Hugo-Heagren closed 2 years ago
Yeah, I agree that would make sense, at least as an option.
A filter takes the alist of each entry and uses that to check if the search-for value is contained in the entry. That avoids the overhead of having to go through ebib-db-get-field-value
for each field in an entry.
Currently, ebib--filters-run-filter
uses ebib-db-get-entry
to get the entry. One could use ebib-get-entry
instead and see if the extra overhead is noticeable or not. If it is, it could be an option that is off by default, if it isn't, it could be on by default (or not be an option at all).
Well, on my definitely low-end laptop and a modestly-sized .bib
file (1248 entries), it doesn't seem to make filtering much slower.
I do think it should be an option, though, and I'm not entirely convinced it should be on by default. Consider the case where you are filtering on some search term in any
field. If a Collection
has the search term in its title, all papers in that Collection are going to turn up in the filter.
So perhaps this should be an option, and perhaps it should be possible to toggle its setting when a filter is active. (Though of course it should have a user-customisable default setting as well.)
So perhaps this should be an option, and perhaps it should be possible to toggle its setting when a filter is active. (Though of course it should have a user-customisable default setting as well.)
Good thinking -- this sounds like the way forward.
Does this do what you imagine:
Does this do what you imagine:
Perfect! And I especially like the interactive command to toggle the behaviour -- nice touch.
Merged.
I have two entries:
The second inherits its author from the first, and this shows up correctly in the entry buffer if I view it. However, if I filter the database by author for "clark", only the first entry shows up. I think this is because the author isn't explicitly included in the second entry. This seems like a bug to me: the filter should respect inheritance.