Jean-Marc Lasgouttes wrote:
"Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:
Abdelrazak> Note that Richard asked for comment at the time.
Sure, but he did not point to this particular "feature" :)
I'm pretty sure he did:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg120884.html.
Indeed, how to define the optional argument was one of the major issues.
(The other option was a new LFUN.) And while I'm prepared to believe
that this is "not how we define arguments", "|" is used as a delimiter
for an optional argument in the code just preceding this:
case LFUN_CITATION_INSERT: {
BOOST_ASSERT(lyx_view_);
if (!argument.empty()) {
// we can have one optional argument, delimited by '|'
// citation-insert <key>|<text_before>
// this should be enhanced to also support text_after
// and citation style
string arg = argument;
string opt1;
if (contains(argument, "|")) {
arg = token(argument, '|', 0);
opt1 = token(argument, '|', 1);
}
InsetCommandParams icp("cite");
icp["key"] = from_utf8(arg);
if (!opt1.empty())
icp["before"] = from_utf8(opt1);
string icstr = InsetCommandMailer::params2string("citation",
icp);
FuncRequest fr(LFUN_INSET_INSERT, icstr);
dispatch(fr);
} else
dispatch(FuncRequest(LFUN_DIALOG_SHOW_NEW_INSET, "citation"));
break;
}
That's where I got the idea.
Richard
--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto