myLeoSettings.leo are read twice

69 views
Skip to first unread message

rengel

unread,
Nov 8, 2025, 12:52:01 AMNov 8
to leo-editor
Why are myLeoSettings.leo are read twice in a row?

Leo Log Window
Leo 6.8.7, October 11, 2025
Python 3.14.0, PyQt version 6.9.2
Windows 11 AMD64 (build 10.0.26200) SP0
      home: C:\Users\rengel
leo-editor: C:\venvs\leo\Lib\site-packages
      load: C:\venvs\leo\Lib\site-packages\leo\core
    config: C:\venvs\leo\Lib\site-packages\leo\config
reading settings in C:\venvs\leo\Lib\site-packages\leo\config\leoSettings.leo
reading settings in C:\Users\rengel\.leo\myLeoSettings.leo
reading settings in C:\Users\rengel\.leo\myLeoSettings.leo

read outline in 0.00 seconds

I'm using Leo 6.8.7.

Edward K. Ream

unread,
Nov 8, 2025, 6:16:09 AMNov 8
to leo-e...@googlegroups.com
On Fri, Nov 7, 2025 at 11:52 PM 'rengel' via leo-editor <leo-e...@googlegroups.com> wrote:

Why are myLeoSettings.leo are read twice in a row?

Excellent question.

Leo always reads at least one .leo file twice. For example:

reading settings in C:\Repos\leo-editor\leo\config\leoSettings.leo
reading settings in C:\Users\Dev\.leo\myLeoSettings.leo
reading settings in C:\Users\Dev\ekr.leo  # My local file, read only for its settings.
reading settings in C:\Users\Dev\.leo\EKRWindowsDark.leo
reading settings in C:\Users\Dev\ekr.leo  # My local file, read for its entire content.

The reason is complicated, but the general idea is that Leo must read all your settings files before reading the files on the command line (or the equivalent of the command line, as with sessions). So Leo will read myLeoSettings.leo twice if you are editing myLeoSettings.leo explicitly.

The load process (including loading settings files) probably will not (can not!) ever change. The code in question is the LoadManager class in leoApp.py.

Edward

rengel

unread,
Nov 8, 2025, 7:42:39 AMNov 8
to leo-editor
Thanks for the explanation!

jkn

unread,
Nov 8, 2025, 8:13:11 AMNov 8
to leo-editor
Shouldn't the log message for the second read of ekr.leo be different then?

reading *settings* in C:\Users\Dev\ekr.leo  # My local file, read for its entire *content*.


Edward K. Ream

unread,
Nov 8, 2025, 12:58:59 PMNov 8
to leo-e...@googlegroups.com
On Sat, Nov 8, 2025 at 7:13 AM jkn <jkn...@nicorp.co.uk> wrote:
Shouldn't the log message for the second read of ekr.leo be different then?

reading *settings* in C:\Users\Dev\ekr.leo  # My local file, read for its entire *content*.

Maybe. I'll look into it. If it's wrong there is no reason not to fix it. Thanks for this question.

Edward

Edward K. Ream

unread,
Nov 8, 2025, 1:13:04 PMNov 8
to leo-editor
The message appears to be fine. Whether the call that generates the message is necessary is another matter.

Having said that, I suspect the code is correct as it stands.

Edward

Thomas Passin

unread,
Nov 8, 2025, 4:38:26 PMNov 8
to leo-editor
I thought those comment-messages were added by Edward to explain the purpose of each read.  I don't see any of them, and the one comment string I searched for is not in the code base. I only see a single load message for each file, except for the first outline opened, which gets four:

reading settings in C:\Tom\git\leo-editor\leo\config\leoSettings.leo
reading settings in C:\Users\Tom\.leo\myLeoSettings.leo
reading settings in C:\Users\Tom\.leo\themes\tbp_dark.leo
reading settings in C:\Users\Tom\.leo\workbook.leo


jkn

unread,
Nov 8, 2025, 5:52:09 PMNov 8
to leo-editor
Yes, I presume so too (comments added by Edward). My point is that the string says 'reading settings', and Edward seems to be saying that in fact the content is being read.

    J^n

Thomas Passin

unread,
Nov 8, 2025, 8:18:49 PMNov 8
to leo-editor
That seems all right to me. If Leo reads the settings by ingesting the file, to me it's still reading the settings.

jkn

unread,
Nov 9, 2025, 4:50:11 AMNov 9
to leo-editor
We seem to be talking at cross-purposes. I was talking about what the second prompt should say. One might expect logs like: (leaving EKR comments in)

reading settings in C:\Users\Dev\ekr.leo  # My local file, read only for its settings.
...
reading C:\Users\Dev\ekr.leo  # My local file, read for its entire content.

But sheesh, I appreciate this is all small beer...

Edward K. Ream

unread,
Nov 9, 2025, 11:33:37 AMNov 9
to leo-editor
On Sunday, November 9, 2025 at 3:50:11 AM UTC-6 jkn wrote:

... One might expect logs like: (leaving EKR comments in)

reading settings in C:\Users\Dev\ekr.leo  # My local file, read only for its settings.
...
reading C:\Users\Dev\ekr.leo  # My local file, read for its entire content.

But sheesh, I appreciate this is all small beer...

Yes, it's small beer, but the question deserves a satisfactory answer. However, the details are subtle.

First, let me point out that every file is read independently of all others (iirc). For example, if (on the command line) I do:

> leo a.leo b.leo

Then Leo re-reads all settings files. It almost has to do this, except maybe for leoSettings.leo. But I don't know this for sure. It's only a guess.

Second, the title of each tab of Leo's window tells what local file Leo read to create the tab. In our example, the tabs' titles will start with a.leo and b.leo, with a further indication of where each .leo file resides. So there is no particular reason for Leo to announce (in the log) which local file Leo is reading, or has read. It wouldn't be wrong to make an entry in the Log, but at present Leo doesn't.

In short, I think Leo is reporting enough. But I can see that careful readers of Leo's log might have questions. I'm going to think further about this question.

Edward

Thomas Passin

unread,
Nov 9, 2025, 1:26:12 PMNov 9
to leo-editor
As I wrote earlier, I don't see log messages for reading any files except the ones read for their settings. I think that's fine because after reading settings, if the subsequent read for content failed to produce a tab labeled with the file name, it would also fail to create a log pane so there would be no log message at all.

For all outlines except the first to be opened, I get no log messages about reading LeoSettings.leo, myLeoSettings.leo, or the theme.  This makes me think they don't get read again.  For example, I opened Leo with two outlines on the command line.  For the first (the workbook), I got this in the log:

      home: C:\Users\Tom
leo-editor: C:\Tom\git\leo-editor
      load: C:\Tom\git\leo-editor\leo\core
    config: C:\Tom\git\leo-editor\leo\config

reading settings in C:\Tom\git\leo-editor\leo\config\leoSettings.leo
reading settings in C:\Users\Tom\.leo\myLeoSettings.leo
reading settings in C:\Users\Tom\.leo\themes\tbp_dark.leo
reading settings in C:\Users\Tom\.leo\workbook.leo


For the second one, which contains no settings, I didn't get any log message about opening an outline.  However, if I open the same file from the File/Open Recent Files menu, I do get a message:

reading settings in C:\tom\git\gf4-project\gf4\gf4.leo

Edward K. Ream

unread,
Nov 9, 2025, 3:27:27 PMNov 9
to leo-e...@googlegroups.com
On Sun, Nov 9, 2025 at 12:26 PM Thomas Passin <tbp1...@gmail.com> wrote:

For all outlines except the first to be opened, I get no log messages about reading LeoSettings.leo, myLeoSettings.leo, or the theme.  This makes me think they don't get read again. 

Thanks for this comment. I expect you are correct.

Edward

lewis

unread,
Nov 10, 2025, 7:20:07 AMNov 10
to leo-editor
Why does the @font setting of the last opened leo file get applied to all open leo files?
I reproduced this with 3 files A1.leo, A2.leo and A3.leo.
Only file A3.leo has @settings node: @string font-family = Helvetica

When all 3 files load the font setting of @string font-family = Helvetica is applied to all 3 open files, not just A3.leo

I expect the settings should be determined by the myLeoSettings.leo file and the specified theme file, not by an unrelated file.
Is this the intended behaviour or a bug?

lewis

unread,
Nov 10, 2025, 7:32:16 AMNov 10
to leo-editor
I have just read 'Search order for settings files' https://leo-editor.github.io/leo-editor/customizing.html#id3
which seems to confirm the behaviour I described above is intended.

Edward K. Ream

unread,
Nov 10, 2025, 10:16:28 AMNov 10
to leo-e...@googlegroups.com
On Mon, Nov 10, 2025 at 6:32 AM lewis <lewi...@fastmail.com.au> wrote:
I have just read 'Search order for settings files' https://leo-editor.github.io/leo-editor/customizing.html#id3
which seems to confirm the behaviour I described above is intended.

Oh good :-) In any case, the details of loading Leo files are not going to change in any functional way.

Edward
Reply all
Reply to author
Forward
0 new messages