On 05/31/2017 12:55 AM, Jürgen Spitzmüller wrote:
> Am Dienstag, den 30.05.2017, 15:11 -0400 schrieb Richard Heck:
>>> OK. Thanks. Since this is used as a session setting, we might have the 
>>> unwanted side-effect that it is now off by default for everybody starting 
>>> LyX 2.3 with an old document.
>>  
>> But it was off by default, anyway, I believe, since the default for literal 
>> is false. That's how I got the non-literal insets that started this thread.
> I mean the reverse. If people start with an old document, their session will 
> default them to "literal".

I see what's worrying you.

The way I did the code, what we record are only *manual* changes to the
'literal' value. Simply opening a dialog that has literal checked does
not change the recorded setting. If you *manually* set or unset it, then
we will remember that, and that will become the default. So we are not
really remembering the last value that was 'used', but only the last
value that was 'set'. This seems right to me. Just because I happen to
open the one citation in which I do not have 'literal' set, to modify
something else, shouldn't mean that becomes the default.

Note also that we only use the remembered value for 'new' citations
(which we detect by seeing if the key field is empty).

I still think that people are going to run into the same problem I did:
a mix of literal and non-literal dialogs causing unexpected output. So,
in fact, I think it would be best if, for old documents (at least), we
did default to 'literal'. But we don't do that now. We could perhaps do
this by checking the original file format, which is held by Buffer.cpp.
Even then, though, once the document has been saved and re-opened, so is
now in 2.3 format, manual action will have to be taken to avoid the
mentioned problem.

Richard

PS It's probably too late for this, but is there really a good use case
for mixing 'literal' and 'non-literal' citations in a single document?
I.e., might this not make more sense as a document-level setting?

Reply via email to