> We have 'lastfiles' and 'lastpos' as configurable filenames, I am not
> sure that they should be. IMHO we should just hardcode them. Opinions
> on that?

I just tried to make features of lastpos parallel to lastfiles. I do
not think these filenames need to be configured. lastfile::dostat may
not be needed either. Sure, people may lose lastfile entries under
some special circumstances but we donot have to worry too much about
those cases.

I think lastpos is a better name to this feature, should I change
everything from fileposition to lastpos?

> | 1. Alt-F4 and close-button do not trigger LDUNC_QUIT or bufferClose()
> | so position will not be saved. Note that Alt-F4 is marked as a
> | shortcut for File->Exit but it behaves differently than File->Exit.
>
> This not triggering, is it the same on all frontends?

I do not know. I am using RHEL4 + KDE 3.3. I think Alt-F4 is
intercepted by KDE and passed to the application as the same event as
close-button.

> | 2. If a filename is passed to lyx as 'lyx file.lyx', the cursor will
> | be moved by my patch, but then moved back by some unknown mechanism
> | (seems to be some GUI stuff). This is a big drawback since this is the
> | main way I start lyx.
>
> Ok, we need to investigate a bit.
> Could it be that a ->setCursor is also called later, so that your
> setting is overwritten?

I found that loadLyXFile is called in frontend/qt2/lyx)gui.C but can
not trace further. I think some other event is called after it.

> Also, is the clearSelection ever needed? This is upon file load. Can a
> selection ever be set?

Maybe not. I tried to mimic restorePosition, and I kept this line for
safety reasons.

> As said I don't like this mix of features, but as it is strictly an
> internal thing, let's handle that one later.

Using bookmark[0] has the advantage that other bookmarks[0] usages
will also be saved. They are often related to buffer change (?).

> space before '&' please
> ditto
> no space before '>'
> space before '&'
> ditto

Over the years, I have formed a bad habit of relying on bcpp to format
my code, so I do not have to worry about indent too much during
coding. I know bcpp is not powerful enough for fine formatting, but
there are tools over there. Have you thought of recommending one
program with a specified set of options to be applied to lyx source
code automatically? Then new comers like me do not have to worry about
such details.

Regarding the robustness you mentioned later. I think regex and
tokenizer (I use both myself) are overkill for such a simple case. My
coding style is a try/catch block around the existing code and ignore
wrong lines silently. I overheard, however, that exceptions is/was not
used by lyx...

Talking about robustness, I remember that I once used a 1.4.x layout
file for lyx 1.3.7. Lyx crashed silently. I do think we should have
better handling of errors in 1.4.x.

Cheers,
Bo

Reply via email to