Merge lp:~robs987/leo-editor/openWith into lp:leo-editor/old-trunk

Proposed by Rob Sheppard
Status: Needs review
Proposed branch: lp:~robs987/leo-editor/openWith
Merge into: lp:leo-editor/old-trunk
Diff against target: 58 lines
2 files modified
leo/core/leoCommands.py (+15/-4)
leo/doc/leoToDo.txt (+15/-4)
To merge this branch: bzr merge lp:~robs987/leo-editor/openWith
Reviewer Review Type Date Requested Status
Ville M. Vainio Approve
Review via email: mp+14194@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Rob Sheppard (robs987) wrote :

Modification to openWith to allow user to edit nodes of @<file> trees in external editor while preserving the file extension of root @<file> node.

Revision history for this message
Ville M. Vainio (villemvainio) wrote :

Fine with me, will merge to trunk later

review: Approve
Revision history for this message
Ville M. Vainio (villemvainio) wrote :

Still get

ville@ville-desktop:~/leo-editor$ bzr merge lp:~robs987/leo-editor/openWith
bzr: ERROR: KnitPackRepository('file:///home/ville/leo-editor/.bzr/repository/')
is not compatible with
RemoteRepository(bzr+ssh://bazaar.launchpad.net/~robs987/leo-editor/openWith/.bzr/)
different rich-root support

I know that I can fix this by doing "bzr convert" on leo-editor branch, or apply the fix manually - but in the light of recent launchpad problems, I'll let this sit for a few more days. I hope you don't mind, just notifying that this contribution is by no means forgotten right now.

Revision history for this message
Rob Sheppard (robs987) wrote :

Ville M. Vainio wrote, On 11/7/2009 3:19 PM:
> Still get
>
> ville@ville-desktop:~/leo-editor$ bzr merge lp:~robs987/leo-editor/openWith
> bzr: ERROR: KnitPackRepository('file:///home/ville/leo-editor/.bzr/repository/')
> is not compatible with
> RemoteRepository(bzr+ssh://bazaar.launchpad.net/~robs987/leo-editor/openWith/.bzr/)
> different rich-root support
>
> I know that I can fix this by doing "bzr convert" on leo-editor branch, or apply the fix manually - but in the light of recent launchpad problems, I'll let this sit for a few more days. I hope you don't mind, just notifying that this contribution is by no means forgotten right now.
>
>

Sorry for the delay, I've been swamped at work.

I suppose this is caused by me having the wrong "rich-root support" in
my local repo, which I don't really understand because I'm just using
the defaults. Any suggestions for how I should be setting up my local
repo/branch?

In the meantime, I'll educate myself on this rich-root stuff.

If it's a hassle for you to merge this little change, don't feel
obligated. It was mainly an exercise to help me learn some of Leo's code
and the process of contributing, the later being more complicated than I
though it was :)

Thanks again for helping a n00b.

Rob

Unmerged revisions

2459. By Rob Sheppard

Modified openWith to get file extension for @<file> nodes from file name

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'leo/core/leoCommands.py'
2--- leo/core/leoCommands.py 2009-10-08 00:25:54 +0000
3+++ leo/core/leoCommands.py 2009-10-29 23:05:26 +0000
4@@ -725,10 +725,21 @@
5 #@ << set ext based on the present language >>
6 #@+node:ekr.20031218072017.2824:<< set ext based on the present language >>
7 if not ext:
8- theDict = c.scanAllDirectives()
9- language = theDict.get("language")
10- ext = g.app.language_extension_dict.get(language)
11- # g.pr(language,ext)
12+ # if node is part of @<file> tree, get ext from file name
13+ for cursor in p.self_and_parents():
14+ if cursor.isAnyAtFileNode():
15+ h = cursor.h
16+ f = h.split(None, 1)[1]
17+ ext = os.path.splitext(f)[1]
18+ break
19+
20+ # otherwise use ext from @language directive
21+ if not ext:
22+ theDict = c.scanAllDirectives()
23+ language = theDict.get("language")
24+ ext = g.app.language_extension_dict.get(language)
25+ # g.pr(language,ext)
26+
27 if ext == None:
28 ext = "txt"
29
30
31=== modified file 'leo/doc/leoToDo.txt'
32--- leo/doc/leoToDo.txt 2009-10-16 10:53:52 +0000
33+++ leo/doc/leoToDo.txt 2009-10-29 23:05:25 +0000
34@@ -3948,10 +3948,21 @@
35 return "break"
36 #@+node:ekr.20031218072017.2824:<< set ext based on the present language >>
37 if not ext:
38- theDict = c.scanAllDirectives()
39- language = theDict.get("language")
40- ext = g.app.language_extension_dict.get(language)
41- # g.pr(language,ext)
42+ # if node is part of @<file> tree, get ext from file name
43+ for cursor in p.self_and_parents():
44+ if cursor.isAnyAtFileNode():
45+ h = cursor.h
46+ f = h.split(None, 1)[1]
47+ ext = os.path.splitext(f)[1]
48+ break
49+
50+ # otherwise use ext from @language directive
51+ if not ext:
52+ theDict = c.scanAllDirectives()
53+ language = theDict.get("language")
54+ ext = g.app.language_extension_dict.get(language)
55+ # g.pr(language,ext)
56+
57 if ext == None:
58 ext = "txt"
59

Subscribers

People subscribed via source and target branches

to status/vote changes: