On Thursday 07 December 2000 14:12, Jean-Marc Lasgouttes wrote:
> >>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
>
> Angus> Ideally, minibuffer citation-insert foo would call
> Angus> LFUN_CITATION_INSERT, but the string passed has a different
> Angus> format to that passed from FormCitation::apply(). Could change
> Angus> the string passed from the minibuffer, but would then also have
> Angus> to edit the sources of pybibliographer which emulates the
> Angus> minibuffer here.
>
> What is the difference in syntax?
Type citation-insert foo|bar in the minibuffer
This is passed to LFUN_CITATION_CREATE:
as "foo|bar"
where it is used to set InsetCommandParams p:
p.setCmdName("cite");
p.setContents( token(argument, '|', 0) );
p.setOptions( token(argument, '|', 1) );
This is then converted to a string:
p.getAsString();
and passed (originally to the popup, now to LFUN_CITATION_INSERT)
LFUN_CITATION_INSERT recieves this string, either from LFUN_CITATION_CREATE
or from the popup and unravels it:
InsetCommandParams p;
p.setFromString( argument );
And then creates the inset:
InsetCitation * inset = new InsetCitation( p );
Ideally, the minibuffer should pass the string as p.getAsString();
Its format is:
p.cmdname + "|++|" + p.options + "|++|" + p.contents;
Using the getAsString(), setFromString() has better encapsulation and is the
way to go I think. If we could do this in the minibuffer --- fine. But we
would have to do it in pybibliographer too.
A.