Re: Clones - How To Return To "Original" Node?

2021-02-28 Thread Brian Theado
Vili, On Sun, Feb 21, 2021 at 11:58 AM vili wrote: > No problem with directories. But, it doesnt work this way on Mac. As I > pointed out, there is system Python2 preinstalled on Mac by Apple. It is > called by first row in the "runLeo.py" which reads: > > #! /usr/bin/env python > If the runLeo

Re: Leo's new unit testing world

2020-12-06 Thread Brian Theado
Edward, On Fri, Dec 4, 2020 at 7:40 AM Edward K. Ream wrote: > I spent considerable time last week on more complicated schemes for the > new unit tests. That complexity eventually collapsed. Only create_app > remains. That collapse would likely not have happened were it not for Brian's > comment

Re: SB: Please Read. Huge Ahas re unit testing

2020-11-29 Thread Brian Theado
Having measurable code coverage of the automated tests will be useful. The coverage.py library is not at all tied to pytest. About a year ago I tried running its standalone version against Leo's existing tests. However, some of the coverage results were not making sense. Possibly the way leo's un

Re: leo\doc\LeoDocs.leo.orig

2020-08-27 Thread Brian Theado
This commit on Aug 16th introduced the LeoDocs.leo.orig file: https://github.com/leo-editor/leo-editor/commit/acd73c59151c9f5304daa4ce08017c6cc7ec3857 I don't see any related PR merge commit, so probably it was pushed directly to the devel branch without a PR. Git only tracks information about com

Re: leo stops working

2020-07-30 Thread Brian Theado
File "", line 967 in _find_and_load_unlocked > File "", line 983 in _find_and_load > File > "/home/geoff/anaconda3/lib/python3.7/site-packages/meta/decompiler/instructions.py", > line 8 in > File "", line 219 in > _call_with_frames_rem

Re: leo stops working

2020-07-29 Thread Brian Theado
Geoff On Tue, Jul 28, 2020 at 3:44 PM Geoff Evans wrote: > < pip install leo > appeared to work (once I banished all the 5.9 stuff > to a directory outside anaconda), but when I tried to run leo: > > (base) geoff:1520>leo mbr.leo > > setting leoID from os.getenv('USER'): 'geoff' > Leo 6.2.1 fi

Re: **Important**: keys branch merged into devel

2020-07-26 Thread Brian Theado
Y zap-to-character= Alt-z Brian On Sun, Jul 26, 2020 at 12:36 PM Edward K. Ream wrote: > On Sun, Jul 26, 2020 at 10:32 AM Brian Theado > wrote: > > > From https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell, > "a branch in Git is sim

Re: **Important**: keys branch merged into devel

2020-07-26 Thread Brian Theado
Edward, On Sun, Jul 26, 2020 at 6:52 AM Edward K. Ream wrote: [...] > P. S. I am alarmed by the potential loss of data when merging git branches. > > When I merged the "keys" branch into devel I mistakenly resolved a merge > conflict by taking devel's version of leoSettings.leo. That was just wr

Re: Félix, please give me commit access to leoInteg

2020-07-19 Thread Brian Theado
Edward, On Wed, Jul 15, 2020 at 6:24 PM Edward K. Ream wrote: > I'd like to push some work to a new branch. > Are you familiar with the "fork" workflow of github? Where you can create a fork of leoInteg in the 'leo-editor' github space and you can push whatever branch you want. That branch is p

Re: ENB: Hypothesis might make #1269 feasible

2020-05-15 Thread Brian Theado
On Fri, May 15, 2020 at 9:39 AM Edward K. Ream wrote: [...] > Here I'll start making the plan more specific. Let's start with the > following pseudo code, for a new KeyHandlerClass method: > > > def handle_binding(self, event): > """Handle the given key event.""" > # Use per-state binding

Re: A fix for abbreviations with foreign keyboards is in the #1563 branch

2020-05-10 Thread Brian Theado
Viktor, On Sun, May 10, 2020 at 2:22 PM Viktor Ransmayr wrote: > Since it is the first time that I'm trying to work on a Git branch, it > might well be that the problem is on my side ;-) > > The first (strange?) thing I've to report is that after I did a 'git pull' > - and - tried to do a 'git c

Re: ENB: Qt-prototype is finished

2020-05-10 Thread Brian Theado
Edward, On Sun, May 10, 2020 at 8:29 AM Edward K. Ream wrote: > Yes that was the idea. Currently I am working on another idea, but it is >> too soon to share it. I'll write more once I have something to show. >> > > This sounds reasonable. As always, I'll reserve judgment until I see code. > I e

Re: ENB: Qt-prototype is finished

2020-05-09 Thread Brian Theado
Vitalije, On Fri, May 8, 2020 at 7:51 AM vitalije wrote: > *What next?* > > The main purpose of this prototype was to prove my claims about how Leo > architecture should change. Which parts should be moved to View, which > should be moved to Model and which should be moved to the Controller. > >

Re: Qt-prototype report and some thoughts about executeScript command

2020-05-09 Thread Brian Theado
It no longer crashes for me, thanks. While it doesn't crash, it is still possible to move a node left out of a hoist and the node "disappears". If it is the last node then it disappears and the outline pane becomes empty. The existing leo doesn't behave this way. Another behavior difference. Leo d

Re: Qt-prototype report and some thoughts about executeScript command

2020-05-09 Thread Brian Theado
Vitalije On Thu, May 7, 2020 at 2:42 PM vitalije wrote: > In last few days I've been working on tests to be sure that all commands > in new prototype are working correctly and that no crash will ever occur. I > am pretty sure now that the implementation is correct and there are no > remaining bu

Re: Qt-prototype report and some thoughts about executeScript command

2020-05-09 Thread Brian Theado
You can try making these changes: -from hypothesis import given, settings +from hypothesis import given, settings, Verbosity -@settings(max_examples=5000, deadline=timedelta(seconds=4)) +@settings(max_examples=5000, deadline=timedelta(seconds=4), verbosity=Verbosity.verbose) And then add the '-

Re: ENB: Qt-prototype is finished

2020-05-08 Thread Brian Theado
Vitalije On Fri, May 8, 2020 at 7:51 AM vitalije wrote: > As Brian suggested in another thread I have changed the strategy for > performing hypothesis tests. Now test chooses a sequence of commands > excluding undo and redo commands. After each command if the outline has > changed, test will che

Re: Qt-prototype report and some thoughts about executeScript command

2020-05-07 Thread Brian Theado
Vitalije, On Thu, May 7, 2020 at 2:42 PM vitalije wrote: > First of all I must say that testing with hypothesis is really great way > to discover hidden bugs. Several bugs were found in the previous > implementation that are very hard to imagine as a possible scenario. Of > course most of these

Re: A new tree drawing approach

2020-04-08 Thread Brian Theado
Vitalije, This looks interesting. Thanks for sharing. I'm not familiar with how the existing tree drawing approach works. Could you share (in broad strokes) what the current drawing does and how it is different from your new scheme? Is it that the existing code recreates all the QT items from scr

Re: Opening a theme file doesn't work in Leo 6.1b1

2020-04-04 Thread Brian Theado
On Sat, Apr 4, 2020 at 2:47 PM Viktor Ransmayr wrote: > At least not for Fedora 30. - See the following traceback I received, when > I tried to open a theme file! > > Traceback (most recent call last): > > File > "/home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo/core/leoCommand

Re: font size shrank

2020-03-31 Thread Brian Theado
BTW, I meant two finger drag up and down on the mouse trackpad. On Tue, Mar 31, 2020, 4:26 PM Brian Theado wrote: > Are you using leo on a Mac laptop? I've found it easy to accidentally > change the font size in the body when on Mac. It took me a long time to > figure out what ges

Re: font size shrank

2020-03-31 Thread Brian Theado
Are you using leo on a Mac laptop? I've found it easy to accidentally change the font size in the body when on Mac. It took me a long time to figure out what gesture caused it. If you hold down the Command key and two finger drag up and down, the font size will shrink and grow respectively. I'm not

Re: New installation log

2020-03-29 Thread Brian Theado
On Sun, Mar 29, 2020 at 6:09 AM Edward K. Ream wrote: [...] > I am seriously considering ignoring Anaconda and miniconda in Leo's > installation instructions: > > Install python 3 > (ubuntu) apt-get install pip3 > pip install PyQt5 > (optional, if not using git) pip install leo > PyQt5 isn't the

Re: Some excellent pytest articles/presentations

2020-03-16 Thread Brian Theado
On Mon, Mar 16, 2020 at 6:23 AM Edward K. Ream wrote: > When I awoke this morning I understood why you might suggest this. It > would, supposedly, make it possible to instantiate multiple instances of > the LeoApp class. I have just created #1537 >

Re: Some excellent pytest articles/presentations

2020-03-15 Thread Brian Theado
Edward, On Sun, Mar 15, 2020 at 11:38 AM Edward K. Ream wrote: > > the history of re-implementations contains a lot of sad failures. It's > just too big a job, the new implementations have their own bugs, and by the > time they get done, the original version has developed beyond that the new >

Some excellent pytest articles/presentations

2020-03-13 Thread Brian Theado
I came across these articles about pytest recently and thought they might be of interest to other developers here. These slides start basic, but cover a lot of ground and I learned a lot: https://nedbatchelder.com/text/test3.html Not the main thrust of the presentation, but one quote I liked: "T

Re: How To Intercept Clicks On Links in a QT5 Browser Widget

2020-02-27 Thread Brian Theado
On Wed, Feb 26, 2020 at 11:05 PM Thomas Passin wrote: > Thanks! Wow, that will save me lots of time. U, I don't see how to > "paste as node". My version of Leo has no menu item or leo command that > seems to be that. Of course I can just paste it into the body of a node, > but that won't

Re: How To Intercept Clicks On Links in a QT5 Browser Widget

2020-02-26 Thread Brian Theado
Thomas, Below I've pasted a leo subtree containing a demo @button which will display html hyperlinks to nodes inside a QTextBrowser. To use it copy the xml and in a leo outline, "paste as node". Create a script button from it and after clicking the button, a new pane should appear containing hype

Re: zombie process generated by g.execute_shell_commands

2020-02-11 Thread Brian Theado
This is working fine for me now. I don't see zombie processes for the exited background commands anymore. Nice work. On Sun, Feb 9, 2020 at 8:07 AM Edward K. Ream wrote: > On Sunday, February 9, 2020 at 6:08:42 AM UTC-6, Edward K. Ream wrote: > > > I have just created #1489 >

Re: zombie process generated by g.execute_shell_commands

2020-02-08 Thread Brian Theado
On Sat, Feb 8, 2020 at 4:41 AM Edward K. Ream wrote: > On Thu, Feb 6, 2020 at 1:08 PM Xu Wang wrote: > >> Dear Leo Developer, >> >> I created one button in Leo, the corresponding script is: >> >> c.save() >> g.execute_shell_commands(['git -C /Users//leodata add austin.leo', >> 'git -C /Users

Re: pytest coverage testing is a wow

2020-01-16 Thread Brian Theado
On Thu, Jan 16, 2020 at 4:20 PM Edward K. Ream wrote: [...] > The test_one_line_pet_peeves function contains a table of snippets. Modulo > some housekeeping, it is: > > for contents in table: # table not shown. Some tests in the table fail. > contents, tokens, tree = self.make_data(contents,

More Python parsing libraries

2020-01-16 Thread Brian Theado
I was looking up mutation testing libraries for python and came across several references to Python parsing which I thought in light of recent work, Edward would be interested in. Mutation testing deserves its own thread. Here I'm just sharing the parsing references. The mutation testing library a

Re: Please review the new docs for #1440

2020-01-15 Thread Brian Theado
On Wed, Jan 15, 2020 at 3:57 AM Edward K. Ream wrote: > On Tue, Jan 14, 2020 at 7:06 PM Brian Theado > wrote: > [...] > The ast module is particularly deficient in this regard. The documentation > for ast.walk <https://docs.python.org/3/library/ast.html#ast.walk> is: &g

Re: Please review the new docs for #1440

2020-01-14 Thread Brian Theado
er the other? On Tue, Jan 14, 2020 at 7:06 PM Brian Theado wrote: > In the theory of operation: > > "The notion of a *token order traversal* of a parse tree is the > foundation of this project" > > In contrast, what traversal order do parse trees provide? How is to

Re: Please review the new docs for #1440

2020-01-14 Thread Brian Theado
code of this library can collapse the complexity of these and any projects which change Python text" On Tue, Jan 14, 2020 at 6:10 PM Brian Theado wrote: > Ok, now I see in your proposed email response in the other thread you do > mention the asttokens project. And also later in #

Re: Discuss: a proposed answer to python issue #33337

2020-01-14 Thread Brian Theado
On Tue, Jan 14, 2020 at 4:05 PM Edward K. Ream wrote: > On Tue, Jan 14, 2020 at 3:00 PM Terry Brown wrote: > >> I wonder if a couple of demos would help, >> > > Thanks for this suggestion. Imo, the demo is the TOG class compared with > similar code in asttokens, fstringify and black. The differ

Re: Please review the new docs for #1440

2020-01-14 Thread Brian Theado
aluable. Examples are usually the first thing I want to see. Can you have something similar in #1440? On Tue, Jan 14, 2020 at 5:59 PM Brian Theado wrote: > I just followed the stackoverflow link ( > https://stackoverflow.com/questions/16748029/how-to-get-source-corresponding-to-a-python-ast-

Re: Please review the new docs for #1440

2020-01-14 Thread Brian Theado
I just followed the stackoverflow link ( https://stackoverflow.com/questions/16748029/how-to-get-source-corresponding-to-a-python-ast-node#) and someone posted that they created https://github.com/gristlabs/asttokens which "Annotates Python AST trees with source text and token information". Is that

Re: #1467: Use traditional unit test (almost?) everywhere

2020-01-12 Thread Brian Theado
Oops accidentally hit send when I was pasting in the two examples. Here is the other one: else: # Some fields contain ints or strings. assert isinstance(z, (int, str)), z.__class__.__name__ On Sun, Jan 12, 2020 at 9:49 AM Brian Theado

Re: #1467: Use traditional unit test (almost?) everywhere

2020-01-12 Thread Brian Theado
On Sun, Jan 12, 2020 at 8:18 AM Edward K. Ream wrote: > > > On Sat, Jan 11, 2020 at 2:11 PM Brian Theado > wrote: > > > I have doubts about the following entries you are suppressing: assert, > except, raise. > > Imo, they are fine. Assert signal that something

Re: #1467: Use traditional unit test (almost?) everywhere

2020-01-11 Thread Brian Theado
On Fri, Jan 10, 2020 at 8:33 AM Edward K. Ream wrote: > > I still think full line-by-line coverage analysis will be very valuable. >> >> I agree. I have just created #1474 >> for this. >> > > Many thanks for suggesting this. `pytest --cov` ha

Re: #1467: Use traditional unit test (almost?) everywhere

2020-01-09 Thread Brian Theado
On Thu, Jan 9, 2020 at 5:10 AM Edward K. Ream wrote: > On Wed, Jan 8, 2020 at 5:55 AM Brian Theado > wrote: > > > I often read unit tests in source code projects in the hope of finding > simple, concrete usage examples. These examples not only serve to test the >

Re: Using Vitalije's code patterns

2020-01-09 Thread Brian Theado
On Thu, Jan 9, 2020 at 5:28 AM Edward K. Ream wrote: > On Wed, Jan 8, 2020 at 10:49 PM Brian Theado > wrote: > > *>> Prefer functions to classes/methods* > > > The TokenOrderTraverser class looks to me like a good opportunity to > follow the above principle. AFAIC

Re: Using Vitalije's code patterns

2020-01-08 Thread Brian Theado
On Tue, Jan 7, 2020 at 7:58 AM Edward K. Ream wrote: > While working on leoAst.py, I have come to understand more fully several > of Vitalije's suggested code patterns: > > *Prefer functions to classes/methods* > The TokenOrderTraverser class looks to me like a good opportunity to follow the abo

Re: #1467: Use traditional unit test (almost?) everywhere

2020-01-08 Thread Brian Theado
method ( https://stackoverflow.com/questions/929021/what-are-static-factory-methods/929273) which makes it easy to instantiate the class. On Tue, Jan 7, 2020 at 1:32 PM Brian Theado wrote: > > > On Tue, Jan 7, 2020 at 5:01 AM Edward K. Ream wrote: > >> On Sunday, December

Re: #1467: Use traditional unit test (almost?) everywhere

2020-01-07 Thread Brian Theado
On Tue, Jan 7, 2020 at 5:01 AM Edward K. Ream wrote: > On Sunday, December 29, 2019 at 7:19:03 PM UTC-5, btheado wrote: > > I was looking at the tests in leoAst.py in the fstringify branch and I >> don't find any asserts in the tests themselves. >> > > The tests in the TestTOG are actually extrem

Re: #1467: Use traditional unit test (almost?) everywhere

2020-01-07 Thread Brian Theado
On Sun, Dec 29, 2019 at 5:54 PM Edward K. Ream wrote: > On Sun, Dec 29, 2019 at 5:29 PM Brian Theado > wrote: > [...] > > You might also find the code coverage report useful: > > Yes, that's interesting. The TOG classes remember which visitors have > been visit

Re: Question about "Import leoGlobals, but do NOT set g."

2020-01-03 Thread Brian Theado
On Fri, Jan 3, 2020 at 7:21 AM Edward K. Ream wrote: > On Thu, Jan 2, 2020 at 12:11 PM Brian Theado > wrote: > > For runLeo.py, the code looks like this: >> >> # Import leoGlobals, but do NOT set g. >> import leo.core.leoGlobals as leoGlobals >> # Create

Question about "Import leoGlobals, but do NOT set g."

2020-01-02 Thread Brian Theado
Both of these places in Leo's code: https://github.com/leo-editor/leo-editor/blob/devel/leo/core/runLeo.py#L24 https://github.com/leo-editor/leo-editor/blob/devel/leo/core/leoBridge.py#L108 has the comment "Import leoGlobals, but do NOT set g." For runLeo.py, the code looks like this: # Import l

Re: Leo requires tkinter module to be configured in Python environment

2020-01-01 Thread Brian Theado
Viktor, On Tue, Dec 31, 2019 at 11:45 AM Viktor Ransmayr wrote: > You were right with your assumption. - I tried it both with Leo 6.1-final > as well as 6.2-b1-devel - and - it works as you suspected. > > In both cases it does throw a type error related to ...\spellCommands.py - > but - it does

Re: #1467: Use traditional unit test (almost?) everywhere

2019-12-29 Thread Brian Theado
Edward, On Sun, Dec 29, 2019 at 5:54 PM Edward K. Ream wrote: [...] > > You might need to introduce failed tests in order to experience the > better assert failure reporting? > > Leo's existing unit tests use asserts. It's no big deal. > I was looking at the tests in leoAst.py in the fstringif

Re: #1467: Use traditional unit test (almost?) everywhere

2019-12-29 Thread Brian Theado
Edward, On Sun, Dec 29, 2019 at 2:03 PM Edward K. Ream wrote: > On Saturday, December 28, 2019 at 10:44:39 AM UTC-5, btheado wrote: > > I've been experimenting lately writing pytest tests for leo. I just >> published my work at >> https://github.com/btheado/leo-editor/tree/pytest-experiment. >>

Re: #1467: Use traditional unit test (almost?) everywhere

2019-12-28 Thread Brian Theado
I've been experimenting lately writing pytest tests for leo. I just published my work at https://github.com/btheado/leo-editor/tree/pytest-experiment. You should be able try it out with these commands (untested): git origin add btheado https://github.com/btheado/leo-editor.git git checkout bthead

Re: How to install console leo w/o installing pyqt?

2019-12-23 Thread Brian Theado
Just don't install pyqt at all. I was playing with the web app version of flexx a while back and I think I only installed these pip packages: pip install docutils nbformat pylint pypandoc sphinx semantic_version flexx and then ran leo from the git checkout with --gui=browser. You should be abl

Re: Progress report re #1451: unsaved files

2019-12-15 Thread Brian Theado
Edward, On Sun, Dec 15, 2019 at 5:42 PM Edward K. Ream wrote: > On Sun, Dec 15, 2019 at 7:59 AM Brian Theado > wrote: > [...] > That behavior doesn't seem to be the most user friendly. Better that than >> having the bug where changes are lost, but I wonder if there i

Re: Progress report re #1451: unsaved files

2019-12-15 Thread Brian Theado
If I'm understanding correctly, with your planned changes if a user opens a leo file and makes a few changes and then undoes all the changes and tries to close the file, then the user will be prompted about saving changes even though the outline matches everything on disk. Is that correct? That be

Re: book authoring: formatting, auto-save, auto-commit to git

2019-12-08 Thread Brian Theado
See also this thread: https://groups.google.com/d/msg/leo-editor/1VOYPUJrNEM/ItZwstC0AwAJ. It might be helpful related to git autocommit. On Fri, Dec 6, 2019 at 12:36 PM Terrence-Monroe: Brannon < thequietcen...@gmail.com> wrote: > I found a good answer to git auto-committing: > https://stackover

Re: Enhancing color scheme

2019-12-06 Thread Brian Theado
gar, Previously, you wrote this: > I find color schemes supplied with the leo's distr poor for some languages (for example, >javascript still knows nothing about es6/es7, and markdown ignores back quotes) and want to > enhance them (and even introduce some more). > How should I use changed versi

Re: Enhancing color scheme

2019-12-05 Thread Brian Theado
Sorry, I meant ctrl-shift-V On Thu, Dec 5, 2019 at 3:00 PM Brian Theado wrote: > Copy the xml text to your clipboard. Open a leo outline and hit > ctrl-shift-C. Or right click on a node and select "Paste Node" > > On Thu, Dec 5, 2019 at 2:53 PM gar wrote: > >>

Re: Enhancing color scheme

2019-12-05 Thread Brian Theado
Copy the xml text to your clipboard. Open a leo outline and hit ctrl-shift-C. Or right click on a node and select "Paste Node" On Thu, Dec 5, 2019 at 2:53 PM gar wrote: > Thanks! > But how can I paste raw xml as a node? Couldnt even imagine that this were > possible > > четверг, 5 декабря 20

Re: Enhancing color scheme

2019-12-05 Thread Brian Theado
This thread may interest you: "Defining colorizer modes in @script" https://groups.google.com/d/msg/leo-editor/X9tjxbOq6es/lxyaIooWQzsJ. I never followed through on avoiding the need for the monkey patch. I don't use this code anymore and when I tested it didn't work. I made a small change (highli

Re: Bob H: would distinct Leo IDs help with #1348?

2019-11-08 Thread Brian Theado
On Fri, Nov 8, 2019 at 8:35 AM vitalije wrote: > >> 1) Eliminate the generation of a GNX before reading a file. >>> >> >> Hmm. I wasn't aware that Leo did that. Why does this cause problems? >> >> Since the hidden root node always has GNX hidden-root-vnode-gnx, the >>> motivation for this GNX g

Re: @button for displaying all parents of a clone to log pane

2019-10-12 Thread Brian Theado
SegundoBob, > You give a correct implementation of vnode2allPositions(). [...] > The implementation of vnode2allPositions() in leoCommand.py is seriously flawed [...] > But vnode2allPositions() is not used by Leo-Editor core But vnode2allPositions is used in the leo-editor by the method c.cloneFi

Re: @button for displaying all parents of a clone to log pane

2019-10-10 Thread Brian Theado
Edward, On Thu, Oct 10, 2019 at 12:36 PM Edward K. Ream wrote: [...] > Done at 5e0117d, if I understand you correctly. > Thanks! > I confess that I find both commands confusing, but I'll leave them in. > Thanks for the feedback. Do you mean you find the output confusing or how to use it conf

Re: @button for displaying all parents of a clone to log pane

2019-10-10 Thread Brian Theado
verse and drop first g.es(" ", newline = False) g.es_clickable_link(c, clone, 1, runl + "\n") SegundoBob, this one should work better for your clone structure, though in general there will be more output from this one than the other one. On Tue, Oct 8, 2019 at 8:56

Re: @button for displaying all parents of a clone to log pane

2019-10-08 Thread Brian Theado
In my previous email I was pointing the finger at g.handleUnl doing something wrong for SegundoBob's use case. However, I played with that a little bit and it seems to handle links to clones with the same parent just fine. Now I'm suspecting c.vnode2allPositions is not appropriate for the use case.

Re: @button for displaying all parents of a clone to log pane

2019-10-07 Thread Brian Theado
Thanks, Edward for putting this code into the core as a command. You interpreted SegundoBob's request differently, than I did. I was thinking he didn't mind that the duplicates are there (and maybe prefers it?), just that he wanted the displayed links go to the separate instances of the clones. S

Re: @button for displaying all parents of a clone to log pane

2019-10-07 Thread Brian Theado
SegundoBob, I don't ever have clones with the same parent in my workflow and I didn't think to test that case. It looks like the g.es_clickable_link method is making use of UNL rather than positions. It looks to me like the leo getUNL functionality handles multiple clones with the same parent. Ma

@button for displaying all parents of a clone to log pane

2019-10-06 Thread Brian Theado
I'm aware of the clone-find-all-parents command, but usually I want to display the other parents of a given clone in order to find one of them in particular. I don't want the new nodes which clone-find-all-parents create, because I don't want the extra work later of deleting these extra nodes. I wa

Re: New plugin history_tracer

2019-10-03 Thread Brian Theado
Did you actually make a change to your outline? Body edits don't count. Iirc Vitalije's code doesn't send anything unless a command is executed. On Thu, Oct 3, 2019 at 3:35 PM Edward K. Ream wrote: > > > On Thu, Oct 3, 2019 at 10:22 AM vitalije wrote: > >> Try to write leo-ver-server-files.txt

Re: Pytest command

2019-10-02 Thread Brian Theado
Vitalije, I was looking at the execute-pytest code and it looked to me like only the assertion rewrite functionality from pytest is being used. I would guess none of the hooks or fixtures and maybe most plugins will work. I don't much trust my code reading so I figured I'd better test it, but I o

Re: leo from devel fail to start on windows

2019-10-01 Thread Brian Theado
Try looking in your %HOME%/.leo/db directory (or whatever it is on windows). See if there is a file with scripts.leo in its name. If so, then move the db directory to db.bak and try starting leo again. I encountered a similar issue the other day and I didn't realize it might be due to new leo code.

Re: How to trace Leo Core?

2019-09-29 Thread Brian Theado
Edward can speak to the built-in leo traces, but there are also other options. I mentioned in the thread at https://groups.google.com/forum/#!topic/leo-editor/r6ktpQNWySk, about using the python trace module for debugging python applications, but I no longer recommend using it because it is too di

Re: New plugin history_tracer

2019-09-28 Thread Brian Theado
Thanks. It worked for me. Looks just as impressive as your demo a few months back. Nice work! On Sat, Sep 28, 2019 at 4:17 PM vitalije wrote: > Good catch. I forgot to add it. > Rev d8fc8bc > > contains >

Re: New plugin history_tracer

2019-09-28 Thread Brian Theado
Vitalije, I'm see a blank @file history_tracer.py. Did you forget a 'git add'? Brian On Sat, Sep 28, 2019 at 2:22 PM vitalije wrote: > I finally got around to pack and publish my new plugin history_tracer. > > In order to be useful one must have installed leo-ver-serv utility. I'll > try to ma

Re: Pytest command

2019-09-26 Thread Brian Theado
Vitalije, This looks nice. I'm really impressed with the assertion failure output pytest gives. I wonder how hard it would be to write a pytest plugin to support leo's unit tests. Their plugin system makes use of hooks like Leo does, only it is like hooks on steroids. This example code shows how

Re: Automatically move to the beginning/end of line

2019-09-26 Thread Brian Theado
Thanks a lot, Edward! I'll give it a try later. I discovered when using my code on a mac laptop that I had to bind to Keypad-Up and Keypad-Down. Apparently the laptop keyboard on my mac doesn't have any keys mapping to just plain Up and Down. On Thu, Sep 26, 2019 at 12:10 PM Edward K. Ream wrote

Re: Automatically move to the beginning/end of line

2019-09-26 Thread Brian Theado
Yes, I've always noticed this behavior from Leo and rather than look into fixing it, I've trained myself when using leo to select one fewer lines than needed before I hit the tab key to indent. Maybe it isn't all that hard to fix it, but maybe some people don't see this behavior as "broken". I thin

Automatically move to the beginning/end of line

2019-09-26 Thread Brian Theado
When moving down a text editor line-by-line, I rely on the common behavior of automatically moving to the end of the line when trying to scroll down past the last line. Similar for when scrolling up past the first line. Leo doesn't have this behavior, so I wrote the below script. Thought I'd share

Re: Devs, please don't add commit_timestamp.json

2019-09-23 Thread Brian Theado
Maybe vitalije still has the old git hook: $ git log -- leo/core/commit_timestamp.json [...] commit 65ca5ec3d4a3af17c538026d825fcea782eb5b8a Author: vitalije Date: Mon Sep 23 08:17:05 2019 +0200 Fixed issue #658 Leo build: 20190923061705 On Mon, Sep 23, 2019 at 7:16 AM Edward K. Rea

Re: Unpredictable bug: "NewHeadline" instead of actual headline

2019-09-19 Thread Brian Theado
Without seeing actual code, I find it difficult to understand your explanation enough to come up with any guess. But it seems you have 3 things: leo code, your comparison code, and your unit test code. Since this problem started happening, at least one of those things had to have changed right? I s

Re: Automatic git commit on save using entr

2019-09-15 Thread Brian Theado
Ok, thanks for the confirmation. I never close terminal windows and always launch leo with a command on the command-line. On Sun, Sep 15, 2019 at 1:48 PM Chris George wrote: > I use a .desktop panel shortcut to run Leo. I always run it in a terminal > window and close the terminal on exit of Leo

Re: Automatic git commit on save using entr

2019-09-15 Thread Brian Theado
Vitalije, YMMV, but I had a bad experience with watching files when using Leo. Leo > often writes files in two phases and it happened to me more than once that > process watching on files take an empty file or not completely written > because of this. So, I had to add some latency to watcher. > T

Re: Automatic git commit on save using entr

2019-09-15 Thread Brian Theado
Chris, On Sun, Sep 15, 2019 at 7:11 AM Chris George wrote: [...] > #!/bin/bash > > cd ~/leo-editor > git pull > cd /working/MEGA/leo-files > ./rerun2 ./push & > python3 ~/leo-editor/launchLeo.py $1 $2 $3 > > > Thanks for sharing. [...rerun2 script...] At a glance, that script seems to be perfo

Re: Automatic git commit on save using entr

2019-09-15 Thread Brian Theado
Thanks, Vitalije. I had rejected the 'save2' approach because I wanted to run the git commit in the background so it wouldn't add any extra time to the save. Using 'save2' doesn't preclude running the process in the background, but if I take the "naive" approach of using g.execute_shell_commands, t

Automatic git commit on save using entr

2019-09-14 Thread Brian Theado
I'm currently using leo as my main note-taking application and I find it very useful to have auto-saving, so I enabled the auto-save module. I felt a little nervous about using auto-save and decided I wanted a git commit on every save so I would have a history in case anything goes wrong. I read

Re: Global variables in user scripts

2019-09-11 Thread Brian Theado
Thanks, Vitalije. Only after seeing your response did it occur to me to take a closer look at the scripting docs and of course the user_dict ivar is documented there. On Wed, Sep 11, 2019 at 7:42 AM vitalije wrote: > You have c.user_dict for these kind of things. It is an ordinary python > dicti

Global variables in user scripts

2019-09-11 Thread Brian Theado
I'm writing a script button in which I want to transform some outline data into html and then display that html in a leo doc. The viewrendered functionality doesn't seem to really fit my needs as the render pane output is tied to whatever node is currently selected. I just want to be able to displ

Re: Please test the docks branch

2019-09-06 Thread Brian Theado
I found some strange behavior when launching leo with a non-existent file on the command line. If I don't give any files on the command line or if I give the path to an existing file, then it is fine. But with the new file on command line, the tips windows appears and leo is still running, but ther

Re: Active settings outline: status report

2019-09-01 Thread Brian Theado
On Sun, Sep 1, 2019 at 6:13 AM vitalije wrote: > I am tempted to put aside all my current tasks and write my own > launchLeo.py which will monkey patch completely cofiguration code and just > read settings from the database table. I guess it would greatly reduce > number of code lines that has to

Re: I've just killed two issues

2019-08-26 Thread Brian Theado
Vitalije, On Mon, Aug 26, 2019 at 3:42 AM vitalije wrote: > Do you envision distributing the leoSettings.leo derived database with leo >> itself? Or do you have something else in mind? I was wondering how that >> first database of settings would be available at the time of leo first use. >> > >

Re: I've just killed two issues

2019-08-25 Thread Brian Theado
Vitalije, On Sat, Aug 24, 2019 at 9:54 AM vitalije wrote: [...] > After editing settings in the myLeoSettings.leo or any other settings > outline, user should invoke a command to save settings. This command can be > executed automatically on each save. This command would read settings from > the

Re: Having trouble writing a simple grouped undo/redo

2019-08-25 Thread Brian Theado
I submitted pull request https://github.com/leo-editor/leo-editor/pull/1302. No new failed test cases and the failing test case I added passes. On Sun, Aug 25, 2019 at 10:04 AM Edward K. Ream wrote: > On Sat, Aug 24, 2019 at 7:56 PM Brian Theado > wrote: > >> It turns

Re: Having trouble writing a simple grouped undo/redo

2019-08-24 Thread Brian Theado
en I get a chance. On Wed, Aug 21, 2019 at 7:45 AM Brian Theado wrote: > Sure, I'll do that or figure out the segfault issue sometime this week. > > On Tue, Aug 20, 2019 at 7:26 AM Edward K. Ream > wrote: > >> Unfortunately, I'm not able to run unit tests w

Re: Invalid position error on redo position move

2019-08-21 Thread Brian Theado
Vitalije, On Wed, Aug 21, 2019 at 5:41 PM vitalije wrote: > Well I didn't tried too hard to make it more readable. It can be improved. > Ok, after looking at it some more, I see that the vnode tree structure involves only a list of children and a list of parents (one parent for each clone). Tha

Re: Invalid position error on redo position move

2019-08-21 Thread Brian Theado
Thanks vitalije for noticing the position error. I wonder why it only gave an error on redo and not also for the original operation. Thanks for the vnode-based code. Based on a quick test, it seems better than my position based code as I haven't seen any errors on undo/redo. I'm finding the vnode

Re: Invalid position error on redo position move

2019-08-21 Thread Brian Theado
Thanks, vitalije. The else part of the 'if 1:' was my failed attempt to further simplify the failing case. The error is happening when the code does: insert, clone, move the clone to the first child of node="two" (which already has one child named "three"), undo, redo. I though I might also dupli

Invalid position error on redo position move

2019-08-21 Thread Brian Theado
In the code I've been writing, there is one particular case which gives an "invalid position" error when I redo it. I've written some simplified code which replicates the scenario (even removing the grouped undo allows the issue to duplicate). The code performs 3 individually undoable operations:

Re: Having trouble writing a simple grouped undo/redo

2019-08-21 Thread Brian Theado
Sure, I'll do that or figure out the segfault issue sometime this week. On Tue, Aug 20, 2019 at 7:26 AM Edward K. Ream wrote: > Unfortunately, I'm not able to run unit tests without getting a segfault. >> > Alright. Create a new branch, and I'll run the unit tests there. > -- You received thi

Re: Having trouble writing a simple grouped undo/redo

2019-08-20 Thread Brian Theado
the same workaround didn't work for running the unit tests. I have some ideas on tracking it down further, but I haven't gotten to it yet. On Tue, Aug 20, 2019 at 6:15 AM Edward K. Ream wrote: > > > On Mon, Aug 19, 2019 at 7:04 PM Brian Theado > wrote: > >> I found a

  1   2   >