emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] refine org-babel-tangle-jump-to-org?


From: Eric Schulte
Subject: Re: [O] refine org-babel-tangle-jump-to-org?
Date: Thu, 06 Jun 2013 09:06:59 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

> the tangled file looks as follow, including the empty lines at
> beginning and end:
>
> ,----
> | 
> | ## [[file:~/tmp/jumpBack.org::*newASM%20(./newASM.R)][newASM\ 
> \(\./newASM\.R\):1]]
> | 
> | 
> logList("##########################################################################")
> |   
> logList("##########################################################################")
> |   logList("####")
> |   logList("#### Simulation object ASM created.")
> |   logList("####")
> |   logList("#### It has been undergone basic initialisation and will")
> |   logList("#### be initialised for usage when simulated by running")
> |   logList("####")
> |   logList("#### > sim(ASM)")
> |   logList("####")
> |   logList("#### or manually, without simulating, by running")
> |   logList("#### > ASM <- initialize(ASM)")
> |   logList("####")
> |   
> logList("##########################################################################")
> |   logList("####")
> |   logList( paste("#### GISDBASE : ", parms(ASM)$baseDir) )
> |   logList( paste("#### LOCATION : ", parms(ASM)$grassLocation) )
> |   logList( paste("#### MAPSET   : ", parms(ASM)$grassMapset) )
> |   logList("####")
> |   
> logList("##########################################################################")
> |   
> logList("##########################################################################")
> |   logEnd()
> |   return(ASM)
> | }
> | 
> | ## newASM\ \(\./newASM\.R\):1 ends here
> | 
> `----
>
> This one works, although the cursor is consistently two characters to the 
> left then
> where it should be.
>

This is off because the first line of your example is not indented
correctly when tangled.  Specifically, it is indented by two spaces in
the source file and by four spaces in the code block.  Setting the
`org-src-preserve-indentation' variable to t should fix this.

>
> If I change
>
> ,----
> | #+PROPERTY: padline yes
> `----
>
> to
>
> ,----
> | #+PROPERTY: padline no
> `----
>
> the padlines are gone, ant the jumping back is completely off (from
> first r in return() it jumps to the third # in the last logList()).
>

For now I think both padlines and link comments are required for the
jumping functionality to work.  I've updated the documentation to
reflect this.

,----
| @subheading Jumping between code and Org
| 
| When tangling code from an Org-mode buffer to a source code file, you'll
| frequently find yourself viewing the file of tangled source code (e.g., many
| debuggers point to lines of the source code file).  It is useful to be able
| to navigate from the tangled source to the Org-mode buffer from which the
| code originated.
| 
| The @code{org-babel-tangle-jump-to-org} function provides this jumping from
| code to Org-mode functionality.  Two header arguments are required for
| jumping to work, first the @xref{padline} option must be set to true (the
| default setting), second the @xref{comments} header argument must be set to
| @code{links}, which will insert comments into the source code buffer which
| point back to the original Org-mode file.
`----

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



reply via email to

[Prev in Thread] Current Thread [Next in Thread]