On Sat, 17 Aug 2013 12:32:13 -0700 (PDT)
Terry <[email protected]> wrote:
> Is there such option ? to reopen, on Leo startup, all open files from the
> previous session ?
Don't think there's any core function / plugin, but previously this
script that you can run from a @button was written:
tablist = g.findNodeAnywhere(c, '@script load tabs')
if not tablist:
from leo.core.leoNodes import vnode
v = vnode(c)
v.h = '@script load tabs'
v._linkAsNthChild(c.hiddenRootNode,
len(c.hiddenRootNode.children))
tablist = g.findNodeAnywhere(c, '@script load tabs')
assert tablist
import time
b = ["# Generated %s\n"%time.strftime('%c')]
for oc in g.app.commanders():
b.append("g.openWithFileName('%s', c)" % oc.fileName())
b.append("c.frame.bringToFront()")
b.append("c.setLog()")
tablist.b = '\n'.join(b)
It creates or re-uses a node at the end of the file called
'@script load tabs', which will run when the primary file's loaded and
load the other files which were loaded when the original script was run
from the button. E.g. when I ran the above just now it created a
'@script load tabs' with a content of:
# Generated Sat 17 Aug 2013 03:19:40 PM CDT
g.openWithFileName('/home/tbrown/.leo/workbook.leo', c)
g.openWithFileName('/home/tbrown/.leo/.dates.leo', c)
g.openWithFileName('/home/tbrown/.leo/.todo.leo', c)
c.frame.bringToFront()
c.setLog()
You have to have
@bool scripting-at-script-nodes = True
in meLeoSettings.leo for the @script node to be run.
Cheers -Terry
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.