emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-babel (org-babel-detangle)
@ 2011-04-13 13:16 Mohamed HIBTI
  2011-04-13 16:50 ` Eric Schulte
  0 siblings, 1 reply; 7+ messages in thread
From: Mohamed HIBTI @ 2011-04-13 13:16 UTC (permalink / raw)
  To: emacs-orgmode

Dear all,
I have a problem with detangling org-babel fragments. 
May be this is because XML is not a supported feature/or I use it in a wrong way.
Any help is welcome.

My org-file is below. I can tangle this file to obtain the XML file but 
when I try to jump to org I get the message "not in tangled code".

*** TODO Question that needs validation
    :PROPERTIES:
    :ID:       2788f65d-5613-40c1-80ae-ae966f4bb398
    :END: 
#+BEGIN_SRC XML :tangle ./sample04.xml :comment yes			
<define-fault-tree name="ACP-2">
  <!-- Le problème de cette question -->
  <!---->
        <label>AC Power System Bus 2</label>
        <define-gate name="@ACP-2-1" code:calctype="Q">
                <label>AC Power System Bus 2 fails</label>
                <and>
                <gate name="@ACP-2-2"/>
                        <gate name="@ACP-2-3"/>
                </and>
        </define-gate>
</define-fault-tree>
#+END_SRC

Best regards,

Mohamed

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-babel (org-babel-detangle)
  2011-04-13 13:16 org-babel (org-babel-detangle) Mohamed HIBTI
@ 2011-04-13 16:50 ` Eric Schulte
  2011-04-13 18:01   ` Mohamed HIBTI
  2011-04-14  9:19   ` Mohamed HIBTI
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Schulte @ 2011-04-13 16:50 UTC (permalink / raw)
  To: Mohamed HIBTI; +Cc: emacs-orgmode

Hi Mohamed,

You have a small typo in your header arguments, ":comment" should be
":comments".  After that change then code block should be tangled
wrapped in comments, and then Babel can use these comments to jump back
to the original org-mode file.

That said, the detangle mechanisms are in need of some work,
specifically regarding their use of the Org-mode's link resolution,
which doesn't currently make it possible to programmatically jump to the
results of a link.  So, until some time is spent fixing up the
detangling machinery inside of Babel, you may not find detangling to be
extremely robust.

Best -- Eric

Mohamed HIBTI <mohamed.hibti@gmail.com> writes:

> Dear all,
> I have a problem with detangling org-babel fragments. 
> May be this is because XML is not a supported feature/or I use it in a wrong way.
> Any help is welcome.
>
> My org-file is below. I can tangle this file to obtain the XML file but 
> when I try to jump to org I get the message "not in tangled code".
>
> *** TODO Question that needs validation
>     :PROPERTIES:
>     :ID:       2788f65d-5613-40c1-80ae-ae966f4bb398
>     :END: 
> #+BEGIN_SRC XML :tangle ./sample04.xml :comment yes			
> <define-fault-tree name="ACP-2">
>   <!-- Le problme de cette question -->
>   <!---->
>         <label>AC Power System Bus 2</label>
>         <define-gate name="@ACP-2-1" code:calctype="Q">
>                 <label>AC Power System Bus 2 fails</label>
>                 <and>
>                 <gate name="@ACP-2-2"/>
>                         <gate name="@ACP-2-3"/>
>                 </and>
>         </define-gate>
> </define-fault-tree>
> #+END_SRC
>
> Best regards,
>
> Mohamed
>
>
>

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-babel (org-babel-detangle)
  2011-04-13 16:50 ` Eric Schulte
@ 2011-04-13 18:01   ` Mohamed HIBTI
  2011-04-14  9:19   ` Mohamed HIBTI
  1 sibling, 0 replies; 7+ messages in thread
From: Mohamed HIBTI @ 2011-04-13 18:01 UTC (permalink / raw)
  To: emacs-orgmode

"Eric Schulte" <schulte.eric@gmail.com> writes:
Hi Eric,
Thanks for this swift reply. I will try :)
Best regards,
Mohamed
> Hi Mohamed,
>
> You have a small typo in your header arguments, ":comment" should be
> ":comments".  After that change then code block should be tangled
> wrapped in comments, and then Babel can use these comments to jump back
> to the original org-mode file.
>
> That said, the detangle mechanisms are in need of some work,
> specifically regarding their use of the Org-mode's link resolution,
> which doesn't currently make it possible to programmatically jump to the
> results of a link.  So, until some time is spent fixing up the
> detangling machinery inside of Babel, you may not find detangling to be
> extremely robust.
>
> Best -- Eric
>
> Mohamed HIBTI <mohamed.hibti@gmail.com> writes:
>
>> Dear all,
>> I have a problem with detangling org-babel fragments. 
>> May be this is because XML is not a supported feature/or I use it in a wrong way.
>> Any help is welcome.
>>
>> My org-file is below. I can tangle this file to obtain the XML file but 
>> when I try to jump to org I get the message "not in tangled code".
>>
>> *** TODO Question that needs validation
>>     :PROPERTIES:
>>     :ID:       2788f65d-5613-40c1-80ae-ae966f4bb398
>>     :END: 
>> #+BEGIN_SRC XML :tangle ./sample04.xml :comment yes			
>> <define-fault-tree name="ACP-2">
>>   <!-- Le problme de cette question -->
>>   <!---->
>>         <label>AC Power System Bus 2</label>
>>         <define-gate name="@ACP-2-1" code:calctype="Q">
>>                 <label>AC Power System Bus 2 fails</label>
>>                 <and>
>>                 <gate name="@ACP-2-2"/>
>>                         <gate name="@ACP-2-3"/>
>>                 </and>
>>         </define-gate>
>> </define-fault-tree>
>> #+END_SRC
>>
>> Best regards,
>>
>> Mohamed
>>
>>
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-babel (org-babel-detangle)
  2011-04-13 16:50 ` Eric Schulte
  2011-04-13 18:01   ` Mohamed HIBTI
@ 2011-04-14  9:19   ` Mohamed HIBTI
  2011-04-14 14:47     ` Eric Schulte
  1 sibling, 1 reply; 7+ messages in thread
From: Mohamed HIBTI @ 2011-04-14  9:19 UTC (permalink / raw)
  To: emacs-orgmode

Eric Schulte <schulte.eric <at> gmail.com> writes:

Hi Eric,
I tried it, it worked quite well but I have a trouble with the syntax comment
(No comment syntax is defined.  Use: ) Since I have too many blocks, is there 
any way to set it as a local variable ?

Regards,
Mohamed



P.S. 
I tried without success

#+ Local Variables :
#+ org-babel-tangle-comment-format-beg: "<!--[[%link][source-name]]"
#+ org-babel-tangle-comment-format-end: "source-name ends here-->"
#+ End:

and 

# Local Variables :
# org-babel-tangle-comment-format-beg: "<!--[[%link][source-name]]"
# org-babel-tangle-comment-format-end: "source-name ends here-->"
# End:

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-babel (org-babel-detangle)
  2011-04-14  9:19   ` Mohamed HIBTI
@ 2011-04-14 14:47     ` Eric Schulte
  2011-04-15  8:36       ` Mohamed HIBTI
  2011-04-15 16:45       ` Mohamed HIBTI
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Schulte @ 2011-04-14 14:47 UTC (permalink / raw)
  To: Mohamed HIBTI; +Cc: emacs-orgmode

Hi Mohamed,

The comment prompt you mentioned actually isn't babel specific but is
raised by the `comment-region' function which is used by babel to
comment out links.  Look at the documentation for `comment-region'
(below) which has information on variables to set to avoid the "comment
syntax" prompt in xml documents.

Best -- Eric

,----[C-h f comment-region]
| comment-region is an interactive compiled Lisp function in
| `newcomment.el'.
| 
| It is bound to C-c r.
| 
| (comment-region BEG END &optional ARG)
| 
| Comment or uncomment each line in the region.
| With just C-u prefix arg, uncomment each line in region BEG .. END.
| Numeric prefix ARG means use ARG comment characters.
| If ARG is negative, delete that many comment characters instead.
| 
| The strings used as comment starts are built from `comment-start'
| and `comment-padding'; the strings used as comment ends are built
| from `comment-end' and `comment-padding'.
| 
| By default, the `comment-start' markers are inserted at the
| current indentation of the region, and comments are terminated on
| each line (even for syntaxes in which newline does not end the
| comment and blank lines do not get comments).  This can be
| changed with `comment-style'.
`----

Mohamed HIBTI <mohamed.hibti@gmail.com> writes:

> Eric Schulte <schulte.eric <at> gmail.com> writes:
>
> Hi Eric,
> I tried it, it worked quite well but I have a trouble with the syntax comment
> (No comment syntax is defined.  Use: ) Since I have too many blocks, is there 
> any way to set it as a local variable ?
>
> Regards,
> Mohamed
>
>
>
> P.S. 
> I tried without success
>
> #+ Local Variables :
> #+ org-babel-tangle-comment-format-beg: "<!--[[%link][source-name]]"
> #+ org-babel-tangle-comment-format-end: "source-name ends here-->"
> #+ End:
>
> and 
>
> # Local Variables :
> # org-babel-tangle-comment-format-beg: "<!--[[%link][source-name]]"
> # org-babel-tangle-comment-format-end: "source-name ends here-->"
> # End:
>
>
>
>
>
>
>
>

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-babel (org-babel-detangle)
  2011-04-14 14:47     ` Eric Schulte
@ 2011-04-15  8:36       ` Mohamed HIBTI
  2011-04-15 16:45       ` Mohamed HIBTI
  1 sibling, 0 replies; 7+ messages in thread
From: Mohamed HIBTI @ 2011-04-15  8:36 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

"Eric Schulte" <schulte.eric@gmail.com> writes:

Thanks for this answer.
I got it.




> Hi Mohamed,
>
> The comment prompt you mentioned actually isn't babel specific but is
> raised by the `comment-region' function which is used by babel to
> comment out links.  Look at the documentation for `comment-region'
> (below) which has information on variables to set to avoid the "comment
> syntax" prompt in xml documents.
>
> Best -- Eric
>
> ,----[C-h f comment-region]
> | comment-region is an interactive compiled Lisp function in
> | `newcomment.el'.
> | 
> | It is bound to C-c r.
> | 
> | (comment-region BEG END &optional ARG)
> | 
> | Comment or uncomment each line in the region.
> | With just C-u prefix arg, uncomment each line in region BEG .. END.
> | Numeric prefix ARG means use ARG comment characters.
> | If ARG is negative, delete that many comment characters instead.
> | 
> | The strings used as comment starts are built from `comment-start'
> | and `comment-padding'; the strings used as comment ends are built
> | from `comment-end' and `comment-padding'.
> | 
> | By default, the `comment-start' markers are inserted at the
> | current indentation of the region, and comments are terminated on
> | each line (even for syntaxes in which newline does not end the
> | comment and blank lines do not get comments).  This can be
> | changed with `comment-style'.
> `----
>
> Mohamed HIBTI <mohamed.hibti@gmail.com> writes:
>
>> Eric Schulte <schulte.eric <at> gmail.com> writes:
>>
>> Hi Eric,
>> I tried it, it worked quite well but I have a trouble with the syntax comment
>> (No comment syntax is defined.  Use: ) Since I have too many blocks, is there 
>> any way to set it as a local variable ?
>>
>> Regards,
>> Mohamed
>>
>>
>>
>> P.S. 
>> I tried without success
>>
>> #+ Local Variables :
>> #+ org-babel-tangle-comment-format-beg: "<!--[[%link][source-name]]"
>> #+ org-babel-tangle-comment-format-end: "source-name ends here-->"
>> #+ End:
>>
>> and 
>>
>> # Local Variables :
>> # org-babel-tangle-comment-format-beg: "<!--[[%link][source-name]]"
>> # org-babel-tangle-comment-format-end: "source-name ends here-->"
>> # End:
>>
>>
>>
>>
>>
>>
>>
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-babel (org-babel-detangle)
  2011-04-14 14:47     ` Eric Schulte
  2011-04-15  8:36       ` Mohamed HIBTI
@ 2011-04-15 16:45       ` Mohamed HIBTI
  1 sibling, 0 replies; 7+ messages in thread
From: Mohamed HIBTI @ 2011-04-15 16:45 UTC (permalink / raw)
  To: emacs-orgmode

Eric Schulte <schulte.eric <at> gmail.com> writes:
> 
> Hi Mohamed,
> 
> The comment prompt you mentioned actually isn't babel specific but is
> raised by the `comment-region' function which is used by babel to
> comment out links.  Look at the documentation for `comment-region'
> (below) which has information on variables to set to avoid the "comment
> syntax" prompt in xml documents.
> 
> Best -- Eric
> 
> ,----[C-h f comment-region]
> | comment-region is an interactive compiled Lisp function in
> | `newcomment.el'.
> | 
> | It is bound to C-c r.
> | 
> | (comment-region BEG END &optional ARG)
> | 
> | Comment or uncomment each line in the region.
> | With just C-u prefix arg, uncomment each line in region BEG .. END.
> | Numeric prefix ARG means use ARG comment characters.
> | If ARG is negative, delete that many comment characters instead.
> | 
> | The strings used as comment starts are built from `comment-start'
> | and `comment-padding'; the strings used as comment ends are built
> | from `comment-end' and `comment-padding'.
> | 
> | By default, the `comment-start' markers are inserted at the
> | current indentation of the region, and comments are terminated on
> | each line (even for syntaxes in which newline does not end the
> | comment and blank lines do not get comments).  This can be
> | changed with `comment-style'.
> `----
> 
> Mohamed HIBTI <mohamed.hibti <at> gmail.com> writes:
> 
> > Eric Schulte <schulte.eric <at> gmail.com> writes:
> >
> > Hi Eric,
> > I tried it, it worked quite well but I have a trouble with the syntax 
comment
> > (No comment syntax is defined.  Use: ) Since I have too many blocks, is 
there 
> > any way to set it as a local variable ?
> >
> > Regards,
> > Mohamed
> >
> >
> >
> > P.S. 
> > I tried without success
> >
> > #+ Local Variables :
> > #+ org-babel-tangle-comment-format-beg: "<!--[[%link][source-name]]"
> > #+ org-babel-tangle-comment-format-end: "source-name ends here-->"
> > #+ End:
> >
> > and 
> >
> > # Local Variables :
> > # org-babel-tangle-comment-format-beg: "<!--[[%link][source-name]]"
> > # org-babel-tangle-comment-format-end: "source-name ends here-->"
> > # End:
> >
> >
> >
> >
> >
> >
> >
> >
> 

Thanks for this answer.
You are right ! 
In the line

 #+BEGIN_SRC XML :tangle ./sample04.xml :comment yes	

XML (with capitals) is not identified with the xml-mode where the variables 
`comment-begin' and `comment-end' are well defined.
I changed to  

 #+BEGIN_SRC xml :tangle ./sample04.xml :comment yes	

and it worked !

Best regards,
Mohamed
Thanks for this answer.
You are right ! 


In the line

 #+BEGIN_SRC XML :tangle ./sample04.xml :comment yes	

XML (with capitals) is not identified with the xml-mode where the variables 
`comment-begin' and `comment-end' are well defined.
I changed to  

 #+BEGIN_SRC xml :tangle ./sample04.xml :comment yes	

and it worked !

Best regards,
Mohamed

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-04-15 16:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-13 13:16 org-babel (org-babel-detangle) Mohamed HIBTI
2011-04-13 16:50 ` Eric Schulte
2011-04-13 18:01   ` Mohamed HIBTI
2011-04-14  9:19   ` Mohamed HIBTI
2011-04-14 14:47     ` Eric Schulte
2011-04-15  8:36       ` Mohamed HIBTI
2011-04-15 16:45       ` Mohamed HIBTI

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).