Re: does @path ... @clean directory have to exist?

2024-10-02 Thread jkn
Ah, thanks Thomas.
The docs were not clear (to me). I wonder if I had that setting enabled 
in a previous setup, and that is why I had a memory of it working 
differently.

I think the error message might be a bit clearer; I will try to look into 
that.

Regards
J^n


On Wednesday, October 2, 2024 at 12:12:28 AM UTC+1 tbp1...@gmail.com wrote:

> I think there is a setting (of course!) to say whether Leo should create 
> missing paths. [Checks settings outline].  Yes, here it is:
>
> @bool create_nonexistent_directories = True
>
> On Tuesday, October 1, 2024 at 7:02:29 PM UTC-4 jkn wrote:
>
>> I was going to write a question about how to determine the path of a node 
>> under an @path node, since for this is not behaving as I'd expect...
>>
>> ... but whilst trying to create the simplest example, I was reminder that 
>> there must be something about the @path & @file (specifically @clean in 
>> this case) facility that I don't understand.
>>
>> To encapsulate this parts of my question ... does the directory (as given 
>> by an @path node(s), and child @clean nodes, have to exist, before the file 
>> contents are written?
>>
>> I always thought that the directory was created if it didn't exist ... 
>> but now I am not so sure.
>>
>> Thanks, J^n
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/9e1dc529-88b1-40c7-8fb4-8f9dc76211a8n%40googlegroups.com.


does @path ... @clean directory have to exist?

2024-10-01 Thread jkn
I was going to write a question about how to determine the path of a node 
under an @path node, since for this is not behaving as I'd expect...

... but whilst trying to create the simplest example, I was reminder that 
there must be something about the @path & @file (specifically @clean in 
this case) facility that I don't understand.

To encapsulate this parts of my question ... does the directory (as given 
by an @path node(s), and child @clean nodes, have to exist, before the file 
contents are written?

I always thought that the directory was created if it didn't exist ... but 
now I am not so sure.

Thanks, J^n

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/56bfaa67-69a0-47b4-9d5e-074274977d7cn%40googlegroups.com.


Re: Embedding An External Program In Leo - Proof Of Principle

2024-09-11 Thread jkn

OT-ish: that view of the HP42s ('Free42' or whatever) looks an awful lot 
better there than it does on my android phone, for some reason...

On Wednesday, September 11, 2024 at 4:43:58 AM UTC+1 tbp1...@gmail.com 
wrote:

> I have solved the problem of the calculator not getting keypresses, and 
> let me tell you it was tricky.  The problem is that Windows does not know 
> that Qt thinks that *it* (Qt) is managing the focus.  Instead, The OS feeds 
> mouse events directly to the calculator when it is visibly on top.  But it 
> doesn't do that for keypresses. Here is how I worked around the problem:
>
> When the calculator native window gets embedded into a Qt container 
> object, we then overlay a transparent Qt widget over it. When Qt detects a 
> mouse click on the overlay, it notifies the OS to focus the calculator 
> window.  When the Qt focus switches away, Qt notifies the OS that the 
> calculator window no longer has focus.
>
> This actually works in my test program. I could not have done this without 
> the help of ChatGPT, or at least it would have taken way longer and have 
> been very frustrating. I had already learned that there are some 
> incompatibilities that affected key handling between Qt-managed windows and 
> OS-managed ones and that some people had been struggling with them.  
> ChatGPT knew about the OS/Qt focus incompatibility and it knew how to call 
> the right Windows functions from within the program.  But it needed a lot 
> of guidance from me, including the idea of the transparent overlay.  The 
> whole story is a saga that I will post about separately.
>
> I don't know how hard it will be to adapt the approach to Linux.  It 
> probably won't be too hard for the X11 system, but more and more distros 
> are changing over to Wayland and that is very different.  I'm not sure I 
> will tackle it. Getting this HP calculator, which is Windows-only,  into 
> Leo satisfies my immediate desire.
>
> On Sunday, September 8, 2024 at 9:19:43 AM UTC-4 Thomas Passin wrote:
>
>> I have been able to embed an external (non-Leo, non-Python) application 
>> in a Leo window. The attached screen shot shows an HP-42 Reverse Polish 
>> Calculator program running in Leo's main splitter. This program uses an 
>> image of real HP-42 hand-help calculator, as you can see. The calculator 
>> program is not my own work; it has been around for a long time. If I had 
>> known how to embed it, I might not have adapted the RPCalc code to use with 
>> Leo.  The HP-42 is much better.
>>
>> This is a proof of principle and everything isn't quite right yet.  The 
>> calculator responds to mouse presses but it isn't getting the focus and so 
>> doesn't get keypresses as yet.
>>
>> I'm not sure what kinds of external programs will be useful this way. A 
>> spreadsheet might  be interesting but they usually need to have a large 
>> window so it wouldn't work to confine it in part of Leo's window.  The 
>> calculator is useful because I sometimes want to calculate some numbers and 
>> it's convenient to do it within Leo.  You could do an image viewer but it 
>> would be tricky to get it to work with Leo's data. And there are one or 
>> more Leo scripts or plugins for viewing images already, including VR3 if 
>> you want to write down a bit of RestructuredText or Markdown. Or you can 
>> paste the full path to an image file into the body and CTRL-Click it. So 
>> there are many ways to handle viewing images already.
>>
>> A small-size paint or drawing program might be interesting.
>>
>> Anyway, I hope this post will stimulate some ideas.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/c1056bac-6290-43f8-ac03-3bc2c264b8dfn%40googlegroups.com.


Re: How The Mighty Have Fallen, Python Edition

2024-08-13 Thread jkn
Yes, I realise this, and ... share some of the sentiment. I was intending 
to add a little background
regarding Tim Peters in particular.


On Tuesday, August 13, 2024 at 8:34:54 PM UTC+1 tbp1...@gmail.com wrote:

> The "Mighty" in my title of this conversion didn't refer to Tim, but to 
> the old Python way, which seems to becoming taken over by the  steering 
> committee/bureaucracy. Maybe this has something to do with my frustration 
> with Python getting more and more complicated very quickly.
>
> On Tuesday, August 13, 2024 at 3:26:03 PM UTC-4 jkn wrote:
>
>> I read about this in the irreverent UK-based (originally, at least) 
>> online IT magazine The Register.
>>
>> I was a bit flabbergasted/outraged, at least initially. TimOne is 
>> probably the Python 'guru' I
>> have followed most closely, in the 25 years or so since I started writing 
>> Python.
>>
>> Tim actually posts in the comment section. His comment is worth a read;
>> it is his usual measured and calm self and gives at least a measure of 
>> perspective lacking
>> elsewhere.
>>
>>
>> https://www.theregister.com/2024/08/09/core_python_developer_suspended_coc/
>>
>> J^n
>>
>>
>> On Tuesday, August 13, 2024 at 4:45:02 PM UTC+1 tbp1...@gmail.com wrote:
>>
>>> https://chrismcdonough.substack.com/p/the-shameful-defenestration-of-tim
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/f0d0099c-f90a-4b28-bb62-2d02d826a22dn%40googlegroups.com.


Re: How The Mighty Have Fallen, Python Edition

2024-08-13 Thread jkn
I read about this in the irreverent UK-based (originally, at least) online 
IT magazine The Register.

I was a bit flabbergasted/outraged, at least initially. TimOne is probably 
the Python 'guru' I
have followed most closely, in the 25 years or so since I started writing 
Python.

Tim actually posts in the comment section. His comment is worth a read;
it is his usual measured and calm self and gives at least a measure of 
perspective lacking
elsewhere.

https://www.theregister.com/2024/08/09/core_python_developer_suspended_coc/

J^n


On Tuesday, August 13, 2024 at 4:45:02 PM UTC+1 tbp1...@gmail.com wrote:

> https://chrismcdonough.substack.com/p/the-shameful-defenestration-of-tim
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/e5b9b609-1194-40be-bb60-c1a037654a84n%40googlegroups.com.


Re: what to call after changing body text, please?

2024-07-29 Thread jkn

I would like to better understand the 'philosophy' here ... (eg. of the 
widget wrappers within Leo in general...), but I have something that will 
do for me now, thanks

J^n

On Sunday, July 28, 2024 at 4:59:59 PM UTC+1 tbp1...@gmail.com wrote:

> The wrapper, w = c.frame.body.wrapper, is a member of c, not of the 
> body.  When you select a node, w gets filled with that node's body text.  
> So you have to transfer that modified text back to the node's body before 
> switching to a new node.
>
> On Sunday, July 28, 2024 at 10:40:49 AM UTC-4 jkn wrote:
>
>> indeed, I could do "get current body text/append to it /set new body 
>> text". But I am trying to learn the way that Leo does it, ie. the 
>> 'cleanest' way.
>>
>> On Sunday, July 28, 2024 at 3:18:43 PM UTC+1 tbp1...@gmail.com wrote:
>>
>>> "you" here is code in Leo's core. It's not mine.  I think the code is 
>>> changing text in the wrapper, w, and then retrieving all the text from the 
>>> wrapper and assigning it to p.b.  It seems a little strange to me too.  I 
>>> will say that I have never had text vanish when I assign it directly to p.b 
>>> so maybe that's the idea here.
>>>
>>> With that in mind you could also get p.b and do insertions on it using 
>>> ordinary string methods, then assign it back to p.b:
>>>
>>> i = 12  # insertion point
>>> original = p.b
>>> s = 'this is the insert'
>>> tail = original[i:]
>>> head = original[:i]
>>> new = head + s + tail
>>> p.b = new
>>>
>>> There's some difference regarding updating between assigning to p.b and 
>>> p.v.b but I forget what it is. It's mentioned somewhere in the docs.  
>>> Edward will probably chime in here with more definitive information.
>>>
>>> On Sunday, July 28, 2024 at 9:59:09 AM UTC-4 jkn wrote:
>>>
>>>> well ... yes, I have previously just totally **set** the body text (ie. 
>>>> I am creating a totally new node), and as you say this 'sticks'. For this 
>>>> new command, I want to add to any body text which is already there.
>>>>
>>>> But I am puzzled about what seems to be a mixture in this example:
>>>>
>>>> - you get the insertion point and then use w.insert() to write your 
>>>> text to ... the wrapper for the body?? 
>>>> - but then you do p.v.b = w.getAllText() to ... set the body text to 
>>>> ... that which you have just set for the body wrapper?
>>>>
>>>> I am missing something in the paradigm here...
>>>>
>>>> J^n
>>>>
>>>>
>>>> On Sunday, July 28, 2024 at 2:52:47 PM UTC+1 tbp1...@gmail.com wrote:
>>>>
>>>>> I think I forgot that the recommended way to do unto/redo has been 
>>>>> changed since I wrote that script. Also, you can directly set p.b or 
>>>>> p.v.b 
>>>>> and those changes will stick.  Here's one I found in Leo's code base that 
>>>>> does that and uses the newer undo system:
>>>>>
>>>>> def insertBodyTime(self: Self, event: LeoKeyEvent = None) -> None:
>>>>> """Insert a time/date stamp at the cursor."""
>>>>> c, p, u = self, self.p, self.undoer
>>>>> w = c.frame.body.wrapper
>>>>> undoType = 'Insert Body Time'
>>>>> if g.app.batchMode:
>>>>> c.notValidInBatchMode(undoType)
>>>>> return
>>>>> bunch = u.beforeChangeBody(p)
>>>>> w.deleteTextSelection()
>>>>> s = self.getTime(body=True)
>>>>> i = w.getInsertPoint()
>>>>> w.insert(i, s)
>>>>> p.v.b = w.getAllText()
>>>>> u.afterChangeBody(p, undoType, bunch)
>>>>>
>>>>> On Sunday, July 28, 2024 at 9:17:45 AM UTC-4 jkn wrote:
>>>>>
>>>>>> Thanks. Hmm, looks like I was wrong about onBodyChanged being 
>>>>>> outdated - there seem to be hardly any uses in Leo's source, which 
>>>>>> perhaps 
>>>>>> misled me.
>>>>>>
>>>>>> I removed my undo code from my example... ;-)
>>>>>>
>>>>>> Regards
>>>>>> J^n
>>>>>>
>>>>>>
>>>>>> On Sunda

Re: what to call after changing body text, please?

2024-07-28 Thread jkn
indeed, I could do "get current body text/append to it /set new body text". 
But I am trying to learn the way that Leo does it, ie. the 'cleanest' way.

On Sunday, July 28, 2024 at 3:18:43 PM UTC+1 tbp1...@gmail.com wrote:

> "you" here is code in Leo's core. It's not mine.  I think the code is 
> changing text in the wrapper, w, and then retrieving all the text from the 
> wrapper and assigning it to p.b.  It seems a little strange to me too.  I 
> will say that I have never had text vanish when I assign it directly to p.b 
> so maybe that's the idea here.
>
> With that in mind you could also get p.b and do insertions on it using 
> ordinary string methods, then assign it back to p.b:
>
> i = 12  # insertion point
> original = p.b
> s = 'this is the insert'
> tail = original[i:]
> head = original[:i]
> new = head + s + tail
> p.b = new
>
> There's some difference regarding updating between assigning to p.b and 
> p.v.b but I forget what it is. It's mentioned somewhere in the docs.  
> Edward will probably chime in here with more definitive information.
>
> On Sunday, July 28, 2024 at 9:59:09 AM UTC-4 jkn wrote:
>
>> well ... yes, I have previously just totally **set** the body text (ie. I 
>> am creating a totally new node), and as you say this 'sticks'. For this new 
>> command, I want to add to any body text which is already there.
>>
>> But I am puzzled about what seems to be a mixture in this example:
>>
>> - you get the insertion point and then use w.insert() to write your text 
>> to ... the wrapper for the body?? 
>> - but then you do p.v.b = w.getAllText() to ... set the body text to ... 
>> that which you have just set for the body wrapper?
>>
>> I am missing something in the paradigm here...
>>
>> J^n
>>
>>
>> On Sunday, July 28, 2024 at 2:52:47 PM UTC+1 tbp1...@gmail.com wrote:
>>
>>> I think I forgot that the recommended way to do unto/redo has been 
>>> changed since I wrote that script. Also, you can directly set p.b or p.v.b 
>>> and those changes will stick.  Here's one I found in Leo's code base that 
>>> does that and uses the newer undo system:
>>>
>>> def insertBodyTime(self: Self, event: LeoKeyEvent = None) -> None:
>>> """Insert a time/date stamp at the cursor."""
>>> c, p, u = self, self.p, self.undoer
>>> w = c.frame.body.wrapper
>>> undoType = 'Insert Body Time'
>>> if g.app.batchMode:
>>> c.notValidInBatchMode(undoType)
>>> return
>>> bunch = u.beforeChangeBody(p)
>>> w.deleteTextSelection()
>>> s = self.getTime(body=True)
>>> i = w.getInsertPoint()
>>> w.insert(i, s)
>>> p.v.b = w.getAllText()
>>> u.afterChangeBody(p, undoType, bunch)
>>>
>>> On Sunday, July 28, 2024 at 9:17:45 AM UTC-4 jkn wrote:
>>>
>>>> Thanks. Hmm, looks like I was wrong about onBodyChanged being outdated 
>>>> - there seem to be hardly any uses in Leo's source, which perhaps misled 
>>>> me.
>>>>
>>>> I removed my undo code from my example... ;-)
>>>>
>>>> Regards
>>>> J^n
>>>>
>>>>
>>>> On Sunday, July 28, 2024 at 1:58:07 PM UTC+1 tbp1...@gmail.com wrote:
>>>>
>>>>> Here's one I use and it works fine.  You should set up for undoing 
>>>>> after an insert, and this script does that too:
>>>>>
>>>>> """Insert a node with id and creation timestamp strings"""
>>>>>
>>>>> c.doCommandByName('insert-node')
>>>>> undoType = 'xx-insert-node'
>>>>> p.moveToNext()
>>>>> w = c.frame.body.wrapper
>>>>>
>>>>> oldSel = w.getSelectionRange()
>>>>> w.deleteTextSelection()
>>>>> w.setInsertPoint(0)
>>>>>
>>>>> id_label = f':id: {p.gnx}\n'
>>>>> time_string = ':created: ' + c.getTime(body=True) + '\n'
>>>>> i = w.getInsertPoint()
>>>>> w.insert(i, f'{id_label}{time_string}')
>>>>>
>>>>> c.frame.body.onBodyChanged(undoType, oldSel=oldSel)
>>>>> c.bodyWantsFocusNow()
>>>>>
>>>>> On Sunday, July 28, 2024 at 8:40:32 AM UTC-4 jkn wrote:
>>>>>

Re: what to call after changing body text, please?

2024-07-28 Thread jkn
well ... yes, I have previously just totally **set** the body text (ie. I 
am creating a totally new node), and as you say this 'sticks'. For this new 
command, I want to add to any body text which is already there.

But I am puzzled about what seems to be a mixture in this example:

- you get the insertion point and then use w.insert() to write your text to 
... the wrapper for the body?? 
- but then you do p.v.b = w.getAllText() to ... set the body text to ... 
that which you have just set for the body wrapper?

I am missing something in the paradigm here...

J^n


On Sunday, July 28, 2024 at 2:52:47 PM UTC+1 tbp1...@gmail.com wrote:

> I think I forgot that the recommended way to do unto/redo has been changed 
> since I wrote that script. Also, you can directly set p.b or p.v.b and 
> those changes will stick.  Here's one I found in Leo's code base that does 
> that and uses the newer undo system:
>
> def insertBodyTime(self: Self, event: LeoKeyEvent = None) -> None:
> """Insert a time/date stamp at the cursor."""
> c, p, u = self, self.p, self.undoer
> w = c.frame.body.wrapper
> undoType = 'Insert Body Time'
> if g.app.batchMode:
> c.notValidInBatchMode(undoType)
> return
> bunch = u.beforeChangeBody(p)
> w.deleteTextSelection()
> s = self.getTime(body=True)
> i = w.getInsertPoint()
> w.insert(i, s)
>     p.v.b = w.getAllText()
> u.afterChangeBody(p, undoType, bunch)
>
> On Sunday, July 28, 2024 at 9:17:45 AM UTC-4 jkn wrote:
>
>> Thanks. Hmm, looks like I was wrong about onBodyChanged being outdated - 
>> there seem to be hardly any uses in Leo's source, which perhaps misled me.
>>
>> I removed my undo code from my example... ;-)
>>
>> Regards
>> J^n
>>
>>
>> On Sunday, July 28, 2024 at 1:58:07 PM UTC+1 tbp1...@gmail.com wrote:
>>
>>> Here's one I use and it works fine.  You should set up for undoing after 
>>> an insert, and this script does that too:
>>>
>>> """Insert a node with id and creation timestamp strings"""
>>>
>>> c.doCommandByName('insert-node')
>>> undoType = 'xx-insert-node'
>>> p.moveToNext()
>>> w = c.frame.body.wrapper
>>>
>>> oldSel = w.getSelectionRange()
>>> w.deleteTextSelection()
>>> w.setInsertPoint(0)
>>>
>>> id_label = f':id: {p.gnx}\n'
>>> time_string = ':created: ' + c.getTime(body=True) + '\n'
>>> i = w.getInsertPoint()
>>> w.insert(i, f'{id_label}{time_string}')
>>>
>>> c.frame.body.onBodyChanged(undoType, oldSel=oldSel)
>>> c.bodyWantsFocusNow()
>>>
>>> On Sunday, July 28, 2024 at 8:40:32 AM UTC-4 jkn wrote:
>>>
>>>> I'm being a bit dim here, but:
>>>>
>>>> I am writing a simple command to append text to the body of a node. The 
>>>> only commands I have written before set the entire body text to some value.
>>>>
>>>> What do I have to call after using w.insert() etc. to make these 
>>>> changes persistent.?
>>>>
>>>> c.redraw() does not seem to do the trick.
>>>>
>>>> The (outdated?) scripting miscellany: 
>>>> https://leo-editor.github.io/leo-editor/scripting-miscellany.html
>>>>
>>>> suggests that c.frame.body.onBodyChanged should be called; but it looks 
>>>> like this is not longer the case.
>>>>
>>>> A trivial example (that I do not seem to be able to find) would be 
>>>> helpful - thanks.
>>>>
>>>> w = c.frame.body.wrapper
>>>> for line in range(10):
>>>> w.appendText("%d\n" % line)
>>>>
>>>> # now what?
>>>>
>>>> J^n
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/1b6b27ed-1532-473e-8ee9-d98676693decn%40googlegroups.com.


Re: what to call after changing body text, please?

2024-07-28 Thread jkn
Thanks. Hmm, looks like I was wrong about onBodyChanged being outdated - 
there seem to be hardly any uses in Leo's source, which perhaps misled me.

I removed my undo code from my example... ;-)

Regards
J^n


On Sunday, July 28, 2024 at 1:58:07 PM UTC+1 tbp1...@gmail.com wrote:

> Here's one I use and it works fine.  You should set up for undoing after 
> an insert, and this script does that too:
>
> """Insert a node with id and creation timestamp strings"""
>
> c.doCommandByName('insert-node')
> undoType = 'xx-insert-node'
> p.moveToNext()
> w = c.frame.body.wrapper
>
> oldSel = w.getSelectionRange()
> w.deleteTextSelection()
> w.setInsertPoint(0)
>
> id_label = f':id: {p.gnx}\n'
> time_string = ':created: ' + c.getTime(body=True) + '\n'
> i = w.getInsertPoint()
> w.insert(i, f'{id_label}{time_string}')
>
> c.frame.body.onBodyChanged(undoType, oldSel=oldSel)
> c.bodyWantsFocusNow()
>
> On Sunday, July 28, 2024 at 8:40:32 AM UTC-4 jkn wrote:
>
>> I'm being a bit dim here, but:
>>
>> I am writing a simple command to append text to the body of a node. The 
>> only commands I have written before set the entire body text to some value.
>>
>> What do I have to call after using w.insert() etc. to make these changes 
>> persistent.?
>>
>> c.redraw() does not seem to do the trick.
>>
>> The (outdated?) scripting miscellany: 
>> https://leo-editor.github.io/leo-editor/scripting-miscellany.html
>>
>> suggests that c.frame.body.onBodyChanged should be called; but it looks 
>> like this is not longer the case.
>>
>> A trivial example (that I do not seem to be able to find) would be 
>> helpful - thanks.
>>
>> w = c.frame.body.wrapper
>> for line in range(10):
>> w.appendText("%d\n" % line)
>>
>> # now what?
>>
>> J^n
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/8ac1c434-131a-491c-b0c6-e42ba4bf6901n%40googlegroups.com.


what to call after changing body text, please?

2024-07-28 Thread jkn
I'm being a bit dim here, but:

I am writing a simple command to append text to the body of a node. The 
only commands I have written before set the entire body text to some value.

What do I have to call after using w.insert() etc. to make these changes 
persistent.?

c.redraw() does not seem to do the trick.

The (outdated?) scripting miscellany: 
https://leo-editor.github.io/leo-editor/scripting-miscellany.html

suggests that c.frame.body.onBodyChanged should be called; but it looks 
like this is not longer the case.

A trivial example (that I do not seem to be able to find) would be helpful 
- thanks.

w = c.frame.body.wrapper
for line in range(10):
w.appendText("%d\n" % line)

# now what?

J^n

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/3413bc7e-6225-45d7-b2b5-72fdff453d75n%40googlegroups.com.


Re: 🚀 Announcing LeoJS 1.0 🦁

2024-07-28 Thread jkn
I fully agree on both counts. I am not (yet?) a 'strong' user of LeoJS, but 
am full of admiration for the effort and results.

J^n


On Sunday, July 28, 2024 at 12:53:32 AM UTC+1 tbp1...@gmail.com wrote:

> Congratulations and thank you!  But these words seem too weak to 
> acknowledge the commitment and effort you have put into the work (not to 
> mention the additional effort to get the LLM-generated images for each 
> release).
>
> I think we should all acknowledge Edward Ream too.  He has supported the 
> project in every way where another, lesser person could have been jealous, 
> proprietary, and obstructive.
>
> On Saturday, July 27, 2024 at 6:08:31 PM UTC-4 Félix wrote:
>
>>
>> *[image: banner-leojs-trans-800.png]*📢*Announcing LeoJS 1.0*🥳
>>
>> *Dear Leonistas and Fellow Developers,*
>> I am beyond thrilled to announce that after more than five years of 
>> relentless development, refinement, and passion,* LeoJS has reached its 
>> 1.0 release 
>> *! 
>> This milestone marks the beginning of a new era for Leo and VSCode, and I 
>> couldn't be more excited to share it with you all.
>>
>> *Join the Community!*
>> This release would not have been possible without the incredible support 
>> and feedback from the community. I invite you all to join the discussion, 
>> share your experiences, and contribute to the ongoing development of LeoJS 
>> here on this forum, or on the *LeoJS issues page* 
>> .
>>
>> *Try LeoJS 1.0 Today!*
>>
>> Get it via auto-update, or *download LeoJS 1.0* 
>>  and 
>> experience all the features of Leo from within VSCode. (*Also available 
>> on open-vsx.org for VSCodium* 
>> )  Your feedback is 
>> invaluable, so please don't hesitate to share your thoughts and suggestions.
>>
>> *What's New in LeoJS 1.0 Since 0.2.15*
>>
>>- *Support for Older .leo Files: *LeoJS can now open older formats of 
>>.leo files (from version 4.7 and before) that contained 'tnodelist' 
>>attributes.
>>- *Improved Command Icons:* Fixed the disabled/enabled state of 
>>'Refresh from disk' and 'Extract Names' command-icons in the menu above 
>> the 
>>body-editor.
>>- *Customizable Command Icons:* The command-icons above the outline 
>>pane are now customizable. They can also be set/unset in the LeoJS 
>> setting 
>>panel.
>>- *Optimized Log Pane:* The log pane is only forcefully shown at 
>>startup on first installation or during version updates.
>>- *Default .leojs JSON Format: *The .leojs JSON file format is now 
>>the default when saving new untitled files, instead of the .leo XML 
>> format.
>>- *Bug Fixes: *Fixed an elusive bug where sometimes a false Leo file 
>>change detection was triggered when saving.
>>
>> *Thanks to Edward and All of Leo's Contributors!*
>> I will quote Thomas, who rightfully said* "Leo as we know it today is 
>> the result of a long evolution, during which the ideas of many people 
>> helped to shape the present-day Leo.  I want to emphasize the idea of an 
>> "evolution", because this evolution has led to the amazingly wide utility 
>> that Leo users learn as they use it more and more.  The continuous 
>> improvement over decades is one of the things that separates Leo from so 
>> many other editor and even outliner projects."*
>>
>> Since I merely translated Leo's codebase from python to typescript, you 
>> are all in fact the authors of LeoJS! So thank you again for being a part 
>> of this journey. 
>>
>> Here's to many more years of innovation and collaboration!
>>
>> Best regards,
>>
>> Félix Malboeuf
>> [image: footer2-leojs-1.0.png]
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/10822ab0-11d6-4964-bfe0-ca6eb6795135n%40googlegroups.com.


Re: 🚀 LeoJS Version 0.2.14-beta Released!

2024-07-01 Thread jkn
Hi Félix

It worked this time!!

J^n

On Saturday, June 29, 2024 at 8:44:06 AM UTC+1 jkn wrote:

> Hi Felix - it still fails for me ;-(.
>
> I will try again later this weekend.
>
> J^n
>
>
> On Saturday, June 29, 2024 at 1:40:56 AM UTC+1 Félix wrote:
>
>> Thanks for trying again Jon! Perhaps the last changes took a little time 
>> to be applied.
>>
>> I've just asked my brother over the phone to try it out:
>>
>> Since there's two way to pay, (via a paypal account or with a credit card 
>> # only) he tried it both via his paypal account, and again, in incognito 
>> mode without a paypal account by using only a credit card number. It worked 
>> in both instances. 
>>
>> I cannot thank you enough for persisting in trying to make that paypal 
>> button work!  Let me know if you try again & still have an error issue! 
>> Greatly appreciated!
>>
>> Félix
>>
>>
>>
>>
>>
>> On Friday, June 28, 2024 at 9:11:57 AM UTC-4 jkn wrote:
>>
>>> "We're sorry, we weren't able to complete your payment at this time. 
>>> Please try again later."
>>>
>>> (2nd try after a couple of hours also failed)
>>>
>>> On Friday, June 28, 2024 at 2:57:21 AM UTC+1 Félix wrote:
>>>
>>>> Thanks Jon for this info,  this is embarrassing! 
>>>>
>>>> But, after making more verifications, I think I got it going ok now 
>>>> (The paypal administration console is terrible.) I finally found I had to 
>>>> finish validating something else with my account. and a few other settings 
>>>> to tune up ... 🙄  If it still doesn't work after that I'll contact their 
>>>> customer support.
>>>>
>>>> Should work now... I guess eh,   Thanks for persisting in wanting 
>>>> to give me money! 
>>>>
>>>> Félix
>>>> On Thursday, June 27, 2024 at 6:35:52 PM UTC-4 jkn wrote:
>>>>
>>>>> Hi Felix
>>>>> That PayPal donation doesn't seem to have gone through - perhaps 
>>>>> you might want to check things again?
>>>>>
>>>>> Regards, Jon N
>>>>>
>>>>>
>>>>> On Thursday, June 27, 2024 at 8:23:22 AM UTC+1 jkn wrote:
>>>>>
>>>>>> Hi Félix
>>>>>> I tried again and got further - the small donation my have gone 
>>>>>> through, but there was a PayPal ?warning?, "e.data is undefined"
>>>>>>
>>>>>> Let me know if you get the donation or not, please.
>>>>>>
>>>>>> Regards, Jon N
>>>>>>
>>>>>> On Thursday, June 27, 2024 at 2:22:27 AM UTC+1 Félix wrote:
>>>>>>
>>>>>>> OMG JON THANK YOU!! :D
>>>>>>>
>>>>>>> PayPal never even sent me notifications to inform me that I needed 
>>>>>>> to keep some info up-to-date with them! 
>>>>>>>
>>>>>>> I just updated my personal info in my account settings and 
>>>>>>> everything is now back to normal! 
>>>>>>>
>>>>>>> Thanks again for notifying me of this!! 
>>>>>>>
>>>>>>> Félix
>>>>>>>
>>>>>>> On Wednesday, June 26, 2024 at 5:55:57 PM UTC-4 jkn wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> Hi Félix
>>>>>>>> FYI I tried to make a small donation via PayPal, and it came 
>>>>>>>> back with a message "This organisation can't accept donations 
>>>>>>>> right now.". Not sure if 'This organisation' means PayPal, or boltex 
>>>>>>>> etc. 
>>>>>>>> Thought I'd let you know...
>>>>>>>>
>>>>>>>> Regards, Jon N
>>>>>>>>
>>>>>>>> On Wednesday, June 26, 2024 at 6:22:44 PM UTC+1 Félix wrote:
>>>>>>>>
>>>>>>>>> >  Zero-install Leo is here!
>>>>>>>>>
>>>>>>>>> Indeed! :)
>>>>>>>>>
>>>>>>>>> For the best experience with LeoJS in the browser: go to your 
>>>>>>>>> favorite github repository, (switch the branch you want to work with) 
>>>>>>>>> and 
>>>>>>>>> press the 'dot' on your keyboard, as shown at the start of this 
>>>>>>>>> video: 
>>>>>>>>> *https://www.youtube.com/watch?v=M_mKXSbVGdE* 
>>>>>>>>> <https://www.youtube.com/watch?v=M_mKXSbVGdE>
>>>>>>>>>
>>>>>>>>> Félix
>>>>>>>>>
>>>>>>>>> On Wednesday, June 26, 2024 at 6:09:39 AM UTC-4 Edward K. Ream 
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> On Tue, Jun 25, 2024 at 11:26 PM Félix  
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> I know many leonistas are *VSCodium* <https://vscodium.com/> 
>>>>>>>>>>> users, 
>>>>>>>>>>>
>>>>>>>>>>> So I'm happy to inform you that *the folks at eclipse/openvsx 
>>>>>>>>>>> have fixed their server issues*, and that the new *LeoJS 0.2.14 
>>>>>>>>>>> beta version* <https://open-vsx.org/extension/boltex/leojs> is 
>>>>>>>>>>> now available to install or update from *https://open-vsx.org 
>>>>>>>>>>> <https://open-vsx.org/extension/boltex/leojs>* !
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Just on a lark, I tried opening vs-code.dev.  LeoJS appears to 
>>>>>>>>>> work!!!  Zero-install Leo is here!
>>>>>>>>>>
>>>>>>>>>> Edward
>>>>>>>>>>
>>>>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ae4b8bae-7f03-4307-8006-b6ddd4f660b4n%40googlegroups.com.


Re: 🚀 LeoJS Version 0.2.14-beta Released!

2024-06-29 Thread jkn
Hi Felix - it still fails for me ;-(.

I will try again later this weekend.

J^n


On Saturday, June 29, 2024 at 1:40:56 AM UTC+1 Félix wrote:

> Thanks for trying again Jon! Perhaps the last changes took a little time 
> to be applied.
>
> I've just asked my brother over the phone to try it out:
>
> Since there's two way to pay, (via a paypal account or with a credit card 
> # only) he tried it both via his paypal account, and again, in incognito 
> mode without a paypal account by using only a credit card number. It worked 
> in both instances. 
>
> I cannot thank you enough for persisting in trying to make that paypal 
> button work!  Let me know if you try again & still have an error issue! 
> Greatly appreciated!
>
> Félix
>
>
>
>
>
> On Friday, June 28, 2024 at 9:11:57 AM UTC-4 jkn wrote:
>
>> "We're sorry, we weren't able to complete your payment at this time. 
>> Please try again later."
>>
>> (2nd try after a couple of hours also failed)
>>
>> On Friday, June 28, 2024 at 2:57:21 AM UTC+1 Félix wrote:
>>
>>> Thanks Jon for this info,  this is embarrassing! 
>>>
>>> But, after making more verifications, I think I got it going ok now (The 
>>> paypal administration console is terrible.) I finally found I had to finish 
>>> validating something else with my account. and a few other settings to tune 
>>> up ... 🙄  If it still doesn't work after that I'll contact their customer 
>>> support.
>>>
>>> Should work now... I guess eh,   Thanks for persisting in wanting to 
>>> give me money! 
>>>
>>> Félix
>>> On Thursday, June 27, 2024 at 6:35:52 PM UTC-4 jkn wrote:
>>>
>>>> Hi Felix
>>>> That PayPal donation doesn't seem to have gone through - perhaps 
>>>> you might want to check things again?
>>>>
>>>> Regards, Jon N
>>>>
>>>>
>>>> On Thursday, June 27, 2024 at 8:23:22 AM UTC+1 jkn wrote:
>>>>
>>>>> Hi Félix
>>>>> I tried again and got further - the small donation my have gone 
>>>>> through, but there was a PayPal ?warning?, "e.data is undefined"
>>>>>
>>>>> Let me know if you get the donation or not, please.
>>>>>
>>>>> Regards, Jon N
>>>>>
>>>>> On Thursday, June 27, 2024 at 2:22:27 AM UTC+1 Félix wrote:
>>>>>
>>>>>> OMG JON THANK YOU!! :D
>>>>>>
>>>>>> PayPal never even sent me notifications to inform me that I needed to 
>>>>>> keep some info up-to-date with them! 
>>>>>>
>>>>>> I just updated my personal info in my account settings and everything 
>>>>>> is now back to normal! 
>>>>>>
>>>>>> Thanks again for notifying me of this!! 
>>>>>>
>>>>>> Félix
>>>>>>
>>>>>> On Wednesday, June 26, 2024 at 5:55:57 PM UTC-4 jkn wrote:
>>>>>>
>>>>>>>
>>>>>>> Hi Félix
>>>>>>> FYI I tried to make a small donation via PayPal, and it came 
>>>>>>> back with a message "This organisation can't accept donations right 
>>>>>>> now.". Not sure if 'This organisation' means PayPal, or boltex etc. 
>>>>>>> Thought 
>>>>>>> I'd let you know...
>>>>>>>
>>>>>>> Regards, Jon N
>>>>>>>
>>>>>>> On Wednesday, June 26, 2024 at 6:22:44 PM UTC+1 Félix wrote:
>>>>>>>
>>>>>>>> >  Zero-install Leo is here!
>>>>>>>>
>>>>>>>> Indeed! :)
>>>>>>>>
>>>>>>>> For the best experience with LeoJS in the browser: go to your 
>>>>>>>> favorite github repository, (switch the branch you want to work with) 
>>>>>>>> and 
>>>>>>>> press the 'dot' on your keyboard, as shown at the start of this video: 
>>>>>>>> *https://www.youtube.com/watch?v=M_mKXSbVGdE* 
>>>>>>>> <https://www.youtube.com/watch?v=M_mKXSbVGdE>
>>>>>>>>
>>>>>>>> Félix
>>>>>>>>
>>>>>>>> On Wednesday, June 26, 2024 at 6:09:39 AM UTC-4 Edward K. Ream 
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> On Tue, Jun 25, 2024 at 11:26 PM Félix  wrote:
>>>>>>>>>
>>>>>>>>> I know many leonistas are *VSCodium* <https://vscodium.com/> 
>>>>>>>>>> users, 
>>>>>>>>>>
>>>>>>>>>> So I'm happy to inform you that *the folks at eclipse/openvsx 
>>>>>>>>>> have fixed their server issues*, and that the new *LeoJS 0.2.14 
>>>>>>>>>> beta version* <https://open-vsx.org/extension/boltex/leojs> is 
>>>>>>>>>> now available to install or update from *https://open-vsx.org 
>>>>>>>>>> <https://open-vsx.org/extension/boltex/leojs>* !
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Just on a lark, I tried opening vs-code.dev.  LeoJS appears to 
>>>>>>>>> work!!!  Zero-install Leo is here!
>>>>>>>>>
>>>>>>>>> Edward
>>>>>>>>>
>>>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/f8e5ffe3-b58d-40d8-b8c9-b4c5852d7173n%40googlegroups.com.


Re: 🚀 LeoJS Version 0.2.14-beta Released!

2024-06-28 Thread jkn
"We're sorry, we weren't able to complete your payment at this time. Please 
try again later."

(2nd try after a couple of hours also failed)

On Friday, June 28, 2024 at 2:57:21 AM UTC+1 Félix wrote:

> Thanks Jon for this info,  this is embarrassing! 
>
> But, after making more verifications, I think I got it going ok now (The 
> paypal administration console is terrible.) I finally found I had to finish 
> validating something else with my account. and a few other settings to tune 
> up ... 🙄  If it still doesn't work after that I'll contact their customer 
> support.
>
> Should work now... I guess eh,   Thanks for persisting in wanting to 
> give me money! 
>
> Félix
> On Thursday, June 27, 2024 at 6:35:52 PM UTC-4 jkn wrote:
>
>> Hi Felix
>> That PayPal donation doesn't seem to have gone through - perhaps you 
>> might want to check things again?
>>
>> Regards, Jon N
>>
>>
>> On Thursday, June 27, 2024 at 8:23:22 AM UTC+1 jkn wrote:
>>
>>> Hi Félix
>>> I tried again and got further - the small donation my have gone 
>>> through, but there was a PayPal ?warning?, "e.data is undefined"
>>>
>>> Let me know if you get the donation or not, please.
>>>
>>> Regards, Jon N
>>>
>>> On Thursday, June 27, 2024 at 2:22:27 AM UTC+1 Félix wrote:
>>>
>>>> OMG JON THANK YOU!! :D
>>>>
>>>> PayPal never even sent me notifications to inform me that I needed to 
>>>> keep some info up-to-date with them! 
>>>>
>>>> I just updated my personal info in my account settings and everything 
>>>> is now back to normal! 
>>>>
>>>> Thanks again for notifying me of this!! 
>>>>
>>>> Félix
>>>>
>>>> On Wednesday, June 26, 2024 at 5:55:57 PM UTC-4 jkn wrote:
>>>>
>>>>>
>>>>> Hi Félix
>>>>> FYI I tried to make a small donation via PayPal, and it came back 
>>>>> with a message "This organisation can't accept donations right now.". 
>>>>> Not sure if 'This organisation' means PayPal, or boltex etc. Thought I'd 
>>>>> let you know...
>>>>>
>>>>> Regards, Jon N
>>>>>
>>>>> On Wednesday, June 26, 2024 at 6:22:44 PM UTC+1 Félix wrote:
>>>>>
>>>>>> >  Zero-install Leo is here!
>>>>>>
>>>>>> Indeed! :)
>>>>>>
>>>>>> For the best experience with LeoJS in the browser: go to your 
>>>>>> favorite github repository, (switch the branch you want to work with) 
>>>>>> and 
>>>>>> press the 'dot' on your keyboard, as shown at the start of this video: 
>>>>>> *https://www.youtube.com/watch?v=M_mKXSbVGdE* 
>>>>>> <https://www.youtube.com/watch?v=M_mKXSbVGdE>
>>>>>>
>>>>>> Félix
>>>>>>
>>>>>> On Wednesday, June 26, 2024 at 6:09:39 AM UTC-4 Edward K. Ream wrote:
>>>>>>
>>>>>>> On Tue, Jun 25, 2024 at 11:26 PM Félix  wrote:
>>>>>>>
>>>>>>> I know many leonistas are *VSCodium* <https://vscodium.com/> users, 
>>>>>>>>
>>>>>>>> So I'm happy to inform you that *the folks at eclipse/openvsx have 
>>>>>>>> fixed their server issues*, and that the new *LeoJS 0.2.14 beta 
>>>>>>>> version* <https://open-vsx.org/extension/boltex/leojs> is now 
>>>>>>>> available to install or update from *https://open-vsx.org 
>>>>>>>> <https://open-vsx.org/extension/boltex/leojs>* !
>>>>>>>
>>>>>>>
>>>>>>> Just on a lark, I tried opening vs-code.dev.  LeoJS appears to 
>>>>>>> work!!!  Zero-install Leo is here!
>>>>>>>
>>>>>>> Edward
>>>>>>>
>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ab3d4073-545c-414d-b60f-bdcf49d883ecn%40googlegroups.com.


Re: 🚀 LeoJS Version 0.2.14-beta Released!

2024-06-27 Thread jkn
Hi Felix
That PayPal donation doesn't seem to have gone through - perhaps you 
might want to check things again?

Regards, Jon N


On Thursday, June 27, 2024 at 8:23:22 AM UTC+1 jkn wrote:

> Hi Félix
> I tried again and got further - the small donation my have gone 
> through, but there was a PayPal ?warning?, "e.data is undefined"
>
> Let me know if you get the donation or not, please.
>
> Regards, Jon N
>
> On Thursday, June 27, 2024 at 2:22:27 AM UTC+1 Félix wrote:
>
>> OMG JON THANK YOU!! :D
>>
>> PayPal never even sent me notifications to inform me that I needed to 
>> keep some info up-to-date with them! 
>>
>> I just updated my personal info in my account settings and everything is 
>> now back to normal! 
>>
>> Thanks again for notifying me of this!! 
>>
>> Félix
>>
>> On Wednesday, June 26, 2024 at 5:55:57 PM UTC-4 jkn wrote:
>>
>>>
>>> Hi Félix
>>> FYI I tried to make a small donation via PayPal, and it came back 
>>> with a message "This organisation can't accept donations right now.". 
>>> Not sure if 'This organisation' means PayPal, or boltex etc. Thought I'd 
>>> let you know...
>>>
>>> Regards, Jon N
>>>
>>> On Wednesday, June 26, 2024 at 6:22:44 PM UTC+1 Félix wrote:
>>>
>>>> >  Zero-install Leo is here!
>>>>
>>>> Indeed! :)
>>>>
>>>> For the best experience with LeoJS in the browser: go to your favorite 
>>>> github repository, (switch the branch you want to work with) and press the 
>>>> 'dot' on your keyboard, as shown at the start of this video: 
>>>> *https://www.youtube.com/watch?v=M_mKXSbVGdE* 
>>>> <https://www.youtube.com/watch?v=M_mKXSbVGdE>
>>>>
>>>> Félix
>>>>
>>>> On Wednesday, June 26, 2024 at 6:09:39 AM UTC-4 Edward K. Ream wrote:
>>>>
>>>>> On Tue, Jun 25, 2024 at 11:26 PM Félix  wrote:
>>>>>
>>>>> I know many leonistas are *VSCodium* <https://vscodium.com/> users, 
>>>>>>
>>>>>> So I'm happy to inform you that *the folks at eclipse/openvsx have 
>>>>>> fixed their server issues*, and that the new *LeoJS 0.2.14 beta 
>>>>>> version* <https://open-vsx.org/extension/boltex/leojs> is now 
>>>>>> available to install or update from *https://open-vsx.org 
>>>>>> <https://open-vsx.org/extension/boltex/leojs>* !
>>>>>
>>>>>
>>>>> Just on a lark, I tried opening vs-code.dev.  LeoJS appears to 
>>>>> work!!!  Zero-install Leo is here!
>>>>>
>>>>> Edward
>>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/73a24ad0-554d-4f05-8974-63dc9443a75cn%40googlegroups.com.


Re: 🚀 LeoJS Version 0.2.14-beta Released!

2024-06-27 Thread jkn
Hi Félix
I tried again and got further - the small donation my have gone 
through, but there was a PayPal ?warning?, "e.data is undefined"

Let me know if you get the donation or not, please.

Regards, Jon N

On Thursday, June 27, 2024 at 2:22:27 AM UTC+1 Félix wrote:

> OMG JON THANK YOU!! :D
>
> PayPal never even sent me notifications to inform me that I needed to keep 
> some info up-to-date with them! 
>
> I just updated my personal info in my account settings and everything is 
> now back to normal! 
>
> Thanks again for notifying me of this!! 
>
> Félix
>
> On Wednesday, June 26, 2024 at 5:55:57 PM UTC-4 jkn wrote:
>
>>
>> Hi Félix
>> FYI I tried to make a small donation via PayPal, and it came back 
>> with a message "This organisation can't accept donations right now.". 
>> Not sure if 'This organisation' means PayPal, or boltex etc. Thought I'd 
>> let you know...
>>
>> Regards, Jon N
>>
>> On Wednesday, June 26, 2024 at 6:22:44 PM UTC+1 Félix wrote:
>>
>>> >  Zero-install Leo is here!
>>>
>>> Indeed! :)
>>>
>>> For the best experience with LeoJS in the browser: go to your favorite 
>>> github repository, (switch the branch you want to work with) and press the 
>>> 'dot' on your keyboard, as shown at the start of this video: 
>>> *https://www.youtube.com/watch?v=M_mKXSbVGdE* 
>>> <https://www.youtube.com/watch?v=M_mKXSbVGdE>
>>>
>>> Félix
>>>
>>> On Wednesday, June 26, 2024 at 6:09:39 AM UTC-4 Edward K. Ream wrote:
>>>
>>>> On Tue, Jun 25, 2024 at 11:26 PM Félix  wrote:
>>>>
>>>> I know many leonistas are *VSCodium* <https://vscodium.com/> users, 
>>>>>
>>>>> So I'm happy to inform you that *the folks at eclipse/openvsx have 
>>>>> fixed their server issues*, and that the new *LeoJS 0.2.14 beta 
>>>>> version* <https://open-vsx.org/extension/boltex/leojs> is now 
>>>>> available to install or update from *https://open-vsx.org 
>>>>> <https://open-vsx.org/extension/boltex/leojs>* !
>>>>
>>>>
>>>> Just on a lark, I tried opening vs-code.dev.  LeoJS appears to 
>>>> work!!!  Zero-install Leo is here!
>>>>
>>>> Edward
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/b6de71a2-66ea-4c22-94c7-56aad7b885f1n%40googlegroups.com.


Re: 🚀 LeoJS Version 0.2.14-beta Released!

2024-06-26 Thread jkn

Hi Félix
FYI I tried to make a small donation via PayPal, and it came back with 
a message "This organisation can't accept donations right now.". Not sure 
if 'This organisation' means PayPal, or boltex etc. Thought I'd let you 
know...

Regards, Jon N

On Wednesday, June 26, 2024 at 6:22:44 PM UTC+1 Félix wrote:

> >  Zero-install Leo is here!
>
> Indeed! :)
>
> For the best experience with LeoJS in the browser: go to your favorite 
> github repository, (switch the branch you want to work with) and press the 
> 'dot' on your keyboard, as shown at the start of this video: 
> *https://www.youtube.com/watch?v=M_mKXSbVGdE* 
> 
>
> Félix
>
> On Wednesday, June 26, 2024 at 6:09:39 AM UTC-4 Edward K. Ream wrote:
>
>> On Tue, Jun 25, 2024 at 11:26 PM Félix  wrote:
>>
>> I know many leonistas are *VSCodium*  users, 
>>>
>>> So I'm happy to inform you that *the folks at eclipse/openvsx have 
>>> fixed their server issues*, and that the new *LeoJS 0.2.14 beta version* 
>>>  is now available to 
>>> install or update from *https://open-vsx.org 
>>> * !
>>
>>
>> Just on a lark, I tried opening vs-code.dev.  LeoJS appears to work!!!  
>> Zero-install Leo is here!
>>
>> Edward
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/06bcf74f-afd9-412b-b556-140d94eba5den%40googlegroups.com.


Re: 🚀 LeoJS Version 0.2.14-beta Released!

2024-06-23 Thread jkn
+1, amazing work

Jon N

On Sunday, June 23, 2024 at 2:58:40 AM UTC+1 tbp1...@gmail.com wrote:

> I applaud your energy and tenacity, as always.  Thank you.
>
> On Saturday, June 22, 2024 at 9:27:58 PM UTC-4 Félix wrote:
>
>>
>> *[image: leojs-viking-shipment.jpg]Introducing LeoJS Beta 0.2.14 *🧙‍♂️
>>
>> I am thrilled to announce the release of* LeoJS Version 0.2.14-beta 
>> *! 
>> With this new version, LeoJS is now a complete translation of the original 
>> Leo, with all edit commands now fully converted from Python to TypeScript.
>>
>> *Available via automatic update or on the VSCode Marketplace 
>> . **Note: 
>> The open-vsx.org  extension publisher for vscodium 
>> seems down. (See the openvsx issue #945 
>> )*
>>
>> *⚔️ Discover Version 0.2.14-beta: 🐉*
>>
>>- *🔹 Complete Command Coverage*: Every command you’ve loved and used 
>>in Leo, now seamlessly integrated into your VSCode environment.
>>- *🔧 Bug Fixes and Improvements:*
>>   - Resolved the import file error for 'import any' and other 
>>   importers.
>>   - Enhanced the behavior of 'detached' body panes.
>>   - Improved colorization of descendants for nodes with multiple 
>>   'language' directives.
>>   - Added a context menu to document pane nodes, including the 
>>   'revert'
>>   - Fixed the availability of the 'refresh-from-disk' 
>>   command. command.
>>   - Improved keyboard shortcuts and updated the related README 
>>   - Fixed the 'reload-setting' command to call the 'reloadSettings' 
>>   method of subCommanders.documentation.
>>- *✨ New Implementations:*
>>- 'write-zip-archive' command.
>>   - Updated find-def command behavior with 'prefer-nav-pane' config 
>>   setting support.
>>   - 'execute-general-script' and 'execute-external-file' commands.
>>   - Language coloring and syntax support for Julia, Batch, and Shell 
>>   languages.
>>   - Most edit commands are now available and accessible via the 
>>   minibuffer or in scripts.
>>   - 'toggle-unl-view' command to switch the status bar UNL type.
>>   
>> *I invite you to explore these new features and improvements. Your 
>> insights and enthusiasm are what make this community vibrant and truly 
>> unique.*
>>
>> Thank you for your continued support and for being a part of this 
>> journey!  🦁
>>
>> Félix 
>>
>> *(A new LeoInteg version with all the same bugfixes to the 'detached' 
>> body panes, and more, will be coming out with the soon-to-be-released Leo 
>> 6.8.0! In the meantime,  checkout the * "Intro to Leo 
>> " and the "LeoJS Features Demo 
>> " if you haven't already!*)*
>> [image: leojs-line-art-medieval-store.jpg]
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/0113d22f-4fc9-4e3c-a5d4-a3fe8ae72675n%40googlegroups.com.


Re: Hex File Snooper

2024-06-13 Thread jkn
I never used TECO on a PDP (PDP/11 in my case), but I did use PMATE 
('Michael Aaronson's Text Editor, IIRC) on an early S-100 Z80 computer, and 
that was heavily 'inspired' by TECO, I believe. working with the 'command 
syntax' was great fun, as was customising the editor to work with your 
graphics card driver.


On Thursday, June 13, 2024 at 8:45:01 PM UTC+1 tbp1...@gmail.com wrote:

> After reading the link, I see I never got near anything like TECO.
>
> On Thursday, June 13, 2024 at 3:17:49 PM UTC-4 David Szent-Györgyi wrote:
>
>> TECO for the PDP/8 was available under OS/8. The Wikipedia article on 
>> TECO  is a nice 
>> summary. There you can find links to Web pages on TECO, including one by 
>> the originatoer of TECO and the GitHub repository for TECOC, a 
>> reimplementation in C for Windows, macOS, and LInux. 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/f157a178-7e72-4840-ac0f-691b3546d4a5n%40googlegroups.com.


Re: Hex File Snooper

2024-06-13 Thread jkn
I hadn't heard of ArchWSL before, thanks for that. I run Kubuntu rather 
than Arch Linux, but I like the latter's documentation a lot.

J^n


On Tuesday, June 11, 2024 at 8:25:02 PM UTC+1 gates...@gmail.com wrote:

> As with all things, YMMV.  But I run a Windows 10 installation, with 
> ArchWSL as my WSL distro.  It's on WSL2 (as opposed to WSL1, which did 
> things differently).  WSL2 effectively runs the Linux kernel as a program, 
> which other linux programs can use to get their system calls answered, so 
> it's fairly lightweight in that aspect.
>
> On my system, the memory impact is minimal (maybe 10-100MB when idle). 
> Disk space is going to be entirely up to what you install inside your 
> distro -- on my box it's hovering at around 50GB, but that's after using 
> this same installation for many years, installing packages, etc.  The 
> default install depending on distro could be 10GB or so.
>
> Once in a WSL shell, your Windows drives and files are available in 
> /mnt/.  For example, /mnt/c is my C: drive.  It's really slick 
> how well they pulled it off.
>
> Jake
>
> On Tue, Jun 11, 2024 at 1:58 PM Thomas Passin  wrote:
>
>>
>> On Tuesday, June 11, 2024 at 12:35:26 PM UTC-4 gates...@gmail.com wrote:
>>
>> On Windows, I use my Linux tools :)
>>
>> WSL is fantastic for this — ‘xxd’ works just as well in a WSL shell as it 
>> does on my Arch laptop.
>>
>>
>> I haven't tried WSL yet.  Does it take up a lot of memory or disk space? 
>> I'm not a Linux whiz, and I usually spin up a Linux VM when I need to try 
>> something.
>>
>> -- 
>>
> You received this message because you are subscribed to the Google Groups 
>> "leo-editor" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to leo-editor+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/leo-editor/2b9962d0-fb02-4a30-9f94-f9e40589e7c1n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/0bf6c28a-6975-4a15-b315-3e7528455bcfn%40googlegroups.com.


Re: Hex File Snooper

2024-06-11 Thread jkn
This reminds me of a general muse 'it would be nice if...' thought: it 
would be nice if there was a way of defining more featureful dialogs, so 
that in this case for instance, you could browse for a file (or put a 
pathname in), and also add a file offset, or something like that.

I am aware that such a thing would tend to suffer from featuritis, however.

J^n


On Tuesday, June 11, 2024 at 12:53:51 AM UTC+1 tbp1...@gmail.com wrote:

> Sometimes it is useful to view the first N bytes of a file without reading 
> the whole file.  The file might be much too large to load into a text 
> editor or a Leo node, for example. The Linux command *head* will show you 
> just the start of a file, but Windows doesn't have that command out of the 
> box.  Often it's better to look at the hex bytes rather than the text, 
> especially if the file is binary.  Say, for example, that you want to see 
> if a file is a zip file or not, or if the EXIF data is embedded in a .jpg 
> picture file.
>
> Here is a Leo command that loads a file using the file dialog.  It creates 
> a new node at the end of your outline and fills it with a classic hex view 
> of the first 4096 bytes.
>
> I have this script as an *@command* node in my myLeoSettings.leo file, 
> and I also have a custom menu item for it.  I don't use it all the time but 
> it's invaluable when it is needed.
>
> Here is the script:
>
> """Display as hex the first 4096 bytes of a file in body of a new node."""
>
> data = ''
>
> def format_bytes(bytes):
> """Format byte data into classic hex bytes display."""
> text = ''
> asc = ' ' * 3  # For translation of bytes to ascii characters
> n = 0
> for i, b in enumerate(bytes):
> text += f'{b:02x}'
> asc += chr(b) if b > 0x1F else '.'
> if i > 0 and i % 10 == 9:
> # Complete the current line
> text += asc
> text += '\n'
> asc = ' ' * 3
> n += 1
> if n % 8 == 0:
> # Insert a blank line for readability
> text += '\n'
> else:
> text += ' '
> return text
>
> filetypes = [('Any', '*.*'),]
> path = g.app.gui.runOpenFileDialog(c, 'Choose File To Sample', 
> filetypes=filetypes)
> g.es(path)
>
> if path:
> try:
> with open(path, 'rb') as f:
> data = f.read(4096)
> except IOError as e:
> g.es(e)
>
> if data:
> # Create and select target node
> p_last = c.lastVisible()
> target = p_last.insertAfter()
> target.h = f'first bytes of {path}'
> target.b = f'{format_bytes(data)}'
> target.setDirty()
> c.selectPosition(target)
> while c.canMoveOutlineLeft():
> c.moveOutlineLeft()
> c.redraw()
>
> Here is (just the first part) of the bytes of an image file of mine.  We 
> can see the signature of a .jpg file. and that it uses the *sRGB* color 
> map.
>
> ff d8 ff e0 00 10 4a 46 49 46   ÿØÿà..JFIF
> 00 01 01 00 00 01 00 01 00 00   ..
> ff e2 0c 58 49 43 43 5f 50 52   ÿâ.XICC_PR
> 4f 46 49 4c 45 00 01 01 00 00   OFILE.
> 0c 48 6c 63 6d 73 02 10 00 00   .Hlcms
> 6d 6e 74 72 52 47 42 20 58 59   mntrRGB XY
> 5a 20 07 ce 00 02 00 09 00 06   Z .Î..
> 00 31 00 00 61 63 73 70 4d 53   .1..acspMS
>
> 46 54 00 00 00 00 49 45 43 20   FTIEC 
> 73 52 47 42 00 00 00 00 00 00   sRGB..
> 00 00 00 00 00 00 00 00 f6 d6   öÖ
> 00 01 00 00 00 00 d3 2d 6c 63   ..Ó-lc
> 6d 73 00 00 00 00 00 00 00 00   ms
> 00 00 00 00 00 00 00 00 00 00   ..
> 00 00 00 00 00 00 00 00 00 00   ..
> 00 00 00 00 00 00 00 00 00 00   ..
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/5c3a21fa-2fc5-4001-bec3-c33178f91448n%40googlegroups.com.


Re: Last call before deprecating the nested_splitter plugin

2024-05-24 Thread jkn
sent via email

On Friday, May 24, 2024 at 12:29:43 PM UTC+1 Edward K. Ream wrote:

> On Fri, May 24, 2024 at 5:59 AM jkn  wrote:
>
>> jkn@tower:~/leo-editor$ find . -iname "*rich*" 
>> ./leo/plugins/richtext.py
>>
>
> How strange.  Please send me the file.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/331e1992-832f-45b0-b8c5-c183eff7a3ffn%40googlegroups.com.


Re: Last call before deprecating the nested_splitter plugin

2024-05-24 Thread jkn
jkn@tower:~/leo-editor$ find . -iname "*rich*" 
./leo/plugins/richtext.py

on my system...


On Friday, May 24, 2024 at 11:42:49 AM UTC+1 Edward K. Ream wrote:

> On Thursday, May 23, 2024 at 2:16:00 PM UTC-5 Edward K. Ream wrote:
>
> On Thu, May 23, 2024 at 10:39 AM Thomas wrote:
>
> [The free_layout.get_top_splitter] method is used by the *richtext* 
> plugin as well as the flc itself.
>
>
> Good catch. I'll convert the richtext plugin.
>
>
> Where is this plugin? An external search for *text.py finds three files, 
> none of which looks like richtext.py.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/1b91d17a-6bdd-4fd6-8f36-7a84ade8cc0an%40googlegroups.com.


Re: A Script To Display The Viewrendered3 Pane in the Same Place s The Body

2024-05-13 Thread jkn
Hey, that looks like great fun!


On Monday, May 13, 2024 at 3:00:58 PM UTC+1 Edward K. Ream wrote:

> On Sunday, May 12, 2024 at 4:17:19 PM UTC-5 tbp1...@gmail.com wrote:
>
> I have devised a script that can [swap the body and VR3 panes].  You can 
> put it into a button for easy activation, or you could make it into a 
> command in the Settings tree and bind it to a keystroke. 
>
>
> Thomas, your private email on this topic was a Eureka moment for me. I 
> realized that we Leo devs aren't aware of the hierarchy of Leo's Qt widgets.
>
> The following script helps cure that ignorance:
>
> """Scripts to discover Leo's Qt Widget hierarchy."""
> g.cls()
>
> total = 0
>
> def w_name(w):
> name = w.objectName() or 'no name'
> return f"<{name}>:{ w.__class__.__name__}"
>
> def dump(tag, w, level=0):
> global total
> total += 1
> ws = (level * 2) * ' '
> print(f"{id(w):<14} lvl {level:2}: {ws}{tag}:{w_name(w)}")
> 
> def dump_children(w, level=0):
> if 1:  # Specify wanted classes...
> wanted = (
> 'DynamicWindow', 'Frame', 'Layout',
> 'Splitter', 'Stacked', 'Text', 'Widget')
> children = [z for z in w.children()
> if any (z2 in z.__class__.__name__ for z2 in wanted)]
> else:  # Specifiy unwanted classes...
> ignore = ('action', 'animation', 'menu')
> children = [z for z in w.children()
> if not any (z2 in z.__class__.__name__.lower() for z2 in 
> ignore)]
> if children:
> for i, child in enumerate(children):
> dump(f"child {i}", child, level + 1)
> dump_children(child, level + 1)
> 
> def full_dump(tag, w, level=0):
> print('')
> print(f"Full dump of {w_name(w)} at {id(w)}...\n")
> dump(tag, w)
> dump_children(w)
> 
> if 1:
> full_dump('c.frame.top.parent()', c.frame.top.parent())
> else:
>
> flc = c.free_layout  # free layout controller
> top_splitter = flc.get_top_splitter()
> dump('c.frame.top.parent()', c.frame.top.parent())
> dump('c.frame.top', c.frame.top)
> full_dump('top_splitter', top_splitter)
>
> print('')
> print(f"total objects: {total}")
>
> And here is the output:
>
> Full dump of :QStackedWidget at 
> 2877793745520...
>
> 2877793745520  lvl  0: 
> c.frame.top.parent()::QStackedWidget
> 2877793745840  lvl  1:   child 0::QStackedLayout
> 2877687572080  lvl  1:   child 1::DynamicWindow
> 2877793745200  lvl  2: child 0:<_layout>:QLayout
> 2877687572560  lvl  2: child 1::QWidget
> 2877687572880  lvl  3:   child 0::QVBoxLayout
> 2877687573040  lvl  3:   child 1::NestedSplitter
> 2877793731920  lvl  4: child 0::NestedSplitter
> 2877692019248  lvl  5:   child 0::QFrame
> 2877692019408  lvl  6: child 0::QFrame
> 2877692019728  lvl  7:   child 
> 0::QStackedWidget
> 2877793746480  lvl  8: child 0::QStackedLayout
> 2877692019888  lvl  8: child 1::QWidget
> 2877692020368  lvl  9:   child 
> 0::LeoQTextBrowser
> 2877793746320  lvl 10: child 
> 0::QWidget
> 2877793746640  lvl 10: child 
> 1::QWidget
> 2877793550416  lvl 11:   child 0::QBoxLayout
> 2877793731440  lvl 10: child 
> 2::QWidget
> 2877793746800  lvl 11:   child 0::QBoxLayout
> 2877692020848  lvl  9:   child 1::QVBoxLayout
> 2877692021168  lvl  7:   child 1::QGridLayout
> 2877692021008  lvl  6: child 1::QGridLayout
> 2877793732080  lvl  5:   child 
> 1::NestedSplitterHandle
> 2877692019568  lvl  5:   child 
> 2::NestedSplitterHandle
> 2877687573200  lvl  4: child 1::NestedSplitter
> 2877687574640  lvl  5:   child 0::QFrame
> 2877687574800  lvl  6: child 0::QFrame
> 2877687575120  lvl  7:   child 0::QTabWidget
> 2877793746480  lvl  8: child 
> 0::QStackedWidget
> 2877793731440  lvl  9:   child 0::QStackedLayout
> 2877687575920  lvl  9:   child 1::QWidget
> 2877687576080  lvl 10: child 
> 0::QVBoxLayout
> 2877687576240  lvl 10: child 1::QFrame
> 2877687576400  lvl 11:   child 
> 0::QVBoxLayout
> 2877687576560  lvl 12: child 
> 0::QGridLayout
> 2877692018768  lvl 11:   child 
> 1::QListWidget
> 2877793746320  lvl 12: child 
> 0::QWidget
> 2877793746640  lvl 12: child 
> 1::QWidget
> 2877793743600  lvl 13:   child 0: name>:QBoxLayout
> 2877793746800  lvl 12: child 
> 2::QWidget
> 2877793743920  lvl 13:   child 0: name>:QBoxLayout
> 2877695206864  lvl  9:   child 
> 2::LeoQTextBrowser
> 2877793746800  lvl 10: child 
> 0::QWidget
> 2877793746640  lvl 

Re: Another YouTube video worth watching twice

2024-05-03 Thread jkn
I also recommend "Finite and Infinite Games". I haven't heard of 'Good 
Math', thanks for the pointer

On Thursday, May 2, 2024 at 5:13:17 PM UTC+1 gates...@gmail.com wrote:

> Semi-related, James P. Carse's book "Finite and Infinite Games" is a good, 
> if occasionally overtly-spiritual (and easily enough ignored if that kind 
> of thing isn't for you), look at life through the lens of games.
>
> Weirdly, I find all of this to be tied together with Mark Chu-Carroll's 
> "Good Math", which is "just" a meandering path through interesting 
> mathematical concepts, but has opened surprising doors for me when viewed 
> through the lens of game theoretical analysis.
>
> YMMV wildly, of course :)
>
> Jake
>
> On Thu, May 2, 2024 at 12:00 PM Edward K. Ream  wrote:
>
>> This video  is about game 
>> theory and its implications for us and the world.
>>
>> None of us specializes in this area of mathematics so we will all learn a 
>> lot. It changed my view of the world. It will likely change yours.
>>
>> I've just watched this video a second time. Please watch it and pass it 
>> on :-)
>>
>> Edward
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "leo-editor" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to leo-editor+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/leo-editor/5d4bffdc-7cbb-4796-9594-73b19f0514bfn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/4dfbe409-c086-42ca-9a30-acc929900c28n%40googlegroups.com.


Re: A Leo relative in the wild: Trilium Notes

2024-04-25 Thread jkn
Something like this, together with the 'paste a snippet as a file' feature 
I discussed a few weeks ago (and am still playing with) would go a long way 
to stopping me occasionally yearning for some of the features of Obsidian 
and/or Joplin, which I have tried recently.

On Thursday, April 25, 2024 at 2:00:07 PM UTC+1 tbp1...@gmail.com wrote:

> This sounds pretty much what I had in mind.  The freewin plugin actually 
> does the same (in its own separate window). VR/VR3 also replace the 
> rendering widget type depending on what is to be rendered.  Currently VR3 
> can optionally render to a tab in the log frame instead of to a new frame 
> within the overall Leo window.  So we're not far off.
>
> On Thursday, April 25, 2024 at 8:37:59 AM UTC-4 gates...@gmail.com wrote:
>
>> I actually implemented something similar in a private 'leoapp' (app that 
>> lives in a .leo file) I wrote for myself a few years back.  Pretty simple 
>> to get done, IIRC.
>>
>> My general pattern was to have a controller class that contained two 
>> 'view' widgets (a QTextBrowser for rendered HTML, and a QTextEdit for 
>> editing).  The controller class had a wrapper widget that also had an 
>> 'edit' toggle button.  When 'edit' is clicked, a callback is fired off to 
>> remove the active view widget and replace it with the new one (and set some 
>> state in the controller so it doesn't lose track of things).  Content is 
>> updated between the two widgets whenever this swap happens.  Internally 
>> they are two completely different objects, but to the user, the swap is 
>> fairly seamless.
>>
>> I did write this app relying on PyQt5, unfortunately, so I have a fair 
>> bit of updating to do if I want it to work on modern Leo.  Ah well.
>>
>> Jake
>>
>> On Thu, Apr 25, 2024 at 8:10 AM Edward K. Ream  wrote:
>>
>>>
>>>
>>> On Thu, Apr 25, 2024 at 6:57 AM Thomas Passin  wrote:
>>>
 Except that standard Leo nodes don't render graphics and other non-text 
 items.  That's a big difference. We get around it to a degree with VR/VR3. 
  
 Hmm, instead of rendering those nodes in a separate frame as VR/VR3 does, 
 we could overlay the rendering frame over the editing frame. We could 
 switch in and out of rendering mode to allow editing.  I bet that wouldn't 
 be too hard. One way would be to use a 2-frame tabbed widget.  Leo would 
 then have no disadvantage compared with Trillium and its ilk, and would 
 keep all of its advantages.

 Yowee!

>>>
>>> I'm interested. Let's see what you can do.
>>>
>>> Edward
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "leo-editor" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to leo-editor+...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/leo-editor/CAMF8tS2oz4FPGXyuztu8e%3DpA3_vLG3DCF2x24p1FM_kSrRPJKw%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/71bc2a28-bc67-4269-b7b4-3eaabefaba29n%40googlegroups.com.


Re: I just had successful eye surgury

2024-03-28 Thread jkn
My best wishes for a swift and complete recovery, Edward.

Jon N


On Thursday, March 28, 2024 at 8:03:52 PM UTC Edward K. Ream wrote:

> A vitrectomy 
> of
>  
> the rt eye. I'll be limited in what I can do for about a week.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/09831a35-8b8e-4249-be8a-57b0649639d5n%40googlegroups.com.


Re: PR #3842 merged into devel. Leo's headline decluttering should work as before

2024-03-25 Thread jkn
Hi Edward
as it happens I have made a couple of local changes recently to improve 
headline decluttering. After I am happy with them shall I submit a pull 
request?

J^n


On Monday, March 25, 2024 at 5:37:01 PM UTC Edward K. Ream wrote:

> PR #3842  suppresses 
> two pyflakes complaints in the code that does headline decluttering.
>
> The changes should be harmless. Please let me know if they aren't :-)
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/d4ba00cc-17f2-44fa-9255-f1e1b670a7acn%40googlegroups.com.


Re: A Script To Insert An Image

2024-03-24 Thread jkn
I think the fact that (recently discovered) ... there seems to be no method 
getPath() in LeoConfig.py  tells us something.

Not trying to make a big deal of this, mind you...

On Sunday, March 24, 2024 at 12:48:13 PM UTC tbp1...@gmail.com wrote:

> It's still a good question, though.  Is there an actual use for a setting 
> of type "@path"?Having it included in that documentation section seems 
> to imply that there is, though its inclusion may have been meant only as a 
> syntax example. Can anyone resolve this?
>
> On Sunday, March 24, 2024 at 8:24:47 AM UTC-4 Edward K. Ream wrote:
>
>> On Sun, Mar 24, 2024 at 7:01 AM Thomas Passin  wrote:
>>
>>> Settings and headlines are not the same.
>>>
>>
>> At last I understand :-)  As Thomas says, the syntax for settings nodes 
>> is different from directives.
>>
>> In other words, Leo's documentation appears to be correct.
>>
>> Edward
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/1d17bf22-ee22-4c89-a1d3-bc35c0c78df0n%40googlegroups.com.


Re: A Script To Insert An Image

2024-03-24 Thread jkn
I see what you mean... yes, I conflated the two (a site search for '@path' 
got me to the link I mentioned, and not to the canonical documentation 
Edward pointed out)

In that case, can someone give me an example of the use for

@settings
@path mypath = path/to/...

?
Thanks, J^n


On Sunday, March 24, 2024 at 12:01:40 PM UTC tbp1...@gmail.com wrote:

> Settings and headlines are not the same.
>
> On Sunday, March 24, 2024 at 6:39:03 AM UTC-4 jkn wrote:
>
>> Hi Edward
>> I put the link (to a different part of the documentation) in an earlier 
>> post: 
>> https://leo-editor.github.io/leo-editor/customizing.html#simple-settings-nodes
>>
>> The section you reference is clear, and correct. The link above perhaps 
>> references an older syntax?
>>
>> Regards, J^n
>>
>>
>> On Sunday, March 24, 2024 at 10:27:45 AM UTC Edward K. Ream wrote:
>>
>>> On Sun, Mar 24, 2024 at 4:20 AM jkn  wrote:
>>>
>>>>
>>>> I am commenting on the fact that the documentation says that an @path 
>>>> directive (and all the others in the table below) takes the form
>>>>
>>>> @path **=** my/path
>>>>
>>>> whereas in fact no equals sign is necessary (any might well cause an 
>>>> error?)
>>>>
>>>> @path  my/path
>>>>
>>>
>>> I see no equal sign in Leo's directive reference 
>>> <https://leo-editor.github.io/leo-editor/directives.html> page. What 
>>> documentation are you talking about?
>>>
>>> Edward
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/11753fae-a031-482b-90f5-a2c90440139cn%40googlegroups.com.


Re: A Script To Insert An Image

2024-03-24 Thread jkn
Hi Edward
I put the link (to a different part of the documentation) in an earlier 
post: 
https://leo-editor.github.io/leo-editor/customizing.html#simple-settings-nodes

The section you reference is clear, and correct. The link above perhaps 
references an older syntax?

Regards, J^n


On Sunday, March 24, 2024 at 10:27:45 AM UTC Edward K. Ream wrote:

> On Sun, Mar 24, 2024 at 4:20 AM jkn  wrote:
>
>>
>> I am commenting on the fact that the documentation says that an @path 
>> directive (and all the others in the table below) takes the form
>>
>> @path **=** my/path
>>
>> whereas in fact no equals sign is necessary (any might well cause an 
>> error?)
>>
>> @path  my/path
>>
>
> I see no equal sign in Leo's directive reference 
> <https://leo-editor.github.io/leo-editor/directives.html> page. What 
> documentation are you talking about?
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/4be91dbc-8f22-4be4-89ea-5f4c7c397da1n%40googlegroups.com.


Re: A Script To Insert An Image

2024-03-24 Thread jkn
That's not what I am commenting on - I'm well aware of all of that.

I am commenting on the fact that the documentation says that an @path 
directive (and all the others in the table below) takes the form

@path **=** my/path

whereas in fact no equals sign is necessary (any might well cause an error?)

@path  my/path




On Sunday, March 24, 2024 at 4:10:38 AM UTC tbp1...@gmail.com wrote:

> *@path* headlines must be like this: @path c:/test/python. Use forward 
> slashes even on Windows. The pathlib methods will use forward slashes and 
> output whatever is right for the OS.
>
> On Saturday, March 23, 2024 at 7:14:14 PM UTC-4 jkn wrote:
>
>> BTW [Edward], isn't this documentation, from 
>> https://leo-editor.github.io/leo-editor/customizing.html#simple-settings-nodes,
>>  
>> incorrect - or am I misunderstanding something?
>>
>> """
>> Simple settings nodes have headlines of the form @ name = val. 
>> These settings set the value of name to val, with the indicated type:
>> """
>> ISTM that the headlines are of the form
>>
>> @type val
>>
>> or can you actually write
>>
>> @path = 
>>
>> etc? I can find no examples of this...
>>
>> On Saturday, March 23, 2024 at 10:55:16 PM UTC jkn wrote:
>>
>>> I think I have an earlier version of this snippet from you somewhere - I 
>>> was going to take a look at it for this purpose. So thanks!
>>>
>>> J^n
>>>
>>>
>>> On Saturday, March 23, 2024 at 10:42:32 PM UTC tbp1...@gmail.com wrote:
>>>
>>>> I've been using an "images" subdirectory under the location of the 
>>>> outline, or under the @path location if you use one.  It would make backup 
>>>> or sharing easier than some random location in the file system.  The 
>>>> script 
>>>> could check for its existence and create it if needed.  
>>>>
>>>> Here's how I get the path of the node or it's @path into the clipboard:
>>>>
>>>> """Copy the effective path of the current node to the clipboard.
>>>>
>>>> This command honors @path directives.
>>>> """
>>>> from pathlib import Path
>>>>
>>>> pth = Path(c.fullPath(p))
>>>> if pth.exists():
>>>> if pth.is_file():
>>>> direc = pth.parent
>>>> else:
>>>> direc = pth
>>>> else:
>>>> direc = Path(g.scanAllAtPathDirectives(c, p))
>>>>
>>>> if direc:
>>>> normdir = str(direc.resolve())
>>>> g.app.gui.replaceClipboardWith(normdir)
>>>> else:
>>>> g.es(f"Path {direc} doesn't exist")
>>>>
>>>> BTW, I have this script linked to a button, which is very convenient 
>>>> sometimes.
>>>> On Saturday, March 23, 2024 at 6:30:21 PM UTC-4 jkn wrote:
>>>>
>>>>> Hi Thomas
>>>>> not sure what an undoer would do here? maybe delete the file? 
>>>>> There is no leo-relevant action here (yet)
>>>>>
>>>>> I'm well aware I don't *need* the main(), but I prefer to write this 
>>>>> way. Same as with bash scripts etc. It helps for future modularity, I 
>>>>> find. 
>>>>> Of course, 'YAGNI', but still. f course you are right that main() could 
>>>>> be 
>>>>> more descriptive, this is only a POC.
>>>>>
>>>>> The tricky bit is deciding where to store the clipboard files. 
>>>>> Obsidian has a special action when you click on inserted 'snippet' 
>>>>> images; 
>>>>> it just stores the filename in the 'body', and uses its knowledge of 
>>>>> where 
>>>>> the snippets are located when you do the equivalent of CTRL-click on the 
>>>>> URL
>>>>>
>>>>> Linking the location of the 'snippets' to the leo file and/or node is 
>>>>> an interesting challenge...
>>>>>
>>>>>
>>>>>
>>>>> On Saturday, March 23, 2024 at 10:09:59 PM UTC tbp1...@gmail.com 
>>>>> wrote:
>>>>>
>>>>>> Looks pretty straightforward.  Perhaps you'll want to make it 
>>>>>> undoable (so far as Leo is concerned).  As a matter of Python 
>>>>>> programming, 
>>&

Re: A Script To Insert An Image

2024-03-23 Thread jkn
BTW [Edward], isn't this documentation, from 
https://leo-editor.github.io/leo-editor/customizing.html#simple-settings-nodes, 
incorrect - or am I misunderstanding something?

"""
Simple settings nodes have headlines of the form @ name = val. These 
settings set the value of name to val, with the indicated type:
"""
ISTM that the headlines are of the form

@type val

or can you actually write

@path = 

etc? I can find no examples of this...

On Saturday, March 23, 2024 at 10:55:16 PM UTC jkn wrote:

> I think I have an earlier version of this snippet from you somewhere - I 
> was going to take a look at it for this purpose. So thanks!
>
> J^n
>
>
> On Saturday, March 23, 2024 at 10:42:32 PM UTC tbp1...@gmail.com wrote:
>
>> I've been using an "images" subdirectory under the location of the 
>> outline, or under the @path location if you use one.  It would make backup 
>> or sharing easier than some random location in the file system.  The script 
>> could check for its existence and create it if needed.  
>>
>> Here's how I get the path of the node or it's @path into the clipboard:
>>
>> """Copy the effective path of the current node to the clipboard.
>>
>> This command honors @path directives.
>> """
>> from pathlib import Path
>>
>> pth = Path(c.fullPath(p))
>> if pth.exists():
>> if pth.is_file():
>> direc = pth.parent
>> else:
>> direc = pth
>> else:
>> direc = Path(g.scanAllAtPathDirectives(c, p))
>>
>> if direc:
>> normdir = str(direc.resolve())
>> g.app.gui.replaceClipboardWith(normdir)
>> else:
>> g.es(f"Path {direc} doesn't exist")
>>
>> BTW, I have this script linked to a button, which is very convenient 
>> sometimes.
>> On Saturday, March 23, 2024 at 6:30:21 PM UTC-4 jkn wrote:
>>
>>> Hi Thomas
>>> not sure what an undoer would do here? maybe delete the file? There 
>>> is no leo-relevant action here (yet)
>>>
>>> I'm well aware I don't *need* the main(), but I prefer to write this 
>>> way. Same as with bash scripts etc. It helps for future modularity, I find. 
>>> Of course, 'YAGNI', but still. f course you are right that main() could be 
>>> more descriptive, this is only a POC.
>>>
>>> The tricky bit is deciding where to store the clipboard files. Obsidian 
>>> has a special action when you click on inserted 'snippet' images; it just 
>>> stores the filename in the 'body', and uses its knowledge of where the 
>>> snippets are located when you do the equivalent of CTRL-click on the URL
>>>
>>> Linking the location of the 'snippets' to the leo file and/or node is an 
>>> interesting challenge...
>>>
>>>
>>>
>>> On Saturday, March 23, 2024 at 10:09:59 PM UTC tbp1...@gmail.com wrote:
>>>
>>>> Looks pretty straightforward.  Perhaps you'll want to make it undoable 
>>>> (so far as Leo is concerned).  As a matter of Python programming, defining 
>>>> a main() function here isn't needed.  If you are only going to use it as a 
>>>> script, then you don't need a function at all. Just unindent those lines 
>>>> of 
>>>> code (and delete the "main()" line) and they will run when the script 
>>>> runs.  No need to call main() at all.   If you want that clipboard part of 
>>>> the block to run and if it succeeds then insert the markdown text into a 
>>>> node, then the function shouldn't be called "main" but something more 
>>>> descriptive.
>>>>
>>>> On Saturday, March 23, 2024 at 4:59:25 PM UTC-4 jkn wrote:
>>>>
>>>>> OK, here is a simple demonstration of part of the feature I am 
>>>>> interested in.
>>>>>
>>>>> When run with an image in the (global) clipboard, it saves this to a 
>>>>> local timestamped file (under ~/tmp), and indicates how a markdown 
>>>>> reference to that file could be inserted.
>>>>>
>>>>> There's plenty more needed but this is the QClipboard part, I think.
>>>>>
>>>>> import os
>>>>> import time
>>>>> 
>>>>> def unique_png_fname():
>>>>> """ return a unique (timestamped) filename to use
>>>>> """
>>>>&

Re: A Script To Insert An Image

2024-03-23 Thread jkn
I think I have an earlier version of this snippet from you somewhere - I 
was going to take a look at it for this purpose. So thanks!

J^n


On Saturday, March 23, 2024 at 10:42:32 PM UTC tbp1...@gmail.com wrote:

> I've been using an "images" subdirectory under the location of the 
> outline, or under the @path location if you use one.  It would make backup 
> or sharing easier than some random location in the file system.  The script 
> could check for its existence and create it if needed.  
>
> Here's how I get the path of the node or it's @path into the clipboard:
>
> """Copy the effective path of the current node to the clipboard.
>
> This command honors @path directives.
> """
> from pathlib import Path
>
> pth = Path(c.fullPath(p))
> if pth.exists():
> if pth.is_file():
> direc = pth.parent
> else:
> direc = pth
> else:
> direc = Path(g.scanAllAtPathDirectives(c, p))
>
> if direc:
> normdir = str(direc.resolve())
> g.app.gui.replaceClipboardWith(normdir)
> else:
> g.es(f"Path {direc} doesn't exist")
>
> BTW, I have this script linked to a button, which is very convenient 
> sometimes.
> On Saturday, March 23, 2024 at 6:30:21 PM UTC-4 jkn wrote:
>
>> Hi Thomas
>> not sure what an undoer would do here? maybe delete the file? There 
>> is no leo-relevant action here (yet)
>>
>> I'm well aware I don't *need* the main(), but I prefer to write this way. 
>> Same as with bash scripts etc. It helps for future modularity, I find. Of 
>> course, 'YAGNI', but still. f course you are right that main() could be 
>> more descriptive, this is only a POC.
>>
>> The tricky bit is deciding where to store the clipboard files. Obsidian 
>> has a special action when you click on inserted 'snippet' images; it just 
>> stores the filename in the 'body', and uses its knowledge of where the 
>> snippets are located when you do the equivalent of CTRL-click on the URL
>>
>> Linking the location of the 'snippets' to the leo file and/or node is an 
>> interesting challenge...
>>
>>
>>
>> On Saturday, March 23, 2024 at 10:09:59 PM UTC tbp1...@gmail.com wrote:
>>
>>> Looks pretty straightforward.  Perhaps you'll want to make it undoable 
>>> (so far as Leo is concerned).  As a matter of Python programming, defining 
>>> a main() function here isn't needed.  If you are only going to use it as a 
>>> script, then you don't need a function at all. Just unindent those lines of 
>>> code (and delete the "main()" line) and they will run when the script 
>>> runs.  No need to call main() at all.   If you want that clipboard part of 
>>> the block to run and if it succeeds then insert the markdown text into a 
>>> node, then the function shouldn't be called "main" but something more 
>>> descriptive.
>>>
>>> On Saturday, March 23, 2024 at 4:59:25 PM UTC-4 jkn wrote:
>>>
>>>> OK, here is a simple demonstration of part of the feature I am 
>>>> interested in.
>>>>
>>>> When run with an image in the (global) clipboard, it saves this to a 
>>>> local timestamped file (under ~/tmp), and indicates how a markdown 
>>>> reference to that file could be inserted.
>>>>
>>>> There's plenty more needed but this is the QClipboard part, I think.
>>>>
>>>> import os
>>>> import time
>>>> 
>>>> def unique_png_fname():
>>>> """ return a unique (timestamped) filename to use
>>>> """
>>>> FORMAT="%Y-%m-%d-%H-%M-%S.png"
>>>> return time.strftime(FORMAT)
>>>>
>>>> def link_string_md(fname):
>>>> """ get markdown format to insert a filename
>>>> """
>>>> return "![[%s]]" % fname
>>>>
>>>> def main():
>>>> # get clipboard contents - default mode is global clipboard
>>>> cb = g.app.gui.qtApp.clipboard()
>>>> # is it in image format?
>>>> img = cb.image()
>>>> if not img.isNull():
>>>> basefiledir = os.path.expanduser("~/tmp")
>>>> fqfilepath = os.path.join(basefiledir, unique_png_fname())
>>>> img.save(fqfilepath, "PNG")
>>>> g.es("wrote clipboard to:&q

Re: A Script To Insert An Image

2024-03-23 Thread jkn
Hi Thomas
not sure what an undoer would do here? maybe delete the file? There is 
no leo-relevant action here (yet)

I'm well aware I don't *need* the main(), but I prefer to write this way. 
Same as with bash scripts etc. It helps for future modularity, I find. Of 
course, 'YAGNI', but still. f course you are right that main() could be 
more descriptive, this is only a POC.

The tricky bit is deciding where to store the clipboard files. Obsidian has 
a special action when you click on inserted 'snippet' images; it just 
stores the filename in the 'body', and uses its knowledge of where the 
snippets are located when you do the equivalent of CTRL-click on the URL

Linking the location of the 'snippets' to the leo file and/or node is an 
interesting challenge...



On Saturday, March 23, 2024 at 10:09:59 PM UTC tbp1...@gmail.com wrote:

> Looks pretty straightforward.  Perhaps you'll want to make it undoable (so 
> far as Leo is concerned).  As a matter of Python programming, defining a 
> main() function here isn't needed.  If you are only going to use it as a 
> script, then you don't need a function at all. Just unindent those lines of 
> code (and delete the "main()" line) and they will run when the script 
> runs.  No need to call main() at all.   If you want that clipboard part of 
> the block to run and if it succeeds then insert the markdown text into a 
> node, then the function shouldn't be called "main" but something more 
> descriptive.
>
> On Saturday, March 23, 2024 at 4:59:25 PM UTC-4 jkn wrote:
>
>> OK, here is a simple demonstration of part of the feature I am interested 
>> in.
>>
>> When run with an image in the (global) clipboard, it saves this to a 
>> local timestamped file (under ~/tmp), and indicates how a markdown 
>> reference to that file could be inserted.
>>
>> There's plenty more needed but this is the QClipboard part, I think.
>>
>> import os
>> import time
>> 
>> def unique_png_fname():
>> """ return a unique (timestamped) filename to use
>> """
>> FORMAT="%Y-%m-%d-%H-%M-%S.png"
>> return time.strftime(FORMAT)
>>
>> def link_string_md(fname):
>> """ get markdown format to insert a filename
>> """
>> return "![[%s]]" % fname
>>
>> def main():
>> # get clipboard contents - default mode is global clipboard
>> cb = g.app.gui.qtApp.clipboard()
>> # is it in image format?
>> img = cb.image()
>> if not img.isNull():
>> basefiledir = os.path.expanduser("~/tmp")
>> fqfilepath = os.path.join(basefiledir, unique_png_fname())
>> img.save(fqfilepath, "PNG")
>> g.es("wrote clipboard to:", fqfilepath)
>> g.es("could insert:", link_string_md(fqfilepath))
>> else:
>> g.es("clipboard not in image format")
>>
>> main()
>>
>>
>> On Monday, March 11, 2024 at 8:23:42 PM UTC jkn wrote:
>>
>>> Doh! should have read the documentation better.
>>>
>>> you have to test for a 'null image' using eg. img.isnull()
>>>
>>> on with my trivial experiments...
>>>
>>>
>>> On Monday, March 11, 2024 at 8:10:03 PM UTC jkn wrote:
>>>
>>>> Has anyone played much with class QClipboard? I did a couple of trivial 
>>>> experiments but I must be misunderstanding something.
>>>>
>>>> for instance, QClipboard.image() returns a non-null value even if the 
>>>> clipboard does not contain an image.
>>>>
>>>> J^n
>>>>
>>>>
>>>> On Monday, March 11, 2024 at 4:33:23 PM UTC tbp1...@gmail.com wrote:
>>>>
>>>>> It turns out that to get the relative path conversion w have to remove 
>>>>> any quotation marks around the path before running os.relpath(). So the 
>>>>> script becomes:
>>>>>
>>>>> """Insert RsT code at cursor to display an image.
>>>>>
>>>>> The path to the image file will come from a file dialog.
>>>>> This action is undoable.
>>>>> """
>>>>> PATH = g.app.gui.runOpenFileDialog(c,
>>>>> title="Import File",
>>>>> filetypes=[("All files", "*"),],
>>>>> defaultextension=".*",
>>>>> multiple=F

Re: A Script To Insert An Image

2024-03-23 Thread jkn
OK, here is a simple demonstration of part of the feature I am interested 
in.

When run with an image in the (global) clipboard, it saves this to a local 
timestamped file (under ~/tmp), and indicates how a markdown reference to 
that file could be inserted.

There's plenty more needed but this is the QClipboard part, I think.

import os
import time

def unique_png_fname():
""" return a unique (timestamped) filename to use
"""
FORMAT="%Y-%m-%d-%H-%M-%S.png"
return time.strftime(FORMAT)

def link_string_md(fname):
""" get markdown format to insert a filename
"""
return "![[%s]]" % fname

def main():
# get clipboard contents - default mode is global clipboard
cb = g.app.gui.qtApp.clipboard()
# is it in image format?
img = cb.image()
if not img.isNull():
basefiledir = os.path.expanduser("~/tmp")
fqfilepath = os.path.join(basefiledir, unique_png_fname())
img.save(fqfilepath, "PNG")
g.es("wrote clipboard to:", fqfilepath)
g.es("could insert:", link_string_md(fqfilepath))
else:
g.es("clipboard not in image format")

main()


On Monday, March 11, 2024 at 8:23:42 PM UTC jkn wrote:

> Doh! should have read the documentation better.
>
> you have to test for a 'null image' using eg. img.isnull()
>
> on with my trivial experiments...
>
>
> On Monday, March 11, 2024 at 8:10:03 PM UTC jkn wrote:
>
>> Has anyone played much with class QClipboard? I did a couple of trivial 
>> experiments but I must be misunderstanding something.
>>
>> for instance, QClipboard.image() returns a non-null value even if the 
>> clipboard does not contain an image.
>>
>> J^n
>>
>>
>> On Monday, March 11, 2024 at 4:33:23 PM UTC tbp1...@gmail.com wrote:
>>
>>> It turns out that to get the relative path conversion w have to remove 
>>> any quotation marks around the path before running os.relpath(). So the 
>>> script becomes:
>>>
>>> """Insert RsT code at cursor to display an image.
>>>
>>> The path to the image file will come from a file dialog.
>>> This action is undoable.
>>> """
>>> PATH = g.app.gui.runOpenFileDialog(c,
>>> title="Import File",
>>> filetypes=[("All files", "*"),],
>>> defaultextension=".*",
>>> multiple=False)
>>>
>>> if PATH:
>>> from os.path import relpath
>>> PATH = PATH.replace('"', '').replace("'", '')
>>> PATH = relpath(PATH)
>>> PATH = PATH.replace('\\', '/')
>>>
>>> IMAGE_TEMPLATE = f'''
>>>
>>> .. figure:: {PATH}
>>> :scale: 50%
>>>
>>> '''
>>>
>>> w = c.frame.body.wrapper
>>> p = c.p
>>> s = p.b
>>> u = c.undoer
>>>
>>> start, _ = w.getSelectionRange()
>>>
>>> undoType = 'insert-rst-image-code'
>>> undoData = u.beforeChangeNodeContents(p)
>>>
>>> head, tail = s[:start], s[start:]
>>> p.b = head + IMAGE_TEMPLATE + tail
>>>
>>> c.setChanged()
>>> p.setDirty()
>>> u.afterChangeNodeContents(p, undoType, undoData)
>>> c.redraw()
>>>
>>> On Saturday, March 9, 2024 at 2:04:19 PM UTC-5 Thomas Passin wrote:
>>>
>>>> We can't directly insert an image into a standard Leo node because they 
>>>> are text-only.  I find this very annoying sometimes, especially when I am 
>>>> writing a note and want to include an image.  
>>>>
>>>> But we can do the next best thing - insert an ReStructuredText (RsT) 
>>>> instruction to display an image so that we can view it with the 
>>>> viewrendered3 plugin (VR3). The instruction is short and easy, but it's 
>>>> still annoying to type and I usually forget the exact details. I have a 
>>>> button that toggles VR3 on and off so that it's easy to view an embedded 
>>>> image once the RsT instruction is there. An embedding command would make 
>>>> embedding with Leo as easy as embedding an image in a word processor.  
>>>>  Aha, this is Leo, let's write a script!
>>>>
>>>> Here is a script that pops up a file dialog and inserts a relative path 
>>>> to the chosen

Re: Small puzzle: where is this focus-to-body action coming from?

2024-03-21 Thread jkn


On Thursday, March 21, 2024 at 8:07:57 PM UTC gates...@gmail.com wrote:

Oh wow, I completely missed the @ignore.

Curious, my machine does focus-to-body (or something similar, at least) on 
Ctrl+Right too, but I can't find any reason for that keybinding to be in 
place, nor does it show up in my 'show-commands' output either.  Only 
appears to work from the tree or log panes -- once in the body, 
forward-word happens instead (as intended).


yes, that is the behaviour I see
 

I somehow doubt Ctrl+RightArrow equals the same keycode as Tab, because 
Ctrl+RightArrow acts differently from Tab in the body editor.

agreed
 

I wonder if this is some default tab-indexing thing in PyQT that we're not 
un-setting.  Maybe QT has Ctrl+(arrow keys) as default keybindings to 
navigate between widgets?

yes, I am wondering that too

FWIW I realised that 'Ctrl-Next' and 'Ctrl-Prior' refer to what would 
describe as "Ctrl-PgUp' and 'Ctrl-PgDn'.

This is all because I am hoping to implement something that *cycles* pane 
focus. One keystroke to move from tree->body->(maybe)log->tree-> ...

There are probably some gotchas to this, but I have a fixed pane payout...

 

Ctrl+LeftArrow in either tree or log panes also seems to set focus to the 
body pane too.  When I 'float' the body pane (have it in a separate 
window), the behavior stops -- neither Ctrl+Right nor Ctrl+Left do anything 
in the tree pane any longer.

Weird!

Jake

On Thu, Mar 21, 2024 at 3:20 PM jkn  wrote:

Yes, but that is for Alt-d, not the keystrokes I was mentioning.

I see the one that Jake mentions, above, but that seems to be for vi 
emulation, which AFAIK I do not have enabled. Anyway, that setting is 
within an @ignore node. At any rate, I do not have an entry for " 
enter-tree-expand-and-go-right-mode" from 'show-commands'

and I now want to know what keystrokes generate Ctrl-next and Ctrl-prior...

On Thursday, March 21, 2024 at 6:21:02 PM UTC tbp1...@gmail.com wrote:

On Thursday, March 21, 2024 at 2:02:50 PM UTC-4 jkn wrote:

Nevertheless - other @shortcuts I have in myLeoSettings.leo are shown in 
the log output to 'show-commands' - why not this one?


It's in there. My listings for Settings/Show Settings /Show Commands has it:

Alt+d   focus-to-body

It's hard to find things in these listings so I copied it and pasted it 
into a text editor.  A search for the command name located its line. Note 
that either a + or - symbol can be used for bindings, as best I know.

-- 

You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to leo-editor+...@googlegroups.com.

To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/22e3b8f1-93db-4f47-913d-d3321dd75acan%40googlegroups.com
 
<https://groups.google.com/d/msgid/leo-editor/22e3b8f1-93db-4f47-913d-d3321dd75acan%40googlegroups.com?utm_medium=email&utm_source=footer>
.

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/88a2cfa4-b9fa-4c6a-84c3-0ad0bd191f36n%40googlegroups.com.


Re: Small puzzle: where is this focus-to-body action coming from?

2024-03-21 Thread jkn
Yes, but that is for Alt-d, not the keystrokes I was mentioning.

I see the one that Jake mentions, above, but that seems to be for vi 
emulation, which AFAIK I do not have enabled. Anyway, that setting is 
within an @ignore node. At any rate, I do not have an entry for " 
enter-tree-expand-and-go-right-mode" from 'show-commands'

and I now want to know what keystrokes generate Ctrl-next and Ctrl-prior...

On Thursday, March 21, 2024 at 6:21:02 PM UTC tbp1...@gmail.com wrote:

> On Thursday, March 21, 2024 at 2:02:50 PM UTC-4 jkn wrote:
>
> Nevertheless - other @shortcuts I have in myLeoSettings.leo are shown in 
> the log output to 'show-commands' - why not this one?
>
>
> It's in there. My listings for Settings/Show Settings /Show Commands has 
> it:
>
> Alt+d   focus-to-body
>
> It's hard to find things in these listings so I copied it and pasted it 
> into a text editor.  A search for the command name located its line. Note 
> that either a + or - symbol can be used for bindings, as best I know.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/22e3b8f1-93db-4f47-913d-d3321dd75acan%40googlegroups.com.


Re: Small puzzle: where is this focus-to-body action coming from?

2024-03-21 Thread jkn
 sorry, I should correct myself. I *do* know about shortcuts - I have 
forgotten that that was the name for the 'bind command to key' settings. I 
was thinking that was '@binding' or something.

Nevertheless - other @shortcuts I have in myLeoSettings.leo are shown in 
the log output to 'show-commands' - why not this one?

Or is it because this (Ctrl-right-arrow) is "Ctrl-Next"? This is shown in 
LeoSettings.leo and in the log pane:

tab-cycle-previous  = Ctrl-Prior
tab-cycle-next  = Ctrl-Next
tab-cycle-next  = Ctrl-Tab

? (I had never though of 'Ctrl-Next', and 'Ctrl-Prior', as referring to 
these key presses)

Great, in that case ... except that for me you can't *cycle* between the 
panes using this, only from tree to body. At least for me ... more 
investigation...

J^n


On Thursday, March 21, 2024 at 5:51:57 PM UTC jkn wrote:

> I am not sure I even know what @shortcuts are! They are hardly mentioned 
> in the docs.
>
> Right, off to investigate, thanks...
>
> On Thursday, March 21, 2024 at 5:28:09 PM UTC tbp1...@gmail.com wrote:
>
>> It's in LeoSettings.leo, in the node @shortcuts Gui operations.
>>
>> On Thursday, March 21, 2024 at 10:33:33 AM UTC-4 jkn wrote:
>>
>>> I keep meaning to look at 'improving' (for my needs) navigation between 
>>> Tree and body panes. Whilst taking a look at this again I found a puzzle.
>>>
>>> I have what is (I think) the standard bindings for this:
>>>
>>> # show-commands
>>> Alt+d   focus-to-body
>>>tree:Tab focus-to-body
>>> focus-to-find
>>> focus-to-log
>>> focus-to-minibuffer
>>> focus-to-spell-tab
>>> Alt+t   focus-to-tree
>>>
>>> However - CTRL+right (ie. main arrow keys on my 107-key KB) seems to do 
>>> focus-to-body as well as TAB.
>>>
>>> Any idea where this binding might be occurring? Is CTRL-right getting 
>>> turned into TAB somewhere? How can I find out, if show-commands gives the 
>>> output above?
>>>
>>> Thanks, jon N
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/0be80899-b9d8-4acc-afed-e50a74766276n%40googlegroups.com.


Re: Small puzzle: where is this focus-to-body action coming from?

2024-03-21 Thread jkn
I am not sure I even know what @shortcuts are! They are hardly mentioned in 
the docs.

Right, off to investigate, thanks...

On Thursday, March 21, 2024 at 5:28:09 PM UTC tbp1...@gmail.com wrote:

> It's in LeoSettings.leo, in the node @shortcuts Gui operations.
>
> On Thursday, March 21, 2024 at 10:33:33 AM UTC-4 jkn wrote:
>
>> I keep meaning to look at 'improving' (for my needs) navigation between 
>> Tree and body panes. Whilst taking a look at this again I found a puzzle.
>>
>> I have what is (I think) the standard bindings for this:
>>
>> # show-commands
>> Alt+d   focus-to-body
>>tree:Tab focus-to-body
>> focus-to-find
>> focus-to-log
>> focus-to-minibuffer
>> focus-to-spell-tab
>> Alt+t   focus-to-tree
>>
>> However - CTRL+right (ie. main arrow keys on my 107-key KB) seems to do 
>> focus-to-body as well as TAB.
>>
>> Any idea where this binding might be occurring? Is CTRL-right getting 
>> turned into TAB somewhere? How can I find out, if show-commands gives the 
>> output above?
>>
>> Thanks, jon N
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/de7a882f-a1ce-4b97-84bf-d75b921e10a1n%40googlegroups.com.


Small puzzle: where is this focus-to-body action coming from?

2024-03-21 Thread jkn
I keep meaning to look at 'improving' (for my needs) navigation between 
Tree and body panes. Whilst taking a look at this again I found a puzzle.

I have what is (I think) the standard bindings for this:

# show-commands
Alt+d   focus-to-body
   tree:Tab focus-to-body
focus-to-find
focus-to-log
focus-to-minibuffer
focus-to-spell-tab
Alt+t   focus-to-tree

However - CTRL+right (ie. main arrow keys on my 107-key KB) seems to do 
focus-to-body as well as TAB.

Any idea where this binding might be occurring? Is CTRL-right getting 
turned into TAB somewhere? How can I find out, if show-commands gives the 
output above?

Thanks, jon N


-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/6479b10a-ca08-4767-bf1a-15fe3e9ef0ean%40googlegroups.com.


TIL in Leo: environment variables are expanded in @url parameters

2024-03-17 Thread jkn
I tried this, fully expecting it to fail, but it works!

@url file://${SEAFILE}/rest/of/path/to/my_file

FWIW: I have recently switched from using Nextcloud to sync between 
machines on my local network, to Seafile. I have had a lot of trouble with 
Nextcloud in recent months; Seafile seems to do the one thing it is 
supposed to, with much less fuss than Nextcloud.

So on each machine (Windows/Linux) I have an environment variable SEAFILE 
that points to the top shared director on the local filesystem. This has 
been working for @file nodes, but I hadn't expected it to also work for 
URIs.

Hurrah and Thanks!

https://www.seafile.com   # Open Source File Sync&Share and Document 
Collaboration Platform

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/0928eea3-10ba-4a0a-9dbc-ee930a002351n%40googlegroups.com.


Re: A Script To Insert An Image

2024-03-11 Thread jkn
Doh! should have read the documentation better.

you have to test for a 'null image' using eg. img.isnull()

on with my trivial experiments...


On Monday, March 11, 2024 at 8:10:03 PM UTC jkn wrote:

> Has anyone played much with class QClipboard? I did a couple of trivial 
> experiments but I must be misunderstanding something.
>
> for instance, QClipboard.image() returns a non-null value even if the 
> clipboard does not contain an image.
>
> J^n
>
>
> On Monday, March 11, 2024 at 4:33:23 PM UTC tbp1...@gmail.com wrote:
>
>> It turns out that to get the relative path conversion w have to remove 
>> any quotation marks around the path before running os.relpath(). So the 
>> script becomes:
>>
>> """Insert RsT code at cursor to display an image.
>>
>> The path to the image file will come from a file dialog.
>> This action is undoable.
>> """
>> PATH = g.app.gui.runOpenFileDialog(c,
>> title="Import File",
>> filetypes=[("All files", "*"),],
>> defaultextension=".*",
>> multiple=False)
>>
>> if PATH:
>> from os.path import relpath
>> PATH = PATH.replace('"', '').replace("'", '')
>> PATH = relpath(PATH)
>> PATH = PATH.replace('\\', '/')
>>
>> IMAGE_TEMPLATE = f'''
>>
>> .. figure:: {PATH}
>> :scale: 50%
>>
>> '''
>>
>> w = c.frame.body.wrapper
>> p = c.p
>> s = p.b
>> u = c.undoer
>>
>> start, _ = w.getSelectionRange()
>>
>> undoType = 'insert-rst-image-code'
>> undoData = u.beforeChangeNodeContents(p)
>>
>> head, tail = s[:start], s[start:]
>> p.b = head + IMAGE_TEMPLATE + tail
>>
>> c.setChanged()
>> p.setDirty()
>> u.afterChangeNodeContents(p, undoType, undoData)
>> c.redraw()
>>
>> On Saturday, March 9, 2024 at 2:04:19 PM UTC-5 Thomas Passin wrote:
>>
>>> We can't directly insert an image into a standard Leo node because they 
>>> are text-only.  I find this very annoying sometimes, especially when I am 
>>> writing a note and want to include an image.  
>>>
>>> But we can do the next best thing - insert an ReStructuredText (RsT) 
>>> instruction to display an image so that we can view it with the 
>>> viewrendered3 plugin (VR3). The instruction is short and easy, but it's 
>>> still annoying to type and I usually forget the exact details. I have a 
>>> button that toggles VR3 on and off so that it's easy to view an embedded 
>>> image once the RsT instruction is there. An embedding command would make 
>>> embedding with Leo as easy as embedding an image in a word processor.  
>>>  Aha, this is Leo, let's write a script!
>>>
>>> Here is a script that pops up a file dialog and inserts a relative path 
>>> to the chosen file.  There are several small variations which I discuss 
>>> after the code.
>>>
>>> """Insert RsT code at cursor to display an image.
>>>
>>> The path to the image file will come from a file dialog.
>>> This action is undoable.
>>> """
>>> PATH = g.app.gui.runOpenFileDialog(c,
>>> title="Import File",
>>> filetypes=[("All files", "*"),],
>>> defaultextension=".*",
>>> multiple=False)
>>>
>>> if PATH:
>>> from os.path import relpath
>>> PATH = relpath(PATH)
>>> PATH = PATH.replace('\\', '/').replace('"', '').replace("'", '')
>>> IMAGE_TEMPLATE = f'''
>>>
>>> .. figure:: {PATH}
>>> :scale: 50%
>>>
>>> '''
>>> w = c.frame.body.wrapper
>>> p = c.p
>>> s = p.b
>>> u = c.undoer
>>>
>>> start, _ = w.getSelectionRange()
>>>
>>> undoType = 'insert-rst-image-code'
>>> undoData = u.beforeChangeNodeContents(p)
>>>
>>> head, tail = s[:start], s[start:]
>>> p.b = head + IMAGE_TEMPLATE + tail
>>>
>>> c.setChanged()
>>> p.setDirty()
>>> u.afterChangeNodeContents(p, undoType, undoData)
>>> c.redraw()
>>>
>>> Variations:
&

Re: A Script To Insert An Image

2024-03-11 Thread jkn
Has anyone played much with class QClipboard? I did a couple of trivial 
experiments but I must be misunderstanding something.

for instance, QClipboard.image() returns a non-null value even if the 
clipboard does not contain an image.

J^n


On Monday, March 11, 2024 at 4:33:23 PM UTC tbp1...@gmail.com wrote:

> It turns out that to get the relative path conversion w have to remove any 
> quotation marks around the path before running os.relpath(). So the script 
> becomes:
>
> """Insert RsT code at cursor to display an image.
>
> The path to the image file will come from a file dialog.
> This action is undoable.
> """
> PATH = g.app.gui.runOpenFileDialog(c,
> title="Import File",
> filetypes=[("All files", "*"),],
> defaultextension=".*",
> multiple=False)
>
> if PATH:
> from os.path import relpath
> PATH = PATH.replace('"', '').replace("'", '')
> PATH = relpath(PATH)
> PATH = PATH.replace('\\', '/')
>
> IMAGE_TEMPLATE = f'''
>
> .. figure:: {PATH}
> :scale: 50%
>
> '''
>
> w = c.frame.body.wrapper
> p = c.p
> s = p.b
> u = c.undoer
>
> start, _ = w.getSelectionRange()
>
> undoType = 'insert-rst-image-code'
> undoData = u.beforeChangeNodeContents(p)
>
> head, tail = s[:start], s[start:]
> p.b = head + IMAGE_TEMPLATE + tail
>
> c.setChanged()
> p.setDirty()
> u.afterChangeNodeContents(p, undoType, undoData)
> c.redraw()
>
> On Saturday, March 9, 2024 at 2:04:19 PM UTC-5 Thomas Passin wrote:
>
>> We can't directly insert an image into a standard Leo node because they 
>> are text-only.  I find this very annoying sometimes, especially when I am 
>> writing a note and want to include an image.  
>>
>> But we can do the next best thing - insert an ReStructuredText (RsT) 
>> instruction to display an image so that we can view it with the 
>> viewrendered3 plugin (VR3). The instruction is short and easy, but it's 
>> still annoying to type and I usually forget the exact details. I have a 
>> button that toggles VR3 on and off so that it's easy to view an embedded 
>> image once the RsT instruction is there. An embedding command would make 
>> embedding with Leo as easy as embedding an image in a word processor.  
>>  Aha, this is Leo, let's write a script!
>>
>> Here is a script that pops up a file dialog and inserts a relative path 
>> to the chosen file.  There are several small variations which I discuss 
>> after the code.
>>
>> """Insert RsT code at cursor to display an image.
>>
>> The path to the image file will come from a file dialog.
>> This action is undoable.
>> """
>> PATH = g.app.gui.runOpenFileDialog(c,
>> title="Import File",
>> filetypes=[("All files", "*"),],
>> defaultextension=".*",
>> multiple=False)
>>
>> if PATH:
>> from os.path import relpath
>> PATH = relpath(PATH)
>> PATH = PATH.replace('\\', '/').replace('"', '').replace("'", '')
>> IMAGE_TEMPLATE = f'''
>>
>> .. figure:: {PATH}
>> :scale: 50%
>>
>> '''
>> w = c.frame.body.wrapper
>> p = c.p
>> s = p.b
>> u = c.undoer
>>
>> start, _ = w.getSelectionRange()
>>
>> undoType = 'insert-rst-image-code'
>> undoData = u.beforeChangeNodeContents(p)
>>
>> head, tail = s[:start], s[start:]
>> p.b = head + IMAGE_TEMPLATE + tail
>>
>> c.setChanged()
>> p.setDirty()
>> u.afterChangeNodeContents(p, undoType, undoData)
>> c.redraw()
>>
>> Variations:
>> 1.  If you want an absolute path instead of a relative path, delete the 
>> lines
>> from os.path import relpath
>> PATH = relpath(PATH)
>> with
>>
>> 2. If you  want to get the path from the clipboard instead of a file 
>> dialog, replace the lines
>>
>> PATH = g.app.gui.runOpenFileDialog(c,
>> title="Import File",
>> filetypes=[("All files", "*"),],
>> defaultextension=".*",
>> multiple=False)
>>
>> with the line 
>>
>> PATH = g.app.gui.getTextFromClipboard()
>>
>> 3. If you want the embedded image to be full width instead of 50%, delete 
>> the line
>>
>> :scale: 50%
>>
>> 4. You can make this work with Markdown or Asciidoc by using their 
>> embedding instruction in the TEMPLATE instead of the RsT one.
>>
>> I have added the command to my own local menu.  VR3 can open in a tab in 
>> the log pane; the command for toggling in a tab is *vr3-toggle-tab. * I 
>> usually like opening it in the log pane instead of in its own separate pane.
>>
>> If you would like to create a local menu of your own and don't know how, 
>> it's easy.  Just ask and I'll show what to add to myLeoSettings,leo.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/f753abeb-9c3f-4f93-a462-54101e9be527n%40googlegroups.com.


Re: A Script To Insert An Image

2024-03-09 Thread jkn
I am really thinking of the situation where I have already captured an 
image to the clipboard (using some other app...), and then want to paste 
into Leo. But there will undoubtably be something useful in what Terry has 
done

On Saturday, March 9, 2024 at 8:34:45 PM UTC tbp1...@gmail.com wrote:

> Yup, Terry Brown has already done most of it for us in the screen_capture 
> plugin.  Here's the docstring:
>
> """
> screen_capture.py
> =
>
> Capture screen shots - single frames are useful.  The
> `Recorder` class can also capture frames continuously but that's not
> really useful, it doesn't handle audio or video encoding, and can't 
> maintain
> a 30 fps frame rate.  The code for doing so is not hooked up in this 
> plugin.
>
> Screen captures are saved in ``~/.leo/screen_captures`` with
> timestamps in the filenames.
>
> Commands
> 
>
> ``screen-capture-5sec``
>   Wait five seconds, then take a screen shot.
> ``screen-capture-now``
>   Take a screen shot.
>
> Settings
> 
>
> ``@string screen-capture-save-path``
>   Save screen shots here instead of ~/.leo/screen_captures
>
> Terry Brown, terry_...@yahoo.com, Fri Apr 19 16:33:45 2013
> """
>
> The code may need to be updated for Qt6, since it was originally written 
> for Qt4 in 2013. Or just the key capture part of the code could be used, 
> since the entire plugin is more complicated than necessary.  Also it 
> doesn't capture a part of the screen as best as I can see, only the whole.
> On Saturday, March 9, 2024 at 3:27:30 PM UTC-5 jkn wrote:
>
>> I would expect that to be somewhat os-dependant (I mostly use Linux), but 
>> perhaps it is there. I will try to take a look for clipboard-paste 
>> functions.
>>
>>
>>
>> On Saturday, March 9, 2024 at 8:22:44 PM UTC tbp1...@gmail.com wrote:
>>
>>> I seem to remember that somewhere in the code base, Leo code to capture 
>>> the screen has already been worked out.  If that's the case we're in clover.
>>>
>>> On Saturday, March 9, 2024 at 3:09:24 PM UTC-5 jkn wrote:
>>>
>>>> The way I have been using the Obsidian feature is to paste image bytes 
>>>> (eg. from a screen region capture). So Obsidian saves a file:
>>>>
>>>> /path/to/attachments/ 
>>>>
>>>> Pasted image 20240228230106.png
>>>>
>>>>
>>>> Where /path/to/attachments is an Obsidian setting, and the name of the 
>>>> file is clearly a timestamp.
>>>>
>>>>
>>>> Obsidian only uses markdown, so it inserts 
>>>>
>>>>
>>>> ![[Pasted image 20240228230106.png]]
>>>>
>>>>
>>>> into the 'node being edited'
>>>>
>>>>
>>>> I think you can also drag and drop files into a 'node'.
>>>>
>>>>
>>>> There would clearly have to be some work to make this generally useful 
>>>> in a Leo context...
>>>>
>>>>
>>>>
>>>> On Saturday, March 9, 2024 at 7:35:15 PM UTC tbp1...@gmail.com wrote:
>>>>
>>>>> Shouldn't be hard.  What would be on the clipboard?  Image bytes?  Or 
>>>>> an image filename?  I often select an image in a file manager window, 
>>>>> copy 
>>>>> it to an "images" subdirectory of the current outline, then write the 
>>>>> embedding code into and "images" child node.  That would be easy to write 
>>>>> a 
>>>>> script for.
>>>>>
>>>>> On Saturday, March 9, 2024 at 2:14:41 PM UTC-5 jkn wrote:
>>>>>
>>>>>> This looks interesting and useful, thanks Thomas. I confess I 
>>>>>> rarely/never use Leo with images, I really should experiment a little.
>>>>>>
>>>>>> Recently I have been using Obsidian as a note-taking app (Joplin is 
>>>>>> similar). Neither are as capable as Leo, in many ways, but they have 
>>>>>> their 
>>>>>> niceties.
>>>>>> One that is handy when note-taking is the ability to paste *from the 
>>>>>> clipboard*. You can setup an area (directory0 in an Obsidian 'vault' - 
>>>>>> then 
>>>>>> 'paste from clipboard' will
>>>>>> (a) create a unique filename within the image directory, and put the 
>>>>>> clipboard contents in there as eg. a

Re: A Script To Insert An Image

2024-03-09 Thread jkn
I would expect that to be somewhat os-dependant (I mostly use Linux), but 
perhaps it is there. I will try to take a look for clipboard-paste 
functions.



On Saturday, March 9, 2024 at 8:22:44 PM UTC tbp1...@gmail.com wrote:

> I seem to remember that somewhere in the code base, Leo code to capture 
> the screen has already been worked out.  If that's the case we're in clover.
>
> On Saturday, March 9, 2024 at 3:09:24 PM UTC-5 jkn wrote:
>
>> The way I have been using the Obsidian feature is to paste image bytes 
>> (eg. from a screen region capture). So Obsidian saves a file:
>>
>> /path/to/attachments/ 
>>
>> Pasted image 20240228230106.png
>>
>>
>> Where /path/to/attachments is an Obsidian setting, and the name of the 
>> file is clearly a timestamp.
>>
>>
>> Obsidian only uses markdown, so it inserts 
>>
>>
>> ![[Pasted image 20240228230106.png]]
>>
>>
>> into the 'node being edited'
>>
>>
>> I think you can also drag and drop files into a 'node'.
>>
>>
>> There would clearly have to be some work to make this generally useful in 
>> a Leo context...
>>
>>
>>
>> On Saturday, March 9, 2024 at 7:35:15 PM UTC tbp1...@gmail.com wrote:
>>
>>> Shouldn't be hard.  What would be on the clipboard?  Image bytes?  Or an 
>>> image filename?  I often select an image in a file manager window, copy it 
>>> to an "images" subdirectory of the current outline, then write the 
>>> embedding code into and "images" child node.  That would be easy to write a 
>>> script for.
>>>
>>> On Saturday, March 9, 2024 at 2:14:41 PM UTC-5 jkn wrote:
>>>
>>>> This looks interesting and useful, thanks Thomas. I confess I 
>>>> rarely/never use Leo with images, I really should experiment a little.
>>>>
>>>> Recently I have been using Obsidian as a note-taking app (Joplin is 
>>>> similar). Neither are as capable as Leo, in many ways, but they have their 
>>>> niceties.
>>>> One that is handy when note-taking is the ability to paste *from the 
>>>> clipboard*. You can setup an area (directory0 in an Obsidian 'vault' - 
>>>> then 
>>>> 'paste from clipboard' will
>>>> (a) create a unique filename within the image directory, and put the 
>>>> clipboard contents in there as eg. a .png file
>>>> (b) add a (markdown) reference to the new image in the 'note' that you 
>>>> are in.
>>>>
>>>> It'd be nice to have something similar in Leo... ;-)
>>>>
>>>> Regards, Jon N
>>>>
>>>> On Saturday, March 9, 2024 at 7:04:19 PM UTC tbp1...@gmail.com wrote:
>>>>
>>>>> We can't directly insert an image into a standard Leo node because 
>>>>> they are text-only.  I find this very annoying sometimes, especially when 
>>>>> I 
>>>>> am writing a note and want to include an image.  
>>>>>
>>>>> But we can do the next best thing - insert an ReStructuredText (RsT) 
>>>>> instruction to display an image so that we can view it with the 
>>>>> viewrendered3 plugin (VR3). The instruction is short and easy, but it's 
>>>>> still annoying to type and I usually forget the exact details. I have a 
>>>>> button that toggles VR3 on and off so that it's easy to view an embedded 
>>>>> image once the RsT instruction is there. An embedding command would make 
>>>>> embedding with Leo as easy as embedding an image in a word processor.  
>>>>>  Aha, this is Leo, let's write a script!
>>>>>
>>>>> Here is a script that pops up a file dialog and inserts a relative 
>>>>> path to the chosen file.  There are several small variations which I 
>>>>> discuss after the code.
>>>>>
>>>>> """Insert RsT code at cursor to display an image.
>>>>>
>>>>> The path to the image file will come from a file dialog.
>>>>> This action is undoable.
>>>>> """
>>>>> PATH = g.app.gui.runOpenFileDialog(c,
>>>>> title="Import File",
>>>>> filetypes=[("All files", "*"),],
>>>>> defaultextension=".*",
>>>>> multiple=False)
>>>>>
>>>>

Re: A Script To Insert An Image

2024-03-09 Thread jkn
The way I have been using the Obsidian feature is to paste image bytes (eg. 
from a screen region capture). So Obsidian saves a file:

/path/to/attachments/ 

Pasted image 20240228230106.png


Where /path/to/attachments is an Obsidian setting, and the name of the file 
is clearly a timestamp.


Obsidian only uses markdown, so it inserts 


![[Pasted image 20240228230106.png]]


into the 'node being edited'


I think you can also drag and drop files into a 'node'.


There would clearly have to be some work to make this generally useful in a 
Leo context...



On Saturday, March 9, 2024 at 7:35:15 PM UTC tbp1...@gmail.com wrote:

> Shouldn't be hard.  What would be on the clipboard?  Image bytes?  Or an 
> image filename?  I often select an image in a file manager window, copy it 
> to an "images" subdirectory of the current outline, then write the 
> embedding code into and "images" child node.  That would be easy to write a 
> script for.
>
> On Saturday, March 9, 2024 at 2:14:41 PM UTC-5 jkn wrote:
>
>> This looks interesting and useful, thanks Thomas. I confess I 
>> rarely/never use Leo with images, I really should experiment a little.
>>
>> Recently I have been using Obsidian as a note-taking app (Joplin is 
>> similar). Neither are as capable as Leo, in many ways, but they have their 
>> niceties.
>> One that is handy when note-taking is the ability to paste *from the 
>> clipboard*. You can setup an area (directory0 in an Obsidian 'vault' - then 
>> 'paste from clipboard' will
>> (a) create a unique filename within the image directory, and put the 
>> clipboard contents in there as eg. a .png file
>> (b) add a (markdown) reference to the new image in the 'note' that you 
>> are in.
>>
>> It'd be nice to have something similar in Leo... ;-)
>>
>> Regards, Jon N
>>
>> On Saturday, March 9, 2024 at 7:04:19 PM UTC tbp1...@gmail.com wrote:
>>
>>> We can't directly insert an image into a standard Leo node because they 
>>> are text-only.  I find this very annoying sometimes, especially when I am 
>>> writing a note and want to include an image.  
>>>
>>> But we can do the next best thing - insert an ReStructuredText (RsT) 
>>> instruction to display an image so that we can view it with the 
>>> viewrendered3 plugin (VR3). The instruction is short and easy, but it's 
>>> still annoying to type and I usually forget the exact details. I have a 
>>> button that toggles VR3 on and off so that it's easy to view an embedded 
>>> image once the RsT instruction is there. An embedding command would make 
>>> embedding with Leo as easy as embedding an image in a word processor.  
>>>  Aha, this is Leo, let's write a script!
>>>
>>> Here is a script that pops up a file dialog and inserts a relative path 
>>> to the chosen file.  There are several small variations which I discuss 
>>> after the code.
>>>
>>> """Insert RsT code at cursor to display an image.
>>>
>>> The path to the image file will come from a file dialog.
>>> This action is undoable.
>>> """
>>> PATH = g.app.gui.runOpenFileDialog(c,
>>> title="Import File",
>>> filetypes=[("All files", "*"),],
>>> defaultextension=".*",
>>> multiple=False)
>>>
>>> if PATH:
>>> from os.path import relpath
>>> PATH = relpath(PATH)
>>> PATH = PATH.replace('\\', '/').replace('"', '').replace("'", '')
>>> IMAGE_TEMPLATE = f'''
>>>
>>> .. figure:: {PATH}
>>> :scale: 50%
>>>
>>> '''
>>> w = c.frame.body.wrapper
>>> p = c.p
>>> s = p.b
>>> u = c.undoer
>>>
>>> start, _ = w.getSelectionRange()
>>>
>>> undoType = 'insert-rst-image-code'
>>> undoData = u.beforeChangeNodeContents(p)
>>>
>>> head, tail = s[:start], s[start:]
>>> p.b = head + IMAGE_TEMPLATE + tail
>>>
>>> c.setChanged()
>>> p.setDirty()
>>> u.afterChangeNodeContents(p, undoType, undoData)
>>> c.redraw()
>>>
>>> Variations:
>>> 1.  If you want an absolute path instead of a relative path, delete the 
>>> lines
>>> from os.path import relpath
>>> PATH = relpath(PATH)
&g

Re: A Script To Insert An Image

2024-03-09 Thread jkn
This looks interesting and useful, thanks Thomas. I confess I rarely/never 
use Leo with images, I really should experiment a little.

Recently I have been using Obsidian as a note-taking app (Joplin is 
similar). Neither are as capable as Leo, in many ways, but they have their 
niceties.
One that is handy when note-taking is the ability to paste *from the 
clipboard*. You can setup an area (directory0 in an Obsidian 'vault' - then 
'paste from clipboard' will
(a) create a unique filename within the image directory, and put the 
clipboard contents in there as eg. a .png file
(b) add a (markdown) reference to the new image in the 'note' that you are 
in.

It'd be nice to have something similar in Leo... ;-)

Regards, Jon N

On Saturday, March 9, 2024 at 7:04:19 PM UTC tbp1...@gmail.com wrote:

> We can't directly insert an image into a standard Leo node because they 
> are text-only.  I find this very annoying sometimes, especially when I am 
> writing a note and want to include an image.  
>
> But we can do the next best thing - insert an ReStructuredText (RsT) 
> instruction to display an image so that we can view it with the 
> viewrendered3 plugin (VR3). The instruction is short and easy, but it's 
> still annoying to type and I usually forget the exact details. I have a 
> button that toggles VR3 on and off so that it's easy to view an embedded 
> image once the RsT instruction is there. An embedding command would make 
> embedding with Leo as easy as embedding an image in a word processor.  
>  Aha, this is Leo, let's write a script!
>
> Here is a script that pops up a file dialog and inserts a relative path to 
> the chosen file.  There are several small variations which I discuss after 
> the code.
>
> """Insert RsT code at cursor to display an image.
>
> The path to the image file will come from a file dialog.
> This action is undoable.
> """
> PATH = g.app.gui.runOpenFileDialog(c,
> title="Import File",
> filetypes=[("All files", "*"),],
> defaultextension=".*",
> multiple=False)
>
> if PATH:
> from os.path import relpath
> PATH = relpath(PATH)
> PATH = PATH.replace('\\', '/').replace('"', '').replace("'", '')
> IMAGE_TEMPLATE = f'''
>
> .. figure:: {PATH}
> :scale: 50%
>
> '''
> w = c.frame.body.wrapper
> p = c.p
> s = p.b
> u = c.undoer
>
> start, _ = w.getSelectionRange()
>
> undoType = 'insert-rst-image-code'
> undoData = u.beforeChangeNodeContents(p)
>
> head, tail = s[:start], s[start:]
> p.b = head + IMAGE_TEMPLATE + tail
>
> c.setChanged()
> p.setDirty()
> u.afterChangeNodeContents(p, undoType, undoData)
> c.redraw()
>
> Variations:
> 1.  If you want an absolute path instead of a relative path, delete the 
> lines
> from os.path import relpath
> PATH = relpath(PATH)
> with
>
> 2. If you  want to get the path from the clipboard instead of a file 
> dialog, replace the lines
>
> PATH = g.app.gui.runOpenFileDialog(c,
> title="Import File",
> filetypes=[("All files", "*"),],
> defaultextension=".*",
> multiple=False)
>
> with the line 
>
> PATH = g.app.gui.getTextFromClipboard()
>
> 3. If you want the embedded image to be full width instead of 50%, delete 
> the line
>
> :scale: 50%
>
> 4. You can make this work with Markdown or Asciidoc by using their 
> embedding instruction in the TEMPLATE instead of the RsT one.
>
> I have added the command to my own local menu.  VR3 can open in a tab in 
> the log pane; the command for toggling in a tab is *vr3-toggle-tab. * I 
> usually like opening it in the log pane instead of in its own separate pane.
>
> If you would like to create a local menu of your own and don't know how, 
> it's easy.  Just ask and I'll show what to add to myLeoSettings,leo.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/555b3f5c-24a8-4529-adb4-ebf2d945098cn%40googlegroups.com.


Re: TIL in Leo: decluttering headlines

2024-02-20 Thread jkn
update - it does seem to work ... but I have seen some strangenesses.

- an exception failure, ~ bad number pof parameters
- a case where no more headlines appear below the 'decluttered' one.

I will continue to investigate...

J^n


On Tuesday, February 20, 2024 at 4:21:54 PM UTC jkn wrote:

> I had never seen this before:
>
> 
> https://leo-editor.github.io/leo-editor/customizing.html#decluttering-headlines
>
> this seems very cool! I have been messing around with node icons, but this 
> seems a much better scheme. Is the documentation up to date?
>
> Regards
> Jon N
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/f6a8fac1-4c45-4da3-a257-9cff11d8241en%40googlegroups.com.


TIL in Leo: decluttering headlines

2024-02-20 Thread jkn
I had never seen this before:


https://leo-editor.github.io/leo-editor/customizing.html#decluttering-headlines

this seems very cool! I have been messing around with node icons, but this 
seems a much better scheme. Is the documentation up to date?

Regards
Jon N

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/c6114c4c-0cf1-4c56-b445-287fc720dac9n%40googlegroups.com.


Re: [Windows] How to install and run Leo?

2024-02-12 Thread jkn
heh, I was on (several) Ecco Pro mailing lists for years; Yahoo, groups.io 
etc.

There are still quite a few things I miss about Ecco Pro. A true 
cross-platform version of something like it,
scriptable in Python, would be quite a thing.


On Sunday, February 11, 2024 at 11:11:04 PM UTC Rob wrote:

> I was the 'culprit' who recommended Leo on the ECCO group. I also should 
> have explained that Leo can operate as a single pane outliner by simply 
> hiding the body pane (see screenshot).
>
> Rob...
>
> [image: Screenshot 2024-02-11 180945.jpg]
>
> On Sunday, February 11, 2024 at 9:51:08 AM UTC-5 Edward K. Ream wrote:
>
>>
>>
>> On Sun, Feb 11, 2024 at 7:37 AM Heck Lennon  wrote:
>>
>>> Thanks, it finally worked.
>>
>>
>> Excellent. Thanks for your testing! Your experiences have helped improve 
>> Leo.
>>
>> Edward
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/48431c0d-bade-4c04-bc6c-456efa7f7de9n%40googlegroups.com.


Re: ✨LeoJS beta 0.2.8 Released!

2024-01-25 Thread jkn
PS: there's a gentleman in the image above who makes me think of 
Vitalije... ;-)


On Wednesday, January 3, 2024 at 11:36:35 AM UTC jkn wrote:

> Yes, these are very entertaining. How do you create them, out of interest? 
> Perhaps you should have an Avatar for Edward and yourself on the next one...
>
> On Wednesday, January 3, 2024 at 10:46:22 AM UTC Edward K. Ream wrote:
>
>> On Tue, Jan 2, 2024 at 7:32 PM Félix  wrote:
>>
>>> jkn Thank you very much for trying out LeoInteg and LeoJS!!
>>
>>
>> Great illustration :-) Please keep them coming. Let's start a gallery!
>>
>> Edward
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/6e148815-327c-44d1-9fef-87d6c04a7eb8n%40googlegroups.com.


Re: ✨LeoJS beta 0.2.11 Released!

2024-01-23 Thread jkn
Reminds me of this, a little:

"I asked Chat-GPT to make this pic of my dog increasingly more Scottish" 
https://threadreaderapp.com/thread/1734891462666441075.html


On Tuesday, January 23, 2024 at 1:45:15 PM UTC Edward K. Ream wrote:

> On Mon, Jan 22, 2024 at 10:45 PM Félix wrote:
>
> > 📣Introducing LeoJS Beta 0.2.11
>
> > Similar to the latest LeoInteg release, here's the new features that I 
> added in LeoJS since the last version: 
>
> Many thanks again for your work on LeoInteg and LeoJS!
>
> The Three Lions are looking more and more alike!
>
> Love these graphics :-)
>
> The picture in my mind is Blaise Pascal driving a Roman chariot pulled by 
> three lions labeled Leo, LeoInteg and LeoJS :-)
>
> Edward
>
> [image: banner-leojs-fluo.png]
>
>  [image: banner-descartes-lion.png]
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/61fb2013-075a-41ed-a121-ef95a5fd7db4n%40googlegroups.com.


Re: Discuss: what should path expressions contain?

2024-01-10 Thread jkn
Yes, I ended up with

@path ${NEXTCLOUD}/dir1/dir2
@file myfile.txt

(I prefer using ${NEXTCLOUD} to $NEXTCLOUD, but that is a very minor point)

one thing I note is that leo says eg:

wrote file myfile.txt

where I would prefer it wrote the full path.

I now seem to have quite a few files scattered around called 
"{{g.app.homedir}}{{sep}}"...

J^n



On Wednesday, January 10, 2024 at 4:49:37 PM UTC tbp1...@gmail.com wrote:

> I just did some testing on Windows, and with an @file node Leo acts as if 
> the os.path functions expanduser() and expandvars() are applied, as well as 
> the  abspath() that would be expected (and probably realpath() but I didn't 
> check that).  This means that you can set an environmental variable, say 
> VAR, and use it in the path expression as $VAR.  I didn't find any 
> variables that seem to have been added by Leo.
>
> I didn't find where in LeoPyRef.leo this all happens.
>
> On Wednesday, January 10, 2024 at 9:53:06 AM UTC-5 jkn wrote:
>
>> On Wednesday, January 10, 2024 at 1:00:58 PM UTC tbp1...@gmail.com wrote:
>>
>> Edward made some changes during this thread, IIRC.
>>
>>
>> Yes ... I was trying to track the end results of this.
>>
>> The description of {{sep}} etc. used to be on the leoeditor.com 
>> documentation,
>> but no longer seems to be there.
>> A short 'migration guide' paragraph would be useful, it was not clear to 
>> me
>> that my nodes with this style of directives need to be changed.
>>  
>>
>> On Wednesday, January 10, 2024 at 5:21:22 AM UTC-5 Edward K. Ream wrote:
>>
>> On Tue, Jan 9, 2024 at 1:14 PM jkn  wrote:
>>
>> did the work that got done here ever get documented? 
>>
>>
>> Luke, use the find command!
>>
>> Searching LeoDocs.leo for "path expression" yields these items from the 
>> 6.1 release notes:
>>
>> - #1338 <https://github.com/leo-editor/leo-editor/issues/1338>: 
>> g.getUrlFromNode must not expand path expressions.
>> - #1341 <https://github.com/leo-editor/leo-editor/issues/1341>: 
>> Expansion of path expressions should be strictly limited.
>>
>> My only memory of these issues is that path expressions *must not* 
>> execute arbitrary code!
>>
>> It looks like the fixes happened before Leo started using PRs, so it's 
>> much harder to pinpoint the actual changes.
>>
>> Edward
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/c190db36-761b-4fb6-b3ac-48de442fc9bfn%40googlegroups.com.


Re: Discuss: what should path expressions contain?

2024-01-10 Thread jkn


On Wednesday, January 10, 2024 at 1:00:58 PM UTC tbp1...@gmail.com wrote:

Edward made some changes during this thread, IIRC.


Yes ... I was trying to track the end results of this.

The description of {{sep}} etc. used to be on the leoeditor.com 
documentation,
but no longer seems to be there.
A short 'migration guide' paragraph would be useful, it was not clear to me
that my nodes with this style of directives need to be changed.
 

On Wednesday, January 10, 2024 at 5:21:22 AM UTC-5 Edward K. Ream wrote:

On Tue, Jan 9, 2024 at 1:14 PM jkn  wrote:

did the work that got done here ever get documented? 


Luke, use the find command!

Searching LeoDocs.leo for "path expression" yields these items from the 6.1 
release notes:

- #1338 <https://github.com/leo-editor/leo-editor/issues/1338>: 
g.getUrlFromNode must not expand path expressions.
- #1341 <https://github.com/leo-editor/leo-editor/issues/1341>: Expansion 
of path expressions should be strictly limited.

My only memory of these issues is that path expressions *must not* execute 
arbitrary code!

It looks like the fixes happened before Leo started using PRs, so it's much 
harder to pinpoint the actual changes.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/84bbc53b-d0a1-4add-abae-a2d30587b9d2n%40googlegroups.com.


Re: Discuss: what should path expressions contain?

2024-01-09 Thread jkn
heh again ... that caused a little bit of head scratching...

I wanted an environment variable $NEXTCLOUD, because the name of my 
nextcloud directory is different
on different machines. But this didn't seem to be working, even though 
$HOME seemed to work.

But I had this line:

export NEXTCLOUD=~/nextCloud

in ~/.bashrc ... which is not applicable if I start leo from the desktop

I was confused because if I typed 'env' in a terminal, I *would* see the 
value.

So I moved the line to ~/.profile, and this behaves as I expect.

I remember when I first learned about the original path specifiers, with 
{{g.app.homedir}}
and {{sep}}, I thought "hmm ... there must be a good reason why Edward 
hasn't used the python
os.path functions to sort this out". I must have been carrying that thought 
with me for a while...

The documentation could do with improving around here though ... in fact I 
don't think
there is currently anything on path descriptors at all. The availability of 
$(ENVVAR} at
least would be useful.

Thanks for listening ... J^n


On Tuesday, January 9, 2024 at 9:37:43 PM UTC jkn wrote:

> heh - see from a closer reading of the code and 
> https://github.com/leo-editor/leo-editor/pull/3264 that
> ${ENVNAME} should already be supported, via os.path.expandvars().
>
> I'm still having a little trouble getting the new form(s) to work as I 
> expect,
> i will experiment a bit more and report back.
>
> On Tuesday, January 9, 2024 at 7:14:33 PM UTC jkn wrote:
>
>> did the work that got done here ever get documented? I am looking at some
>> nodes with old-style path expressions and I am a bit confused what the 
>> current state of the art is.
>> Path expressions don't seem to be discussed in the current documentation.
>>
>> FWIW, in relation to the posting above this, I would suggest that 
>> ${ENVNAME} works in a similar way to $ENVNAME - like in bash scripts, for 
>> instance.
>>
>> Happy New Year!
>> Jon N
>>
>>
>> On Sunday, April 9, 2023 at 12:46:47 AM UTC+1 Edward K. Ream wrote:
>>
>>> On Saturday, April 8, 2023 at 5:52:20 PM UTC-5 tbp1...@gmail.com wrote:
>>>
>>> Excellent!  And if Leo were to export, say, LEODIR, which would be the 
>>> *leo* directory, then there would not be a need for {leoDir} since one 
>>> could write something like 
>>>
>>> @file $LEODIR/themes/vr3/rst-dark.css
>>>
>>> I like it.
>>>
>>>
>>> So do I. The new code will be ready later this evening.
>>>
>>> Edward
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/f818fe95-1a77-484c-b263-924159495b20n%40googlegroups.com.


Re: Discuss: what should path expressions contain?

2024-01-09 Thread jkn
heh - see from a closer reading of the code and 
https://github.com/leo-editor/leo-editor/pull/3264 that
${ENVNAME} should already be supported, via os.path.expandvars().

I'm still having a little trouble getting the new form(s) to work as I 
expect,
i will experiment a bit more and report back.

On Tuesday, January 9, 2024 at 7:14:33 PM UTC jkn wrote:

> did the work that got done here ever get documented? I am looking at some
> nodes with old-style path expressions and I am a bit confused what the 
> current state of the art is.
> Path expressions don't seem to be discussed in the current documentation.
>
> FWIW, in relation to the posting above this, I would suggest that 
> ${ENVNAME} works in a similar way to $ENVNAME - like in bash scripts, for 
> instance.
>
> Happy New Year!
> Jon N
>
>
> On Sunday, April 9, 2023 at 12:46:47 AM UTC+1 Edward K. Ream wrote:
>
>> On Saturday, April 8, 2023 at 5:52:20 PM UTC-5 tbp1...@gmail.com wrote:
>>
>> Excellent!  And if Leo were to export, say, LEODIR, which would be the 
>> *leo* directory, then there would not be a need for {leoDir} since one 
>> could write something like 
>>
>> @file $LEODIR/themes/vr3/rst-dark.css
>>
>> I like it.
>>
>>
>> So do I. The new code will be ready later this evening.
>>
>> Edward
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ac9560f5-315b-4b47-9099-ff22b2d0df8dn%40googlegroups.com.


Re: Discuss: what should path expressions contain?

2024-01-09 Thread jkn
did the work that got done here ever get documented? I am looking at some
nodes with old-style path expressions and I am a bit confused what the 
current state of the art is.
Path expressions don't seem to be discussed in the current documentation.

FWIW, in relation to the posting above this, I would suggest that 
${ENVNAME} works in a similar way to $ENVNAME - like in bash scripts, for 
instance.

Happy New Year!
Jon N


On Sunday, April 9, 2023 at 12:46:47 AM UTC+1 Edward K. Ream wrote:

> On Saturday, April 8, 2023 at 5:52:20 PM UTC-5 tbp1...@gmail.com wrote:
>
> Excellent!  And if Leo were to export, say, LEODIR, which would be the 
> *leo* directory, then there would not be a need for {leoDir} since one 
> could write something like 
>
> @file $LEODIR/themes/vr3/rst-dark.css
>
> I like it.
>
>
> So do I. The new code will be ready later this evening.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ec729db9-1166-4586-99d3-f4e60f35b376n%40googlegroups.com.


Re: ✨LeoJS beta 0.2.8 Released!

2024-01-03 Thread jkn
Yes, these are very entertaining. How do you create them, out of interest? 
Perhaps you should have an Avatar for Edward and yourself on the next one...

On Wednesday, January 3, 2024 at 10:46:22 AM UTC Edward K. Ream wrote:

> On Tue, Jan 2, 2024 at 7:32 PM Félix  wrote:
>
>> jkn Thank you very much for trying out LeoInteg and LeoJS!!
>
>
> Great illustration :-) Please keep them coming. Let's start a gallery!
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/095ee7a0-2d70-4808-8c85-4d138deb93f5n%40googlegroups.com.


Re: LeoJS - How To Print javascript Output?

2024-01-02 Thread jkn

Yes, "es" == "emit string" is one of the arcane bits of Leo-lore, IMO. I 
think the docs should mention this, IIRC they do not and it must have 
caused some puzzlement over the years...

On Wednesday, January 3, 2024 at 2:02:15 AM UTC tbp1...@gmail.com wrote:

> Ha! Should have tried that right off!.  Thanks.
>
> On Tuesday, January 2, 2024 at 8:16:51 PM UTC-5 Félix wrote:
>
>> Hi Thomas! :)
>>
>> I gather that by an 'Output window' you mean the LeoJS Log Window? (The 
>> equivalent of Leo's Log Window)
>> [image: log_pane.png]
>>
>> Using *console.log (*which is indeed the equivalent of python's *print 
>> *function, 
>> which prints in the terminal instead of Leo's Log Window), will itself 
>> indeed print in the developer's-tools-terminal. (not recommended)
>>
>> What I recommend in contrast, is the *g.es  *function (and 
>> other 'g' methods like es_print, etc.) which does print in the Log Window. 
>>
>> See (and study) this example script that gives a few pointers on how to 
>> do various useful stuff :
>>
>> @language javascript
>> const vscode = g.app.vscode;
>> g.es("hahahaha");
>> // 'await' for doCommandByName required only if other code in script is 
>> 'awaited'.
>> await c.doCommandByName('insert-headline-time');
>>
>> const userInput = await vscode.window.showInputBox({
>> placeHolder: 'Enter something', // Placeholder text in the input box
>> prompt: 'Please enter some text:', // Prompt message above the input 
>> box
>> });
>> if (userInput === undefined) {
>> g.es('User canceled the input.');
>> } else {
>> g.es('User input:', userInput);
>> }
>> try {
>> const apiUrl = 'https://jsonplaceholder.typicode.com/users';
>> const response = await fetch(apiUrl);
>> g.es("about to call");
>> if (!response.ok) {
>> throw new Error('Network response was not ok');
>> }
>> const data = await response.json();
>> g.es("got it!!", JSON.stringify(data));
>> } catch (error) {
>> g.es("oh no!");
>> console.error('Fetch error:', error);
>> }
>>
>>
>> It will insert the current time on the selected node, then pop an input 
>> box and print it back out in the log window, along with the result of an 
>> HTTP fetch call to some test API. Here is a screenshot of the result of 
>> running this script online in vscode on the web :
>> [image: screen_script_web.png]
>>
>> Hope this helps! 
>>
>> Félix
>>
>> On Tuesday, January 2, 2024 at 12:43:46 PM UTC-5 tbp1...@gmail.com wrote:
>>
>>> This script apparently runs without error but nothing shows in the 
>>> Output window:
>>>
>>> @language javascript
>>> console.log('this is another test');
>>>
>>> Using print() doesn't work, of course, because there isn't a print() 
>>> function.  How can we get a visible output?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/d7fd99f7-6e40-495f-9d1f-ba3c06673f6dn%40googlegroups.com.


Re: Strangeness with tratment of node Icons - LeoJS and/or 'Classic'?

2024-01-02 Thread jkn

Hi Felix - yes, I will try to make a small file that demonstrates the 
issue. I think the long hex string must be a path to a file (encoded), but 
I am not sure of the mechanism.

IIRC LeoJS indicated this as some sort of note attribute (JSON?), but I 
need to re-run properly so as to give a more useful error report.

Regards, Jon N

On Wednesday, January 3, 2024 at 1:37:39 AM UTC Félix wrote:

> jkn
>
> Can you give more info about those node icons? (custom attributes) Is the 
> long hex string image file data, of just a path to a file on disk?
>
> and share a sample .leo file that has only one or two nodes with icons ? 
> (the smaller the better) I'll use it to make experiments and ensure that it 
> gets read and written as-is to not corrupt any Leo files with custom 
> attributes outside of regular 'UA's
>
> I'll open an issue as soon as I can try it out.
>
> Thanks again!
>
> Félix
> On Tuesday, January 2, 2024 at 12:11:05 PM UTC-5 jkn wrote:
>
>> Has anything changed in the treatment of node Icons recently, please?
>>
>> In the course of trying out LeoJS recently, and getting in a few knots 
>> re. 'file already open in another copy of Leo', I also hit an error where 
>> Leo 'classic' was failing to fully read a file. This seemed to be related 
>> to my occasional use of node icons.
>>
>> AFAICT a node icon just gets turned into an "icons=long_hex_string" in 
>> the node entry:
>>
>> > icons="5d71007d71012858040074797065710258040066696c65710368035834002f686f6d652f6a6b6e2f6c656f2d656469746f722f686561646c696e652d6974656d732f746869737765656b5f67726e2e706e67710458070072656c5061746871055834002f686f6d652f6a6b6e2f6c656f2d656469746f722f686561646c696e652d6974656d732f746869737765656b5f67726e2e706e67710658050077686572657107580e006265666f7265486561646c696e657108580700796f73657471094b00580700786f736574710a4b0258040078706164710b4b015802006f6e710c580500564e6f6465710d75612e">
>>
>> ### (body of node) ###
>> 
>>
>> I'm unclear of the encoding, but FWIW I seemed to have recovered things, 
>> and allowed Leo Classic to open the files, by deleting the 'icons=' part in 
>> my file - luckily there were only a few of them.
>>
>> Perhaps foolishly I did update my copy of Leo classic in the middle of 
>> all of my playing.
>> But I'm wondering if LeoJS somehow mangled something here, or if recent 
>> changes to Leo might have caused this.
>>
>> I can try to recreate the problem and get a fuller error message if that 
>> would be useful. I thought I'd put this out in case this jogged any 
>> memories.
>>
>> Thanks, Jon n
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ae9f2353-c81e-4672-9780-89875a4b30a1n%40googlegroups.com.


Re: ✨LeoJS beta 0.2.8 Released!

2024-01-02 Thread jkn

Yes, this seems to be a Kubuntu/Codium interaction issue. I 'fixed' it with 
a window management workaround.

On Tuesday, January 2, 2024 at 9:02:25 PM UTC tbp1...@gmail.com wrote:

> On Tuesday, January 2, 2024 at 10:36:44 AM UTC-5 jkn wrote:
>
> (I have also probably been getting confused between LeoInteg and LeoJS: 
> the page Felix links to has 'how to install LeoInteg' at the top...)
>
> I have two issues on first attempts to use LeoJS, or at least to use it in 
> the same environment as I run 'Leo Classic' in:
>
> 1) This is probably OS/distribution specific. I am running VSCodium under 
> Kubuntu Linux. When I try to open a file, the open dialog appear *in the 
> panel/toolbar*, ie. not as a sized window. I have to explicitly open the 
> dialog by clicking in the toolbar. as I say, I think this is an artefact of 
> my distribution, but if anyone knows how to fix it I'd be grateful
>
>
> I just installed it on XUbuntu and didn't see this issue. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/8ea04b73-ea15-40a6-afec-b097abdcc99en%40googlegroups.com.


Strangeness with tratment of node Icons - LeoJS and/or 'Classic'?

2024-01-02 Thread jkn
Has anything changed in the treatment of node Icons recently, please?

In the course of trying out LeoJS recently, and getting in a few knots re. 
'file already open in another copy of Leo', I also hit an error where Leo 
'classic' was failing to fully read a file. This seemed to be related to my 
occasional use of node icons.

AFAICT a node icon just gets turned into an "icons=long_hex_string" in the 
node entry:



### (body of node) ###


I'm unclear of the encoding, but FWIW I seemed to have recovered things, 
and allowed Leo Classic to open the files, by deleting the 'icons=' part in 
my file - luckily there were only a few of them.

Perhaps foolishly I did update my copy of Leo classic in the middle of all 
of my playing.
But I'm wondering if LeoJS somehow mangled something here, or if recent 
changes to Leo might have caused this.

I can try to recreate the problem and get a fuller error message if that 
would be useful. I thought I'd put this out in case this jogged any 
memories.

Thanks, Jon n

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/c454772a-4cf9-49b5-860c-3084719291fbn%40googlegroups.com.


Re: ✨LeoJS beta 0.2.8 Released!

2024-01-02 Thread jkn
update:

1) I have got past my 'files open in another instance of Leo' problem. I 
did remember that the cache is in ~/.leo/db etc, although I ended up not 
doing it this way
2) I also seem to have sorted out my dialog opening issue - it does indeed 
seem to be a VSCodium/Kubuntu problem. I have added a workaround rule to 
the Window configuration.

In the course of all of this I have updated 'Leo classic' and seem to have 
hit a different issue ... I will raise as a separate thread.

Sorry for the noise, J^n


On Tuesday, January 2, 2024 at 3:36:44 PM UTC jkn wrote:

> (I have also probably been getting confused between LeoInteg and LeoJS: 
> the page Felix links to has 'how to install LeoInteg' at the top...)
>
> I have two issues on first attempts to use LeoJS, or at least to use it in 
> the same environment as I run 'Leo Classic' in:
>
> 1) This is probably OS/distribution specific. I am running VSCodium under 
> Kubuntu Linux. When I try to open a file, the open dialog appear *in the 
> panel/toolbar*, ie. not as a sized window. I have to explicitly open the 
> dialog by clicking in the toolbar. as I say, I think this is an artefact of 
> my distribution, but if anyone knows how to fix it I'd be grateful
>
> 2) I am getting severe problems, having exited Codium and trying to start 
> 'Leo Classic', with 'File already opened in another copy of Leo' errors. It 
> took me a while to find the button to close a file in LeoJS; but even after 
> going through the list of files and doing this one by one I am still 
> getting this on multiple files. I recall there used to be some sort of 
> cache file you could delete in these circumstances, but I can recall the 
> details. anyone, please?
>
> Thanks, J^n
>
> On Tuesday, January 2, 2024 at 2:36:02 PM UTC tbp1...@gmail.com wrote:
>
>> That would probably be hard for a developer to keep up with, I would 
>> think.  I remember the first time I went to install leoJS I got a similar 
>> message, but VSC/odium upgraded in a flash so that I hardly knew what had 
>> happened.  So it was a non-issue for me.
>>
>> On Tuesday, January 2, 2024 at 9:24:18 AM UTC-5 jkn wrote:
>>
>>> A small point - it would be nice if the release notes mentioned what 
>>> version of VSCode/VSCodium
>>> was needed. I got a message that my version was too old.
>>> (I am running 1.77.1 of VSCodium, will upgrade shortly)
>>>
>>> Thanks, jon N
>>>
>>> On Tuesday, January 2, 2024 at 9:43:20 AM UTC jkn wrote:
>>>
>>>> I like the graphic Felix, well done! ;-)
>>>>
>>>> Jon N
>>>>
>>>> On Tuesday, January 2, 2024 at 3:38:21 AM UTC Félix wrote:
>>>>
>>>>> 📣Introducing LeoJS Beta 0.2.8
>>>>> LeoJS Beta 0.2.8 is here, bringing a substantial update filled with 
>>>>> enhancements and critical fixes.
>>>>> [image: _56d93bdf-e7f0-4625-85a2-cbf3cfc87fee.jpg]
>>>>>
>>>>> 🔍What's New in 0.2.8:
>>>>>
>>>>>- *Help Commands*: 'helpCommands.py' was converted to typescript, 
>>>>>enabling help commands.
>>>>>- *UNL Support*: Works in log pane, body panes, and all editor 
>>>>>windows.
>>>>>- *Goto-Script Fix*: Now works seamlessly with @button items.
>>>>>- *Markdown*: The @auto markdown importer and writer now ensures 
>>>>>flawless read-write integrity.
>>>>>- *Undo/Redo for UAs*: Enhanced command support for 'Clear UAs' 
>>>>>and 'Set UA'.
>>>>>- *Clone Related Commands*: Fixes to 'show clone ancestors' and 
>>>>>'show clone parents' commands.
>>>>>- *Workspace-Specific Sessions*: Session management is now more 
>>>>>personalized with workspace-specific settings.
>>>>>- *Stable Node Selection*: LeoJS maintains focus on the selected 
>>>>>node when refreshing external files.
>>>>>- *gnx-kind Setting*: Choose between uuid, ksuid, or traditional 
>>>>>GNX.
>>>>>
>>>>> 🚀 Continuous Improvements Since Launch:
>>>>>
>>>>>- Refined tooltips, language coloring support, and bug fixes in 
>>>>>various importers.
>>>>>- Enhanced keyboard navigation and pattern support for web 
>>>>>browsers.
>>>>>- Streamlined mobile experience, including 'ConfirmBeforeClose

Re: ✨LeoJS beta 0.2.8 Released!

2024-01-02 Thread jkn
(I have also probably been getting confused between LeoInteg and LeoJS: the 
page Felix links to has 'how to install LeoInteg' at the top...)

I have two issues on first attempts to use LeoJS, or at least to use it in 
the same environment as I run 'Leo Classic' in:

1) This is probably OS/distribution specific. I am running VSCodium under 
Kubuntu Linux. When I try to open a file, the open dialog appear *in the 
panel/toolbar*, ie. not as a sized window. I have to explicitly open the 
dialog by clicking in the toolbar. as I say, I think this is an artefact of 
my distribution, but if anyone knows how to fix it I'd be grateful

2) I am getting severe problems, having exited Codium and trying to start 
'Leo Classic', with 'File already opened in another copy of Leo' errors. It 
took me a while to find the button to close a file in LeoJS; but even after 
going through the list of files and doing this one by one I am still 
getting this on multiple files. I recall there used to be some sort of 
cache file you could delete in these circumstances, but I can recall the 
details. anyone, please?

Thanks, J^n

On Tuesday, January 2, 2024 at 2:36:02 PM UTC tbp1...@gmail.com wrote:

> That would probably be hard for a developer to keep up with, I would 
> think.  I remember the first time I went to install leoJS I got a similar 
> message, but VSC/odium upgraded in a flash so that I hardly knew what had 
> happened.  So it was a non-issue for me.
>
> On Tuesday, January 2, 2024 at 9:24:18 AM UTC-5 jkn wrote:
>
>> A small point - it would be nice if the release notes mentioned what 
>> version of VSCode/VSCodium
>> was needed. I got a message that my version was too old.
>> (I am running 1.77.1 of VSCodium, will upgrade shortly)
>>
>> Thanks, jon N
>>
>> On Tuesday, January 2, 2024 at 9:43:20 AM UTC jkn wrote:
>>
>>> I like the graphic Felix, well done! ;-)
>>>
>>> Jon N
>>>
>>> On Tuesday, January 2, 2024 at 3:38:21 AM UTC Félix wrote:
>>>
>>>> 📣Introducing LeoJS Beta 0.2.8
>>>> LeoJS Beta 0.2.8 is here, bringing a substantial update filled with 
>>>> enhancements and critical fixes.
>>>> [image: _56d93bdf-e7f0-4625-85a2-cbf3cfc87fee.jpg]
>>>>
>>>> 🔍What's New in 0.2.8:
>>>>
>>>>- *Help Commands*: 'helpCommands.py' was converted to typescript, 
>>>>enabling help commands.
>>>>- *UNL Support*: Works in log pane, body panes, and all editor 
>>>>windows.
>>>>- *Goto-Script Fix*: Now works seamlessly with @button items.
>>>>- *Markdown*: The @auto markdown importer and writer now ensures 
>>>>flawless read-write integrity.
>>>>- *Undo/Redo for UAs*: Enhanced command support for 'Clear UAs' and 
>>>>'Set UA'.
>>>>- *Clone Related Commands*: Fixes to 'show clone ancestors' and 
>>>>'show clone parents' commands.
>>>>- *Workspace-Specific Sessions*: Session management is now more 
>>>>personalized with workspace-specific settings.
>>>>- *Stable Node Selection*: LeoJS maintains focus on the selected 
>>>>node when refreshing external files.
>>>>- *gnx-kind Setting*: Choose between uuid, ksuid, or traditional 
>>>>GNX.
>>>>
>>>> 🚀 Continuous Improvements Since Launch:
>>>>
>>>>- Refined tooltips, language coloring support, and bug fixes in 
>>>>various importers.
>>>>- Enhanced keyboard navigation and pattern support for web browsers.
>>>>- Streamlined mobile experience, including 'ConfirmBeforeClose' 
>>>>improvements.
>>>>- Resolved issues with goto-next-clone and goto-next-marked refresh 
>>>>cycles, session management, and body pane labeling.
>>>>- Introduced user-friendly 'Recent Files' icons and buttons.
>>>>
>>>> If you can help to test it and note the bugs you find on the issues 
>>>> page <https://github.com/boltex/leojs/issues>, that'd be great! Join 
>>>> me and the community of Leo enthusiasts in refining LeoJS. Your feedback 
>>>> is 
>>>> invaluable in making LeoJS the best it can be.
>>>>
>>>> 🔗 Get Started: LeoJS Beta 0.2.8 
>>>> <https://marketplace.visualstudio.com/items?itemName=boltex.leojs> (also 
>>>> available on open-vsx.org <https://open-vsx.org/extension/boltex/leojs>
>>>> )
>>>>
>>>> *Many thanks to Edward, Thomas Kevin, and the rest of the Leo community 
>>>> for your contributions and support!!*
>>>>
>>>> Félix
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ce7443f6-8193-4faa-8591-9f56435a7b56n%40googlegroups.com.


Re: ✨LeoJS beta 0.2.8 Released!

2024-01-02 Thread jkn
A small point - it would be nice if the release notes mentioned what 
version of VSCode/VSCodium
was needed. I got a message that my version was too old.
(I am running 1.77.1 of VSCodium, will upgrade shortly)

Thanks, jon N

On Tuesday, January 2, 2024 at 9:43:20 AM UTC jkn wrote:

> I like the graphic Felix, well done! ;-)
>
> Jon N
>
> On Tuesday, January 2, 2024 at 3:38:21 AM UTC Félix wrote:
>
>> 📣Introducing LeoJS Beta 0.2.8
>> LeoJS Beta 0.2.8 is here, bringing a substantial update filled with 
>> enhancements and critical fixes.
>> [image: _56d93bdf-e7f0-4625-85a2-cbf3cfc87fee.jpg]
>>
>> 🔍What's New in 0.2.8:
>>
>>- *Help Commands*: 'helpCommands.py' was converted to typescript, 
>>enabling help commands.
>>- *UNL Support*: Works in log pane, body panes, and all editor 
>>windows.
>>- *Goto-Script Fix*: Now works seamlessly with @button items.
>>- *Markdown*: The @auto markdown importer and writer now ensures 
>>flawless read-write integrity.
>>- *Undo/Redo for UAs*: Enhanced command support for 'Clear UAs' and 
>>'Set UA'.
>>- *Clone Related Commands*: Fixes to 'show clone ancestors' and 'show 
>>clone parents' commands.
>>- *Workspace-Specific Sessions*: Session management is now more 
>>personalized with workspace-specific settings.
>>- *Stable Node Selection*: LeoJS maintains focus on the selected node 
>>when refreshing external files.
>>- *gnx-kind Setting*: Choose between uuid, ksuid, or traditional GNX.
>>
>> 🚀 Continuous Improvements Since Launch:
>>
>>- Refined tooltips, language coloring support, and bug fixes in 
>>various importers.
>>- Enhanced keyboard navigation and pattern support for web browsers.
>>- Streamlined mobile experience, including 'ConfirmBeforeClose' 
>>improvements.
>>- Resolved issues with goto-next-clone and goto-next-marked refresh 
>>cycles, session management, and body pane labeling.
>>- Introduced user-friendly 'Recent Files' icons and buttons.
>>
>> If you can help to test it and note the bugs you find on the issues page 
>> <https://github.com/boltex/leojs/issues>, that'd be great! Join me and 
>> the community of Leo enthusiasts in refining LeoJS. Your feedback is 
>> invaluable in making LeoJS the best it can be.
>>
>> 🔗 Get Started: LeoJS Beta 0.2.8 
>> <https://marketplace.visualstudio.com/items?itemName=boltex.leojs> (also 
>> available on open-vsx.org <https://open-vsx.org/extension/boltex/leojs>)
>>
>> *Many thanks to Edward, Thomas Kevin, and the rest of the Leo community 
>> for your contributions and support!!*
>>
>> Félix
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/b2a3bb79-8737-4961-a662-43535f5eeb2fn%40googlegroups.com.


Re: ✨LeoJS beta 0.2.8 Released!

2024-01-02 Thread jkn
I like the graphic Felix, well done! ;-)

Jon N

On Tuesday, January 2, 2024 at 3:38:21 AM UTC Félix wrote:

> 📣Introducing LeoJS Beta 0.2.8
> LeoJS Beta 0.2.8 is here, bringing a substantial update filled with 
> enhancements and critical fixes.
> [image: _56d93bdf-e7f0-4625-85a2-cbf3cfc87fee.jpg]
>
> 🔍What's New in 0.2.8:
>
>- *Help Commands*: 'helpCommands.py' was converted to typescript, 
>enabling help commands.
>- *UNL Support*: Works in log pane, body panes, and all editor windows.
>- *Goto-Script Fix*: Now works seamlessly with @button items.
>- *Markdown*: The @auto markdown importer and writer now ensures 
>flawless read-write integrity.
>- *Undo/Redo for UAs*: Enhanced command support for 'Clear UAs' and 
>'Set UA'.
>- *Clone Related Commands*: Fixes to 'show clone ancestors' and 'show 
>clone parents' commands.
>- *Workspace-Specific Sessions*: Session management is now more 
>personalized with workspace-specific settings.
>- *Stable Node Selection*: LeoJS maintains focus on the selected node 
>when refreshing external files.
>- *gnx-kind Setting*: Choose between uuid, ksuid, or traditional GNX.
>
> 🚀 Continuous Improvements Since Launch:
>
>- Refined tooltips, language coloring support, and bug fixes in 
>various importers.
>- Enhanced keyboard navigation and pattern support for web browsers.
>- Streamlined mobile experience, including 'ConfirmBeforeClose' 
>improvements.
>- Resolved issues with goto-next-clone and goto-next-marked refresh 
>cycles, session management, and body pane labeling.
>- Introduced user-friendly 'Recent Files' icons and buttons.
>
> If you can help to test it and note the bugs you find on the issues page 
> , that'd be great! Join me and 
> the community of Leo enthusiasts in refining LeoJS. Your feedback is 
> invaluable in making LeoJS the best it can be.
>
> 🔗 Get Started: LeoJS Beta 0.2.8 
>  (also 
> available on open-vsx.org )
>
> *Many thanks to Edward, Thomas Kevin, and the rest of the Leo community 
> for your contributions and support!!*
>
> Félix
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/b2ac665a-d03f-4347-b2c7-41fa1e7f03dcn%40googlegroups.com.


Re: Installing nim was easy!

2024-01-01 Thread jkn
"nim is both case- and underscore-insensitive"

I had forgotten this when reading about nim some time ago. I know that
first appearances can be deceptive, but hmm...


On Monday, January 1, 2024 at 5:05:00 PM UTC tbp1...@gmail.com wrote:

> How did you install gcc?  Using minGW?
>
> On Monday, January 1, 2024 at 10:27:25 AM UTC-5 Edward K. Ream wrote:
>
>> Apparently the malware warnings are spurious: See nim issue #23151 
>> .
>>
>> That said, there is no way I would open the .zip file without first 
>> disinfecting it.
>>
>> The Nim install page said to 
>> run finish.exe after unpacking the .zip file. But that file does not exist. 
>> Happily, earlier I had found the Nim Package Directory 
>> .
>>
>> I was looking for a python tokenizer, but I noticed the Nim package 
>> .
>>
>> To complete the install I just ran nimble install nim from Nim's bin 
>> directory. Everything just worked!
>>
>> Perhaps I got lucky: I had already installed gcc (and added gcc.cmd) so 
>> nimble could invoke gcc even with gcc missing from my Windows path.
>>
>> *Summary*
>>
>> Use nimble install nim to complete the install.
>>
>> I am eager to start playing with Nim!
>>
>> Edward
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/01047ad1-a35b-405b-a6f2-bdbebfeaead9n%40googlegroups.com.


Re: Does LeoJS have an equivalent to the minibuffer?

2023-12-23 Thread jkn
Perhaps it is just not normally visible? From 
https://open-vsx.org/extension/boltex/leojs :

"""
   The Minibuffer 
For those 
familiar with Leo, the ‘minibuffer’ serves as the nerve center for command 
execution. Access it through Alt+X and use the complete set of Leo’s 
commands!
"""

On Saturday, December 23, 2023 at 6:15:44 PM UTC tbp1...@gmail.com wrote:

> IOW, how can Leo commands be run if there isn't an ALT-x/minibuffer? I 
> don't see one.  Am I just missing it somehow?

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/f06f3450-5663-4086-a496-28081b879aa4n%40googlegroups.com.


Re: leoJS Seems To Work With VSCodium

2023-12-22 Thread jkn
Thanks for the heads up - I too use VSCodium (a bit) and this was the 
version I was hoping to try leoJS with

J^n


On Friday, December 22, 2023 at 8:18:23 PM UTC tbp1...@gmail.com wrote:

> VSCodium is a version of VSCode that does not include Microsoft-specific 
> additions like telemetry.  It's the same code base so everything *ought* to 
> work the same.
>
> I've installed VSCodium, and leoJS seems to be working the same as on 
> VSCode.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/accdccd9-6f67-4c35-aa63-29dd31f5dc61n%40googlegroups.com.


general thought about Google Groups & Usenet etc.

2023-12-21 Thread jkn
Hi all
just musing, really ... as many will know, Google are preventing, from 
Feb 2024, content being posted to USENET groups via Google Groups.

For at least some people this will be a disincentive to use USENET groups 
(probably part of their longer term plan).

I realise that leo-editor is *not* a USENET group - it is a 'Google Groups 
group' or something similar. But this change will make it an outlier, at 
least for me. I will probably switch to using the www.eternal-september.org 
USENET server instead of via a browser.

Just musing on whether being tied to Google is a good idea for this forum...

In any case, very best wishes of the season to all on this newsgroup. I ope 
to try out LeoJS over the holiday period...

Regards
J^n

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/5af18bc7-11a4-4cfa-b347-f1a1166f7c14n%40googlegroups.com.


'resource nodes', eg. for headline icons?

2023-10-19 Thread jkn
Hi all
a minor itch... 'resource nodes', eg. for headline icons

I am starting to use some of my own custom node icons within Leo. This is 
quite handy do graphically marking different types of 'todo' items.

Currently I am using Inkscape to make a little graphic, then exporting this 
as a .PNG file. I store these external to Leo and use 'insert-icon' to add 
them to a headline

I was wondering a couple of ways of improving this:

- is there any mileage in being able to hold such small .PNG files as 
'resource nodes' within Leo? 
- similarly, is there any mileage in supporting .SVG files/resources for 
node icons?

Thanks, Jon N

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/9c733801-931b-4cf7-823f-b6e79ad4ec82n%40googlegroups.com.


Re: Problem running Leo after installing Python 3.12

2023-10-12 Thread jkn

Yes, I've vaguely wondered about Textual (https://www.textualize.io/) as 
well

J^n

On Thursday, October 12, 2023 at 4:24:47 PM UTC+1 map...@gmail.com wrote:

> There is also a problem with Windows-Curses and py 3.12:
> https://github.com/leo-editor/leo-editor/issues/3603
>
> (Hello everyone!)
> On Thursday, October 12, 2023 at 4:12:14 a.m. UTC-7 lewis wrote:
>
>> I have PyQt6 installed but it is v6.5.2
>> See 
>> https://www.riverbankcomputing.com/pipermail/pyqt/2023-October/045542.html
>>
>> On Thursday, October 12, 2023 at 10:03:51 PM UTC+11 Edward K. Ream wrote:
>>
>>
>> Yes, you must install Qt.
>>
>> #3604  suggests 
>> improving this message.
>>
>> Edward
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ec09a4e1-7f69-47d8-9d62-bc2a420e1da9n%40googlegroups.com.


Re: Moving beyond Leo

2023-10-02 Thread jkn
Yes, I (like others, I think) came to outline editors, and Leo etc, as part 
or a line that included Knuth's espousal of Literate Programming, tangle 
and weave etc.

Not come across Harmony Assistant before.

On Monday, October 2, 2023 at 8:32:47 PM UTC+1 Edward K. Ream wrote:

> On Sunday, October 1, 2023 at 7:07:05 AM UTC-5 Edward K. Ream wrote:
>
>
> > P.S. Leo got started as a way to understand Knuth's TeX 
>  program.
>
> Phil Straus, who suggested I look into MORE 30+ years ago,  suggests I 
> take a look at Harmony Assistant 
> .
>
> Has anyone used this program?
>
> Edward 
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/096be98d-5aea-4563-a23c-be5049de8219n%40googlegroups.com.


Re: Moving beyond Leo

2023-10-02 Thread jkn
I occasionally use MuseScore to create scores for my granddaughter to play 
on the cornet. Being a TeX fan, I would have liked to use lillypond or 
similar, but it would take me forever and MuseScore is perfectly adequate 
for my purposes(*).

However I rather imagine that the output of Musescore is looked upon with 
polite (or not so polite?) disdain by 'proper' music setters...

(*) and the new owners of MuseScore are trying to monetize it, irritatingly

On Sunday, October 1, 2023 at 10:03:42 PM UTC+1 Edward K. Ream wrote:

> On Sun, Oct 1, 2023 at 3:58 PM jkn  wrote:
>
>> you can definitely lose yourself for years in typography, fontography and 
>> music notation-ography ... fun times...
>>
>
> Indeed.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/7499646c-565b-446c-814e-2f1971f17003n%40googlegroups.com.


Re: Moving beyond Leo

2023-10-01 Thread jkn
you can definitely lose yourself for years in typography, fontography and 
music notation-ography ... fun times...

On Sunday, October 1, 2023 at 1:57:25 PM UTC+1 Edward K. Ream wrote:

> On Sun, Oct 1, 2023 at 7:44 AM Thomas Passin  wrote:
>
>>
>> On Sunday, October 1, 2023 at 8:07:05 AM UTC-4 Edward K. Ream wrote:
>>
>> Last week, I started playing with LaTeX 
>>  for what is known as music 
>> engraving .
>>
>> Music engraving ... if you want a challenge, well, all right then! 
>>
>
> :-) It should be easier than it sounds. There are tools like lilypond 
> and macros like MusiXTEX 
> . As I said, the challenge is finding the 
> easiest pipeline. I hope to help create my music teacher's next book.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/a37394a2-f802-4100-8585-cb5a6a106ee2n%40googlegroups.com.


Re: Discuss: remove ctext importer and writer?

2023-09-13 Thread jkn
I think I only know about it through reading through the importer for 
'ctext'
some time ago and wondering 'where did that format come from'?   ;-)

so I for one have no reason to keep it

J^n

On Wednesday, September 13, 2023 at 5:09:53 PM UTC+1 Edward K. Ream wrote:

> On Wed, Sep 13, 2023 at 10:58 AM Edward K. Ream  wrote:
>
> Does anyone know anything about the ctext file format? Googling ctext 
>> yields no relevant hits.
>>
>
> Hmm. The docstring for the ctext importer class is:
>
> QQQ
> Read/Write simple text files with hierarchy embedded in headlines::
>
> Leading text in root node of subtree
>
> Etc. etc.
>
> ### A level one node #
>
> This would be the text in this level one node.
>
> And this.
>
> ### Another level one node ###
>
> Another one
>
>  A level 2 node ##
>
> See what we did there - one more '#' - this is a subnode.
>
> Leading / trailing whitespace may not be preserved.  '-' and '/'
> are used in place of '#' for SQL and JavaScript.
> QQQ
>
> The docstring might suffice to fix the quirp, but does not explain where 
> this convention came from.
>
> Unless I hear howls of outrage, I'd like to remove support for this 
> bizarre format.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/c4446ff2-f10d-44e1-b85d-84d54a86bcecn%40googlegroups.com.


Re: When scripting with Leo, how to call a command by name?

2023-09-03 Thread jkn
FWIW the current options for doing this have always seemed a bit 
sub-optimal to me, due to the reasons you suggest. 
c.executeMinibufferCommand('name-of-command') seem like the wrong level to 
me, I should be able to call something 'lower down' than this...


On Monday, September 4, 2023 at 4:34:01 AM UTC+1 Félix wrote:

> I agree, respecting existing parameter orders and signatures in general is 
> very important. But making it optional does not interfere with normal 
> usage. 
>
> On Sunday, September 3, 2023 at 11:06:54 PM UTC-4 tbp1...@gmail.com wrote:
>
>> I've never encountered or used that method.  But it's another case where 
>> I would resist changing the signature of an existing command.  If it's only 
>> a matter of making and argument optional, that would be more palatable.  
>> The "events" in question here are not Python things but Leo objects.  They 
>> often carry the "c" parameter, for example, so the command can access it.
>>
>> On Sunday, September 3, 2023 at 9:24:35 PM UTC-4 Félix wrote:
>>
>>> Having in mind a fresh new user's perspective, I wonder if 
>>> *doCommandByName*, *the method with the most intuitive name to use for 
>>> such a task to perform*, could not be relatively easily modified to 
>>> support not having an 'event' passed to it? 
>>>
>>> ...I'm not familiar with those 'events' concepts in python so I'm 
>>> curious about Edwards thought on this matter. 
>>>
>>> Hoping it can be changed easily ! :)
>>>
>>> Félix
>>>
>>> On Sunday, September 3, 2023 at 9:13:39 PM UTC-4 tbp1...@gmail.com 
>>> wrote:
>>>
 There's also c.k.simulateCommand('name-of-command').  I'm not sure why 
 there are both, since they seem to do the same thing.  With either one, 
 you 
 don't need to supply a fake event.  The method takes care of that. I use 
 whichever one I remember first.

 On Sunday, September 3, 2023 at 9:08:31 PM UTC-4 gates...@gmail.com 
 wrote:

> I tend to use c.executeMinibufferCommand('name-of-command') -- doesn't 
> need any extra parameters, and Just Works TM.
>
> Jake
>
> On Sun, Sep 3, 2023 at 8:41 PM Félix  wrote:
>
>> Making script in Leo is great, with the globally defined vars g, c 
>> and p anything is possible. 
>>
>> But what is the recommended way of doing a simple command by name in 
>> a script?
>>
>> The *c.doCommandByName* method exists, but it insists on having an 
>> event as a second parameter. 
>>
>> I discovered that I can make it work by passing a fake event such as 
>> : {"c": c}, or even a better one: g.app.gui.create_key_event(c),  but 
>> this 
>> is quite unintuitive. Could it not default to a valid default event if 
>> the 
>> event is not passed?
>>
>> Félix
>>
>> -- 
>> You received this message because you are subscribed to the Google 
>> Groups "leo-editor" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to leo-editor+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/leo-editor/68b44f92-c2fd-403b-97aa-58fba041d366n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/1583b47e-000f-45e8-ac4f-0c0e085fb09en%40googlegroups.com.


Re: ENB: Ahas re paste-retaining-clones

2023-08-13 Thread jkn
Well, Happy Birthday Edward! ;-)

Regards, Jon N


On Sunday, August 13, 2023 at 10:31:16 AM UTC+1 Edward K. Ream wrote:

> Today is my 74th birthday. This Engineering Notebook post is my birthday 
> present to myself.
>
>
> For the last week, I have been trying to make paste-retaining-clones work. 
> Unit tests show this command improperly computes v.parents arrays in the 
> pasted outline.
>
>
> This morning I saw the way forward:
>
>
> *Aha!* paste-retaining-clones must recompute *all* v.parents arrays in 
> the entire outline!
>
>
> I won't attempt a formal proof, but I am sure this Aha is correct. Note 
> that the paste-node command does *not *require the complications 
> described next.
>
>
> *Recomputing v.parents*
>
>
> But how to recompute v.parents?
>
>
> - We can't use Position generators because they all use v.parents!
> - We can't use VNode generators because they don't yield VNodes in outline 
> order.
>
>
> *Aha! *Define a *c.all_vnode_positions* generator. This *hybrid generator* 
> will 
> yield VNodes in the same order as p.all_positions *using neither 
> v.parents nor Positions.* 
>
>
> Is it possible to write this generator? Yes, it is. The generator will 
> maintain an explicit stack just like Position.stack. *Note*: 
> c.all_vnode_positions must yield the hidden root VNode.
>
>
> *Recomputing all v.parents*
>
>
> Supposing the new generator exists, recomputing all v.parents arrays is 
> straightforward. Something like this (untested):
>
>
> for v in c.all_vnode_positions():
>
> v.parents = []
>
> for v in c.all_vnode_positions():
>
> for child in v.children:
>
> child.parents.append(v)
>
>
> Yes, a one-pass solution is possible. It *might* be faster.
>
>
> *Summary*
>
>
> *Aha!* The paste-retaining-clones command must recompute *all *v.parents 
> ivars. This recomputation is sound. The link correction in 
> c.checkVnodeLinks is not.
>
>
> Leo can use neither Position nor VNode generators to do the recomputation.
>
>
> *Aha!* A new generator, *c.all_vnode_positions*, will yield all VNodes in 
> outline order using neither v.parents nor Positions.
>
>
> Given this generator, updating all v.parents ivars will be straightforward.
>
>
> Edward
>
>
> P.S. Let us define a *hybrid generator *as a generator yielding VNodes in 
> the same order as some Position generator *without *using Positions.
>
>
> Could Leo replace Position generators with hybrids? I think not. For 
> example, please take a look qtree.full_redraw. It would not be fun to 
> eliminate Positions there.
>
>
> In any event, Leo's Position class is never going away :-)
>
>
> EKR
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/667252b3-0580-4a72-ab5e-29154440d1d8n%40googlegroups.com.


Re: Press ⌘ then click node

2023-07-27 Thread jkn
Yes, three slashes works for me as well, and is 'correct' as a URI.

 I am not quite sure why I thought it was four slashes. I think I worked 
with some app at one point which needed the 'final' slash escaping somehow 
... it might have been related to Windows UNC schemes

Anyway, good to know that it all still works

J^n

On Thursday, July 27, 2023 at 10:19:50 AM UTC+1 lewis wrote:

> file:///path/to/a/file/or/directory 
>
> works on Windows if 3 slashes are used.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/651c8e11-95a0-4305-9e69-07b9876d6b27n%40googlegroups.com.


Re: Press ⌘ then click node

2023-07-27 Thread jkn

Yes, this is a very useful feature.

I though we had had discussions about using xdg-open() to open a file 
manager, so that you could also CTRL-click on

file:path/to/a/file/or/directory

and have your file manager come up. That doesn't seem to be working though. 
Maybe I have forgotten something about it...


On Thursday, July 27, 2023 at 4:50:11 AM UTC+1 tbp1...@gmail.com wrote:

> Not just the first line - any line with a recognizable URL should show 
> that URL to be highlighted, and a CTRL-Click (or the Apple equivalent) on 
> the highlighted URL will navigate you to it in the browser. CTRL-Clicking 
> can navigate you to:
>
> - A URL, as above;
> - a node within a Leo outline (by clicking on a highlighted GNX or UNL);
> - A class, method or function definition within the same outline by 
> CTRL-Clicking on it (may not be the definition you want depending on what 
> the search finds first, but it's usually what you want).
> - A << named section >> (CTRL-Click on the section name in a node's body, 
> and Leo will navigate you to its expansion in the outline).
>
> There's probably something else I've forgotten just now.
>
> On Wednesday, July 26, 2023 at 9:05:13 PM UTC-4 iamap...@gmail.com wrote:
>
>> When I was using the features related to Leo and GitHub issues, I 
>> discovered...
>>
>> When the first line of the body of a node contains a URL, you can 
>> conveniently open that URL by pressing ⌘ and clicking the node. Leo boasts 
>> an abundance of hidden features.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/c469371d-16e6-4213-9ad2-38b646ac5b83n%40googlegroups.com.


Re: Interesting Post on The Old New Thing - Do Nothing At First

2023-07-25 Thread jkn
That's pretty much TDD, isn't it?


On Tuesday, July 25, 2023 at 4:01:30 PM UTC+1 tbp1...@gmail.com wrote:

> Before you try to do something, make sure you can do nothing 
> 
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/1e724a1c-da27-4d26-b928-11c0e5903954n%40googlegroups.com.


Re: Search for node by GNX with g.findGnx

2023-07-21 Thread jkn
Hmm - I know there is a smiley here, but ... really?

Seems like a rather tautological approach to code and testing quality to me.

J^n


On Thursday, July 20, 2023 at 5:43:54 PM UTC+1 Edward K. Ream wrote:

> On Thu, Jul 20, 2023 at 9:21 AM Thomas Passin  wrote:
>
>> I'm inclined to agree.
>>
>
> Functions do what they do, regardless of their names or docstrings :-)
>
> If you want to know what they are guaranteed to do, look at their unit 
> tests.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/f066032e-3321-49b1-b63a-df95fefdbf2fn%40googlegroups.com.


Re: About undoing commands, especially tree operations

2023-07-15 Thread jkn
putting Edward's response to the side for now at least, I would like to say 
as a general point that I am always very interested to read anything 
Vitalije writes here.

I seem to remember he has an occasionally-updated blog, i must go and hunt 
that down...

J^n


On Saturday, July 15, 2023 at 6:17:38 AM UTC+1 Edward K. Ream wrote:

> On Fri, Jul 14, 2023 at 5:05 PM vitalije  wrote:
>
> > I don't see how offline data structures help recreate clones. How do 
>> they simulate Leo's low-level VNode operations?
>>
>>
>> In order to see, you have to be willing to look first.
>>
>
> I'm not willing to change Leo's Position and VNode classes in any way.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ea65c40a-c224-4381-8310-c21aad5e9b3fn%40googlegroups.com.


Re: new error: " Bad @data contextmenu_commands entry:"

2023-07-10 Thread jkn
Hmm - on a different machine which doesn't show the error, I see that the 
equivalent entries in myLeoSettings.py only have a single dash:

@data contextmenu_commands 
copy-node Copy Node
cut-node Cut Node
paste-node Paste Node 
-
insert-node Insert Node
insert-child Insert Child
-
open-url-under-cursor Open URL


So it looks like this is the correct format to use.

OTOH I am pretty sure I haven't seen the other error before, on that 
machine. Maybe error mesages have been improved?

Apologies if it turns out this is just noise...

Regards, Jon N


On Monday, July 10, 2023 at 7:45:50 AM UTC+1 jkn wrote:

> I'm noticing this when leo loads, I am pretty sure I have not seen this 
> before:
>
> repeated several times:
> Bad @data contextmenu_commands entry: ['---']
>
>
> I think this is coming from my myLeoSettings.leo, which has 
>
>
> @data contextmenu_commands 
>
> copy-node Copy Node
> cut-node Cut Node
> paste-node Paste Node 
> ---
> insert-node Insert Node
> ---
>open-url-under-cursor Open URL
>
>
> (NB: only two separators, not three)
>
>
> Has something changed here recently? Maybe just the error message?...
>
>
> Thanks
>
> J^n
>
>
>
> Leo Log Window
> Leo 6.7.4-devel, devel branch, build 103f5c5e1e
> 2023-07-09 09:20:05 -0500
> Python 3.9.5, PyQt version 5.15.2
> linux
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/1372a36a-9790-408d-ba7b-4dd7e0cc4ce5n%40googlegroups.com.


new error: " Bad @data contextmenu_commands entry:"

2023-07-09 Thread jkn
I'm noticing this when leo loads, I am pretty sure I have not seen this 
before:

repeated several times:
Bad @data contextmenu_commands entry: ['---']


I think this is coming from my myLeoSettings.leo, which has 


@data contextmenu_commands 

copy-node Copy Node
cut-node Cut Node
paste-node Paste Node 
---
insert-node Insert Node
---
   open-url-under-cursor Open URL


(NB: only two separators, not three)


Has something changed here recently? Maybe just the error message?...


Thanks

J^n



Leo Log Window
Leo 6.7.4-devel, devel branch, build 103f5c5e1e
2023-07-09 09:20:05 -0500
Python 3.9.5, PyQt version 5.15.2
linux

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ad3b3d55-0f27-40f1-8c2d-6c66e99710ben%40googlegroups.com.


Re: The big PR did remove some gui-related code

2023-07-07 Thread jkn
I mentioned it, in the thread "Ctrl-Click on gnx fails if the node is dirty?
"

On Saturday, July 8, 2023 at 1:14:56 AM UTC+1 Edward K. Ream wrote:

> There was some discussion (I don't remember where) about a weird edge 
> case: changing a clickable link and then undoing the change *without* saving 
> the file caused Leo not to find the clickable link.
>
> I dismissed this nit as likely unrelated to the big PR. However, I now see 
> that the *full_match* helper function (internal to g.findUNL) *did* 
> contain gui code. Imo removing that code was correct, but there is a chance 
> that doing so created problems.
>
> *Summary*
>
> This post sets the record straight, but I have no intention of restoring 
> the old code.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/b006e8c5-b7c3-4d74-849f-c4d0551ca505n%40googlegroups.com.


Re: Aha: no need for a new paste command

2023-07-07 Thread jkn
I currently only see command paste-retaining-clones. Is this the command 
you are referring to (not paste-node-retaining-clones)?

I presume this is an older command (that I have not knowingly used).

I guess I am still ... nervous is not exactly the right word ... about 
having variants for what I think most users would see as a fundamental, and 
"trivial", operation. But I am trying to keep an open mind...

J^n



On Friday, July 7, 2023 at 9:59:49 AM UTC+1 Edward K. Ream wrote:

> #3429  suggests 
> that Leo's paste-node command should retain gnxs if doing so would create 
> no gnx clashes in the pasted node.
>
>
> Thomas, Félix and I have been debating what *anyGnxClashes *should check. 
> Should it check the entire pasted tree or only its root? Depending on the 
> answer, the paste-node will act like Leo's *legacy *paste-node or 
> paste-node-retaining-clones commands.
>
>
> *Aha!* The contents of the target outline don't matter! *What matters is 
> the user's intention*.
>
>
> Thomas uses cut-node/pastes-node mostly to move outlines. For him, 
> paste-node-retaining-clones is likely the best binding for ctrl-shift-v.
>
>
> But I typically use copy-node/paste-node to cherry-pick outlines from 
> other branches. For me, paste-node is the best binding.
>
>
> *Summary*
>
>
> When using paste-node, the user won't know what anyGnxClashes will return. 
> That can't be good!
>
>
> *Aha*: it *shouldn't matter* what nodes are in the target outline. What 
> matters is whether the user *wants *to regain gnxs!
>
>
> Users who regularly use copy-node/paste to move nodes may find it best to 
> bind ctrl-shift-v to paste-nodes-retaining-clones. Perhaps the binding for 
> ctrl-shift-v should change in leoSettings.leo.
>
>
> The work on this project has not been in vain. We all now understand more 
> deeply how Leo's paste-node commands affect gnxs.
>
>
> Please comment. I'll leave #3429 
>  open while we 
> continue our discussion.
>
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/809cc8a9-077e-4238-8084-683ee6e82963n%40googlegroups.com.


Re: "Unbreakable UNLs" Can Break Under A Common Scenario

2023-07-06 Thread jkn
Thomas' list sounds pretty sensible to me at first blush. Nevertheless, I 
do wonder whether keeping things in a discussion/proposal phase for a while 
would be a good idea, rather than (for instance) jumping onto #3429.

J^n


On Thursday, July 6, 2023 at 6:40:33 PM UTC+1 Edward K. Ream wrote:

> On Thu, Jul 6, 2023 at 11:09 AM Thomas Passin  wrote:
>
> I propose that whether a node gets cut or copied, that [snip].
>>
>
> Many thanks for this great idea. 
>
> See #3429 . I'll do 
> this asap. 
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ac3811e4-cfb9-423c-ad72-ae35dfd12a4cn%40googlegroups.com.


Re: "Unbreakable UNLs" Can Break Under A Common Scenario

2023-07-06 Thread jkn
So, "once you have learned about gnx's, Cut- and paste- nodes is lost to 
you"?

Sorry, like Jake says, I am trying to be constructive here. But I too think 
things are moving too fast.

Jon N


On Thursday, July 6, 2023 at 2:49:17 PM UTC+1 Edward K. Ream wrote:

> On Thu, Jul 6, 2023 at 8:02 AM Thomas Passin  wrote:
>
>> The gnx change  may be expected, but as a user if I cut a node and paste 
>> it somewhere else, in my mind it's the *same* node and an "unbreakable" UNL 
>> should take me to that same node afterwards.  In my mind there should be no 
>> difference between moving a node using move commands (like CTRL-D) and 
>> moving it by cut-paste.  
>>
>> I would say that a user who has not thought about, or maybe not even 
>> learned about, gnx's would not expect a unl to break when he did a 
>> cut-paste on a node.
>>
>
> The average Leonista may cut and paste nodes without harm. Leo's devs *must 
> never *do so.
>
> Clear?
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/aeaa7753-767e-4a50-aa2b-de6b385a00f5n%40googlegroups.com.


Re: "Unbreakable UNLs" Can Break Under A Common Scenario

2023-07-06 Thread jkn

Hi Edward
  By  'devs', do you mean, erm ... 'users' ?

I agree with Thomas, I think there is a real disagreement here.

Has it always been true that "Leo devs should *never* move nodes by 
copy/paste", or is this a recent ... limitation, or ... evolution of your 
thinking, or what?

Thanks, Jon N

On Thursday, July 6, 2023 at 2:21:11 PM UTC+1 Edward K. Ream wrote:

> On Thursday, July 6, 2023 at 8:11:56 AM UTC-5 jkn wrote:
>
> What are Outline | Cut-Node and Outline | Paste-Node for then?
>
>
> An earlier reply 
> <https://groups.google.com/g/leo-editor/c/JH4Au0F0vjk/m/-zdr4xVHAwAJ> (in 
> this thread) explains that "copy outline" creates an independent copy.
> Useful for cherry-picking nodes from other branches.
>
> A later reply 
> <https://groups.google.com/g/leo-editor/c/JH4Au0F0vjk/m/G7poknJJAwAJ> (in 
> this thread) explains why *Leo devs should never move nodes by copy/paste*
> .
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/8af538a5-6e77-4953-8cde-93c7824045d9n%40googlegroups.com.


Re: "Unbreakable UNLs" Can Break Under A Common Scenario

2023-07-06 Thread jkn


On Thursday, July 6, 2023 at 1:45:21 PM UTC+1 Edward K. Ream wrote:

On Wed, Jul 5, 2023 at 11:21 PM Thomas Passin  wrote:

Trouble is, when you cut a node and paste it, its gnx changes.  To prevent 
that you would have to remember to paste the node as a clone rather than do 
a simple paste.  This is asking for trouble. (And it's a weakness of my 
zettel-kasten system, which is gnx-based).


Then don't move nodes by cut and paste!


really?!

What are Outline | Cut-Node and Outline | Paste-Node for then?


I *never* move nodes this way. Surely you can find an alternative that 
works for you.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/fa5b96e2-14cf-428a-96cd-25b44cc2fde4n%40googlegroups.com.


Re: Why gnx-based unls are important

2023-07-05 Thread jkn
How does the current scheme address the situation of two identically-named 
files in different directories?


On Wednesday, July 5, 2023 at 7:41:12 PM UTC+1 Edward K. Ream wrote:

> On Wed, Jul 5, 2023 at 12:14 PM Thomas Passin  wrote:
>
> > I don't think the concept of operations for the new UNLs has been fully 
> worked out yet.
>
> I know of no problems whatsoever with gxn-based unls.
>
> Leo's new link-resolution code significantly improves the operation of 
> legacy (path-based) links/unls.
>
> Please comment in PR #3424 
>  if you have a *specific 
> *complaint. 
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/fdf3e46d-8367-41e5-8eb4-c469c79988f8n%40googlegroups.com.


Ctrl-Click on gnx fails if the node is dirty?

2023-07-05 Thread jkn
Whilst experimenting with the new gnx work just now (I will add a posting 
to the relevant thread soon, I hope) I came across the following strange 
behaviour. No idea if it is old or new.

1) pasted a unl:gnx reference into a node
2) Ctrl-LCclick on it: confirm you go to the right node(*)
3) go back to the first node and 'mess with' the reference, eg. by adding 
some text to the end of the unl:gnx reference(**)
4) delete the text you just added but do not save the file; the node is 
'dirty'
5) ctrl-LClick on the reference again
   I get taken to entirely different node, with no relation to the actual 
one!

6) if you write the file, then the Ctrl-LClick seems to work as expected

(*) separate point: this seems to take me to the end of the node body. Is 
that alterable?
(**) I was experimenting with changing (*) here when I saw this behaviour

Regards
J^n

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/e690016a-f83d-4145-83b1-7c9742efda90n%40googlegroups.com.


Re: Why gnx-based unls are important

2023-07-05 Thread jkn
Apologies for not fully following all of the recent good work here. I meant 
to mention this earlier but just wanted to check this 'platform 
independent' part.

On my Linux box, I get something in the lower 'status bar' like(*)

unl:///home/jkn/path/to/myfile.leo#node-->subnode-->subnode

but when I run on my windows machine, the same file (shared via NextCloud) 
will not be  like this, shurely? What happens if I move my .leo file to a 
different location? Apologies if I am missing something fundamental...

(*) slightly separate point - right click in that area shows 'copy/CTRL+C 
and 'select-all/CTRL+A'. It seems like I have to do CTRL+A followed by 
CTRL+C. I'd suggest that if you have no part of the ... gurl? ... selected, 
then CTRL+C should implicitly select the whole entity before copying

Sorry if this is muddying the waters...

Jon N



On Wednesday, July 5, 2023 at 12:00:35 PM UTC+1 Edward K. Ream wrote:

> This post explains why PR #3215 
> <https://github.com/leo-editor/leo-editor/pull/3215> (gnx-based unls) is 
> a milestone in Leo's history.
>
>
> gnx-based unls are a fundamental resource comparable in importance to 
> @clean and cff:
>
>
> - Unls won't break if you rename or move a node.
>
> - Leo supports *platform-independent* cross-file unls.
>
> - Creating gnx-based unls is dead easy.
>
>
> Leo now contains significant new resources related to gnx-based unls:
>
>
> *@data unl-path-prefixes* helps resolve unls to different paths on 
> different platforms. *Most users need to know only about this setting.*
>
>
> Leo provides two other resources for plugins:
>
>
> *g.parsePathData* parses such @data nodes to a python dict.
>
>
> *g.openUNLFile(c, s)* resolves s (the file part of an unl) to a 
> commander, defaulting to c if no resolution is possible. This function 
> contains an Easter Egg. It will return c immediately if s specifies the 
> active outline.
>
>
> Plugins can monkey-patch g.openUNLFile to gain *complete *control over 
> how Leo resolves unls.
>
>
> *Summary*
>
>
> gnx-based unls are a fundamental resource comparable in importance to 
> `@clean` and cff. Creating unbreakable cross-file unls is dead easy.
>
>
> Leonistas will likely find creative new uses for unls. For example, a 
> script could scan a document, possibly contained in different outlines, 
> converting unls to links for markup/reStructuredText.
>
>
> Most users need to know only about the *@data unl-path-prefixes* setting. 
> *g.parsePathData* parses such @data nodes to a python dict.
>
>
> Plugins can monkey-patch *g.openUNLFile* to gain complete control over 
> how Leo resolves unls.
>
>
> All of your questions and comments are welcome.
>
>
> Edward
>
>
> P.S. Plugins can also alter @data unl-path-prefixes *programmatically *by 
> calling *c.config.set*. Like this:
>
>
> c.config.set(kind='data', name='unl-path-prefixes', val=lines)
>
>
> Unit tests for leoGlobals do this using *LeoUnitTest._set_setting*. Take 
> a look :-)
>
>
> EKR
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/95912f6e-c907-4b72-9ede-b75e91ef8eb6n%40googlegroups.com.


Re: Heads up: The SessionManager class will go away

2023-06-30 Thread jkn
FWIW I usually run Leo from a direct desktop shortcut - having different 
command files to run with different command-line parameters is something 
... unusual. I only ever do it if I have had a crash and am trying to see 
what is going on. Having a series of batch/sh files seems very ... 1990s to 
me...

On Friday, June 30, 2023 at 3:01:24 PM UTC+1 Edward K. Ream wrote:

> On Fri, Jun 30, 2023 at 8:53 AM jkn wrote:
>
> The idea, n*ow fully realized* in PR #3215 
>> <https://github.com/leo-editor/leo-editor/pull/3215>, is this:
>>
>> 1. On exit, Leo *always* saves a list of open outlines (automatic 
>> session-snapshot-save). 
>> 2. When you open Leo without specifying any files Leo opens the saved 
>> list of outlines (automatic session-snapshot-load).
>>
>>
>> That sounds reasonable enough. Might it be worth making (1) alterable via 
>> an @setting variable?
>>
>
> I'd rather not :-)
>
>> I can just see some scenario where you have a usual set of sessions 
>> saved, but want to have a 'scratch' session with a different set, or just 
>> one file or something.
>>
>
> Well, the "usual set" implies that a script file would work. For example, 
> I use scripts with names like 'e' (my personal outline), 't' (test.leo', 
> 'd' (LeoDocs.leo) and 's' (leoPy.leo).
>
> Yes. I *could* just always type 'leo', but that's two too many letters!
>
>> FWIW I rarely use session-snapshot-load, just when I change my 'default' 
>> session setup. So I would no longer need to do this.
>>
>
> As you say, there is a very slight advantage to doing session save/load 
> manually, but I don't think the advantage is worth yet another setting!
>
> I'll attempt to give this a try soon.
>>
>
> Great. Please tell us about your experience.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ec48f512-d370-4470-b848-23ec815b9d09n%40googlegroups.com.


Re: Heads up: The SessionManager class will go away

2023-06-30 Thread jkn

Hi Edward

On Friday, June 30, 2023 at 1:41:08 PM UTC+1 Edward K. Ream wrote:

On Fri, Jun 30, 2023 at 5:04 AM jkn  wrote:

FWIW I can't really tell what #3408 will actually *do*. "Real Sessions" 
sounds great, but what is written there is more about the coding. I would 
like to better understand when the user experience will be at the end of 
this.


The idea, n*ow fully realized* in PR #3215 
<https://github.com/leo-editor/leo-editor/pull/3215>, is this:

1. On exit, Leo *always* saves a list of open outlines (automatic 
session-snapshot-save). 
2. When you open Leo without specifying any files Leo opens the saved list 
of outlines (automatic session-snapshot-load).


That sounds reasonable enough. Might it be worth making (1) alterable via 
an @setting variable?

I can just see some scenario where you have a usual set of sessions saved, 
but want to have a 'scratch' session with a different set, or just one file 
or something.

FWIW I rarely use session-snapshot-load, just when I change my 'default' 
session setup. So I would no longer need to do this.

I'll attempt to give this a try soon.

Thanks
Jon


 

This scheme is what I understand to be real sessions. It's not *exactly* 
equivalent to *manually *doing session-snapshot-load because Leo always 
overwrites the previously saved session.

Please try this all out.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/32075821-dc0a-4fa9-9252-d9cf7b6e4958n%40googlegroups.com.


Re: Heads up: The SessionManager class will go away

2023-06-30 Thread jkn
FWIW I can't really tell what #3408 will actually *do*. "Real Sessions" 
sounds great, but what is written there is more about the coding. I would 
like to better understand when the user experience will be at the end of 
this.

(sorry if I seem like an ungrateful consumer of terrific free SW).

FWIW, conversation titles like 'The SessionManager will go away' probably 
cause people to go "what?! Why?! When?!", which might not be what you 
want...

Jon N


On Friday, June 30, 2023 at 10:39:52 AM UTC+1 jkn wrote:

> starting Leo via different sets of (for me) .sh files, for different 
> 'session sets of files' seems pretty cheesy in this day & age - sorry.
>
> I haven't yet taken a look at #3408, I will do so asap.
>
> Thanks, Jon N
>
>
> On Friday, June 30, 2023 at 9:20:54 AM UTC+1 Edward K. Ream wrote:
>
>> On Friday, June 30, 2023 at 3:12:44 AM UTC-5 Edward K. Ream wrote:
>>
>> > Would #3408 <https://github.com/leo-editor/leo-editor/issues/3408> 
>> work for you? In effect, #3404 would do these commands automatically.
>>
>> If "fluid" sessions don't work for you the obvious workflow is to create 
>> .sh/.cmd files starting Leo with specified sets of outlines.
>>
>> session-snapshot-load and session-snapshot-save can only ever save *one* 
>> set of outlines, so these two commands are much less flexible than .sh/.cmd 
>> files.
>>
>> Edward
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/8d3636bf-8016-48a0-9f1f-90a9a07c055fn%40googlegroups.com.


Re: Heads up: The SessionManager class will go away

2023-06-30 Thread jkn
starting Leo via different sets of (for me) .sh files, for different 
'session sets of files' seems pretty cheesy in this day & age - sorry.

I haven't yet taken a look at #3408, I will do so asap.

Thanks, Jon N


On Friday, June 30, 2023 at 9:20:54 AM UTC+1 Edward K. Ream wrote:

> On Friday, June 30, 2023 at 3:12:44 AM UTC-5 Edward K. Ream wrote:
>
> > Would #3408  work 
> for you? In effect, #3404 would do these commands automatically.
>
> If "fluid" sessions don't work for you the obvious workflow is to create 
> .sh/.cmd files starting Leo with specified sets of outlines.
>
> session-snapshot-load and session-snapshot-save can only ever save *one* 
> set of outlines, so these two commands are much less flexible than .sh/.cmd 
> files.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ac71360f-7dce-49ce-8a5c-27ef7daf60b3n%40googlegroups.com.


Re: Heads up: The SessionManager class will go away

2023-06-30 Thread jkn
I'm not 100% clear what the revised functionality you propose would be ... 
but as one of (the) main people who requested some sort of session 
management, a few years back, I would strongly dislike losing this feature.

I routinely start Leo with a set of files (four or five), previously saved 
via session-snapshot-load and session-snapshot-save. Unless I'm 
misunderstanding you, loss of this feature would be a serious blow to my 
leo productivity.

Jon N


On Friday, June 30, 2023 at 8:45:17 AM UTC+1 Edward K. Ream wrote:

> On Thursday, June 29, 2023 at 5:06:37 PM UTC-5 Edward K. Ream wrote:
>
> The *session-** commands are absurd solutions to a non-existent problem. 
> This class significantly complicates Leo's startup logic. The entire 
> SessionManager class must go. Félix take note :-)
>
>
> The *session-** commands are absurd solutions to a non-existent problem. 
> This class significantly complicates Leo's startup logic. The entire 
> SessionManager class must go. Félix take note :-)
>
>
> Thanks to all who have commented.
>
>
> Yes, Leo could have "real" sessions. When no files appear on the command 
> line, Leo could reload the open outlines when Leo last closed. Issue #3408 
>  tells how. It's 
> easy! It's on the list for Leo 6.7.4.
>
>
> But nothing in leoSessions.py gives Leo such sessions. The SessionManager 
> class and the session-* commands must go.
>
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/f9a5d001-a2a7-499e-af3a-e498677f55abn%40googlegroups.com.


  1   2   3   4   5   6   7   >