The current indicators are hard-coded, with the only configurable details being the symbols in citar-symbols, and the space between them in citar-symbol-separator.
This makes all of it configurable by adding:
citar-indicators variable; a list of plist indicator specs
citar--make-indicator-processors function (creates a list of plists with the needed properties, including the compiled predicate functions)
citar--make-indicators-tags and citar--make-indicator-symbols functions
add indicator variables, and a new wiki page with others
BREAKING CHANGE: citar-symbols will be deprecated in favor of citar-indicators
Close: #601
Status
From what I can tell, everything works correctly; this example removes the links indicator, and uses default for files, and icons for notes:
And while I haven't benchmarked, I don't believe this should be any slower.
Aside: I had an idea to extend this later so people can separately configure left (what we do now) and right sides of the affixation.
I think I may turn citar-indicators into a defcustom, but later.
In the second commit I switched to using a cl-defstruct for the citar-indicator type. Maybe a tad overkill, but it mirrors what we do with citar-cache, and it provides some advantages from a coding POV. I've made this function public to encourage people to use it in their configs.
@andersjohansson with some help, I figured out the code for this. When I merge this, you could use it for #744.
The current indicators are hard-coded, with the only configurable details being the symbols in
citar-symbols
, and the space between them incitar-symbol-separator
.This makes all of it configurable by adding:
citar-indicators
variable; a list of plist indicator specscitar--make-indicator-processors
function (creates a list of plists with the needed properties, including the compiled predicate functions)citar--make-indicators-tags
andcitar--make-indicator-symbols
functionsBREAKING CHANGE:
citar-symbols
will be deprecated in favor ofcitar-indicators
Close: #601
Status
From what I can tell, everything works correctly; this example removes the links indicator, and uses default for files, and icons for notes:
And while I haven't benchmarked, I don't believe this should be any slower.
Aside: I had an idea to extend this later so people can separately configure left (what we do now) and right sides of the affixation.
I think I may turn
citar-indicators
into a defcustom, but later.In the second commit I switched to using a
cl-defstruct
for thecitar-indicator
type. Maybe a tad overkill, but it mirrors what we do withcitar-cache
, and it provides some advantages from a coding POV. I've made this function public to encourage people to use it in their configs.@andersjohansson with some help, I figured out the code for this. When I merge this, you could use it for #744.