On Tue, 16 Dec 2003, Angus Leeming wrote:

> Christian Ridderström wrote:
> > Speaking of that, I used my script to see how the lfuns have changed
> > between the recent releases. The lfuns for Lyx 1.3.1 - 1.3.3 are the
> > same, but the n:o lfuns has dropped from 241 to 238 in the latest
> > CVS. However, the n:o lfuns in
> > 
> > 1.3.3 is...                   241
> > HEAD is...                    238
> > both 1.3.3 and HEAD is...     206
> 
> Which indicates two things:
> 1. Some lfuns are becoming more powerful. You can do more from 
> outside lyx 1.4.x than you could from outside lyx 1.3.x with fewer 
> lfuns.
> 2. We make no effort to translate old-style lfuns to new style lfuns.
> 
> I have been thinking for a while of an lfun2lfun script. As an 
> example:
> 
> citation-insert -> dialog-show-new-inset citation

What would this lfun2lfun-script operate on? (Or do you mean that it would 
act like a filter on commands typed in the mini-buffer, see what I wrote 
in the end?)

> inset-apply citation LatexCommand \citeN[see]{leeming2003}
> 
> an aside: I should strip out the part handled by the buffer (as 
> oppossed to the inset), "LatexCommand" here...

huh? (guess I can ignore this)

> The point I'd like to make is that this lfun syntax is powerful but 
> cumbersome. I can imagine an lfun2lfun script that generated such 
> commands from simpler input by the user.
> 
> That way, LyX will have to handle fewer lfuns and the user will still 
> have his syntactic sugar.

This might be what you already suggest, but how about allowing 
'lfun-macros' (i.e. translations) to be defined in an external text file. 
It could look like this:

        lfun-define  "citation-insert" "dialog-show-new-inset citation"

which would mean that when the mini-buffer receives 'citation-insert', it 
will look through the text file (or a loaded database) for translations 
and apply them. In addition, if the user can edit this text file, he will 
be able to create new lfuns as well.

/Christian

-- 
Christian Ridderström                           http://www.md.kth.se/~chr


Reply via email to