rgheck <[EMAIL PROTECTED]> writes:

> Here's why I'm unhappy with the patch. It's simple in a way: We have a
> vector of commands to execute rather than just one---that was the
> first problem. So now you could do something like:
>   lyx -x "file-open /tmp/branchTest.lyx" -x "buffer-end" -x 
> "break-paragraph" -x "self-insert This is so cool!"
> with the expected results.

This is indeed cool.

> BUT this will not work when we are exporting. The reason is that when
> you use the export feature, LyX calls Bufer::dispatch() rather than
> (say) lyx::dispatch(), and the only thing that previously got handled
> in Buffer::dispatch() is LFUN_BUFFER_EXPORT. So to get branch
> activation and de-activation to work when we're exporting, I had to
> put those in Buffer::dispatch()

It is a very good idea to put all the things that are buffer-specific
in Buffer::dispatch(). We should arrange to have this method called
from LyXFunc::dispatch() (look at the default branch of the big
switch). I think it is even possible to make LyXFunc::dispatch work
properly when there is no view, but this is probably more work.

> ---and then call them from Text::dispatch() so they'll work
> normally. 

Huh? In the current situation, the best would be BufferView::dispatch,
actually. This is relevant for all actions that are global to the
current document being edited. Text::dispatch() is for actions that
are relevant when the cursor is in a paragraph.

> This does not look pretty---though maybe there are so few things
> you'd actually want to do when exporting that it's OK. I don't know.
> But maybe you might want to alter some of the other buffer params
> (say, line spacing) before you export.

Yes.

JMarc

Reply via email to