Hello, "Bruce D'Arcus" <bdar...@gmail.com> writes:
> On Fri, Jul 2, 2021 at 4:05 PM Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote: >> That's expected. "nil" is the name of the processor's fall-back style, >> ignoring any inheritance. It is different from the empty style (""), >> which takes into account inheritance. > > Two things: > > First, after adding a style, I can't see how to subsequently remove it > using this interface, to just have "[cite:@key]". Is that possible? Of course. Just select the empty string instead of an entry. It is done with C-j on Selectrum and `completing-read-default'. I assume this is the same on other completion frameworks. > In my formatting function for OC, which is simpler than your's in some > ways, I have a named "default" style, with that as the > ido-completing-read "initial-value", which is then removed if > selected. > > In practice, what that means is if the user is prompted for the style > but hits return, they select "default", and hence the result is > "[cite:@key]". Your "default" is equivalent to my empty string. But one day, an export processor may use "default" as a name for a different style. Who knows? Moreover, "default" may be ambiguous: does it mean user's or processor's default style? More importantly, we have to deal with the empty string anyway; this is a valid return value from `completing-read'. > Second, the "nil" vs "empty" distinction was obviously not immediately > intuitive to me. I don't have a better name for "nil" ATM though, so > maybe it will be fine. Hopefully people won't have the need to use it > much. Both are necessary. At some point, this will have to be documented. Regards, -- Nicolas Goaziou