[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [wip-cite-new] Quick note about citation insertion

From: Nicolas Goaziou
Subject: Re: [wip-cite-new] Quick note about citation insertion
Date: Sat, 03 Jul 2021 11:20:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)


"Bruce D'Arcus" <bdarcus@gmail.com> writes:

> On Fri, Jul 2, 2021 at 4:05 PM Nicolas Goaziou <mail@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.

Nicolas Goaziou

reply via email to

[Prev in Thread] Current Thread [Next in Thread]