emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Illiterate programming question
@ 2011-03-30 20:32 Robert Goldman
  2011-03-30 21:33 ` Nick Dokos
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Goldman @ 2011-03-30 20:32 UTC (permalink / raw)
  To: Org Mode

I would like to do the opposite of literate programming (hence the
subject line!):

I would like to pull into my org file snippets from a code file.  I know
that org-mode will let me import /entire/ source code files.  Is there
some way to say "Import the region of this file between these two
delimiters?"

If not, do you think it would be hard to add this feature?  I already
have the snappy name, after all!

Best,
r

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

* Re: Illiterate programming question
  2011-03-30 20:32 Illiterate programming question Robert Goldman
@ 2011-03-30 21:33 ` Nick Dokos
  2011-03-30 21:39   ` Erik Iverson
  2011-03-30 21:44   ` Robert Goldman
  0 siblings, 2 replies; 13+ messages in thread
From: Nick Dokos @ 2011-03-30 21:33 UTC (permalink / raw)
  To: rpgoldman; +Cc: nicholas.dokos, Org Mode

Robert Goldman <rpgoldman@sift.info> wrote:

> I would like to do the opposite of literate programming (hence the
> subject line!):
> 
> I would like to pull into my org file snippets from a code file.  I know
> that org-mode will let me import /entire/ source code files.  Is there
> some way to say "Import the region of this file between these two
> delimiters?"
> 
> If not, do you think it would be hard to add this feature?  I already
> have the snappy name, after all!
> 

I don't really understand: can't you cut and paste?

And what do you mean that "org-mode will let me import /entire/ source code
files"? Is this a facility other than insert-file? Or are you talking about
the #+INCLUDE mechanism?

Thanks,
Nick

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

* Re: Illiterate programming question
  2011-03-30 21:33 ` Nick Dokos
@ 2011-03-30 21:39   ` Erik Iverson
  2011-03-30 21:44   ` Robert Goldman
  1 sibling, 0 replies; 13+ messages in thread
From: Erik Iverson @ 2011-03-30 21:39 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Org Mode, rpgoldman



Nick Dokos wrote:
> Robert Goldman <rpgoldman@sift.info> wrote:
> 
>> I would like to do the opposite of literate programming (hence the
>> subject line!):
>>
>> I would like to pull into my org file snippets from a code file.  I know
>> that org-mode will let me import /entire/ source code files.  Is there
>> some way to say "Import the region of this file between these two
>> delimiters?"
>>
>> If not, do you think it would be hard to add this feature?  I already
>> have the snappy name, after all!
>>
> 
> I don't really understand: can't you cut and paste?

Yes, are you talking about upon exporting a document?

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

* Re: Illiterate programming question
  2011-03-30 21:33 ` Nick Dokos
  2011-03-30 21:39   ` Erik Iverson
@ 2011-03-30 21:44   ` Robert Goldman
  2011-03-30 22:38     ` chris.m.malone
                       ` (2 more replies)
  1 sibling, 3 replies; 13+ messages in thread
From: Robert Goldman @ 2011-03-30 21:44 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Org Mode

On 3/30/11 Mar 30 -4:33 PM, Nick Dokos wrote:
> Robert Goldman <rpgoldman@sift.info> wrote:
> 
>> I would like to do the opposite of literate programming (hence the
>> subject line!):
>>
>> I would like to pull into my org file snippets from a code file.  I know
>> that org-mode will let me import /entire/ source code files.  Is there
>> some way to say "Import the region of this file between these two
>> delimiters?"
>>
>> If not, do you think it would be hard to add this feature?  I already
>> have the snappy name, after all!
>>
> 
> I don't really understand: can't you cut and paste?

Yes, but if I cut and paste the text of the code that I am describing
may change out from under my text.  If I import the code, it stays in
sync (at least when the document is exported).

Honestly, I was tempted to do the literate programming thing with babel,
but was concerned that it might not work well as a multiple-author thing
(I would be writing the document, but someone else might be modifying
the code and might find org-babel confusing).
> 
> And what do you mean that "org-mode will let me import /entire/ source code
> files"? Is this a facility other than insert-file? Or are you talking about
> the #+INCLUDE mechanism?

Yes, I was talking about #+INCLUDE.  I was really wondering if there
mightn't be something like

#+INCLUDE ~/myfile.lisp :from "(defun sample-function" :to "; end
sample-function"

[sorry --- that's word-wrapped to further obscurity.]

cheers,
r

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

* Re: Re: Illiterate programming question
  2011-03-30 21:44   ` Robert Goldman
@ 2011-03-30 22:38     ` chris.m.malone
  2011-03-30 22:45     ` Sébastien Vauban
  2011-03-30 22:52     ` Eric Schulte
  2 siblings, 0 replies; 13+ messages in thread
From: chris.m.malone @ 2011-03-30 22:38 UTC (permalink / raw)
  To: Robert Goldman; +Cc: nicholas.dokos, Org Mode

[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]

You could probably hack something up with a shell source code block that  
uses sed to find and display text between two delimiters, and then dump the  
results to the org-mode file.

On Mar 30, 2011 5:44pm, Robert Goldman <rpgoldman@sift.info> wrote:
> On 3/30/11 Mar 30 -4:33 PM, Nick Dokos wrote:

> > Robert Goldman rpgoldman@sift.info> wrote:

> >

> >> I would like to do the opposite of literate programming (hence the

> >> subject line!):

> >>

> >> I would like to pull into my org file snippets from a code file. I know

> >> that org-mode will let me import /entire/ source code files. Is there

> >> some way to say "Import the region of this file between these two

> >> delimiters?"

> >>

> >> If not, do you think it would be hard to add this feature? I already

> >> have the snappy name, after all!

> >>

> >

> > I don't really understand: can't you cut and paste?



> Yes, but if I cut and paste the text of the code that I am describing

> may change out from under my text. If I import the code, it stays in

> sync (at least when the document is exported).



> Honestly, I was tempted to do the literate programming thing with babel,

> but was concerned that it might not work well as a multiple-author thing

> (I would be writing the document, but someone else might be modifying

> the code and might find org-babel confusing).

> >

> > And what do you mean that "org-mode will let me import /entire/ source  
> code

> > files"? Is this a facility other than insert-file? Or are you talking  
> about

> > the #+INCLUDE mechanism?



> Yes, I was talking about #+INCLUDE. I was really wondering if there

> mightn't be something like



> #+INCLUDE ~/myfile.lisp :from "(defun sample-function" :to "; end

> sample-function"



> [sorry --- that's word-wrapped to further obscurity.]



> cheers,

> r




[-- Attachment #2: Type: text/html, Size: 2747 bytes --]

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

* Re: Illiterate programming question
  2011-03-30 21:44   ` Robert Goldman
  2011-03-30 22:38     ` chris.m.malone
@ 2011-03-30 22:45     ` Sébastien Vauban
  2011-03-30 22:52     ` Eric Schulte
  2 siblings, 0 replies; 13+ messages in thread
From: Sébastien Vauban @ 2011-03-30 22:45 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Robert,

Robert Goldman wrote:
> On 3/30/11 Mar 30 -4:33 PM, Nick Dokos wrote:
>> Robert Goldman <rpgoldman-+bU95EEGNjthl2p70BpVqQ@public.gmane.org> wrote:
>> 
>>> I would like to do the opposite of literate programming (hence the
>>> subject line!):
>>>
>>> I would like to pull into my org file snippets from a code file.  I know
>>> that org-mode will let me import /entire/ source code files.  Is there
>>> some way to say "Import the region of this file between these two
>>> delimiters?"
>>>
>>> If not, do you think it would be hard to add this feature?  I already
>>> have the snappy name, after all!
>> 
>> I don't really understand: can't you cut and paste?
>
> Yes, but if I cut and paste the text of the code that I am describing
> may change out from under my text.  If I import the code, it stays in
> sync (at least when the document is exported).
>
> Honestly, I was tempted to do the literate programming thing with babel,
> but was concerned that it might not work well as a multiple-author thing
> (I would be writing the document, but someone else might be modifying
> the code and might find org-babel confusing).

Not a problem: your colleagues edit the tangled file, and you untangle it on
demand (iff delimiter comments haven't been touched).

Best regards,
  Seb

-- 
Sébastien Vauban

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

* Re: Illiterate programming question
  2011-03-30 21:44   ` Robert Goldman
  2011-03-30 22:38     ` chris.m.malone
  2011-03-30 22:45     ` Sébastien Vauban
@ 2011-03-30 22:52     ` Eric Schulte
  2011-03-31 20:09       ` Sean O'Halpin
  2 siblings, 1 reply; 13+ messages in thread
From: Eric Schulte @ 2011-03-30 22:52 UTC (permalink / raw)
  To: rpgoldman; +Cc: nicholas.dokos, Org Mode

Robert Goldman <rpgoldman@sift.info> writes:

> On 3/30/11 Mar 30 -4:33 PM, Nick Dokos wrote:
>> Robert Goldman <rpgoldman@sift.info> wrote:
>> 
>>> I would like to do the opposite of literate programming (hence the
>>> subject line!):
>>>
>>> I would like to pull into my org file snippets from a code file.  I know
>>> that org-mode will let me import /entire/ source code files.  Is there
>>> some way to say "Import the region of this file between these two
>>> delimiters?"
>>>
>>> If not, do you think it would be hard to add this feature?  I already
>>> have the snappy name, after all!
>>>
>> 
>> I don't really understand: can't you cut and paste?
>
> Yes, but if I cut and paste the text of the code that I am describing
> may change out from under my text.  If I import the code, it stays in
> sync (at least when the document is exported).
>

Babel does have a way to bring changes back from pure source code into
code blocks in an Org-mode document.  While it isn't perfect (especially
if you make extensive use of noweb references or variables) there are
mechanisms to maintain such a /sync/.  To try this out, tangle out code
with the ":comments yes" header argument, then change an element of the
tangled source code, and use the `org-babel-detangle' function to bring
the changes back into the Org-mode document.

Improving the detangling (or "illiterate") features is an area ripe for
future Babel development.

Cheers -- Eric

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

* Re: Illiterate programming question
  2011-03-30 22:52     ` Eric Schulte
@ 2011-03-31 20:09       ` Sean O'Halpin
  2011-03-31 20:13         ` Nick Dokos
  0 siblings, 1 reply; 13+ messages in thread
From: Sean O'Halpin @ 2011-03-31 20:09 UTC (permalink / raw)
  To: Eric Schulte; +Cc: nicholas.dokos, Org Mode, rpgoldman

On Wed, Mar 30, 2011 at 11:52 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
> Babel does have a way to bring changes back from pure source code into
> code blocks in an Org-mode document.  While it isn't perfect (especially
> if you make extensive use of noweb references or variables) there are
> mechanisms to maintain such a /sync/.  To try this out, tangle out code
> with the ":comments yes" header argument, then change an element of the
> tangled source code, and use the `org-babel-detangle' function to bring
> the changes back into the Org-mode document.
>
> Improving the detangling (or "illiterate") features is an area ripe for
> future Babel development.
>
> Cheers -- Eric
>
>
Hi,

Could anyone please give a working example of this? I tried tangling
the following:

   * A tangle example

   #+source: body
   #+begin_src ruby :comments yes :noweb yes
     puts "hello"
   #+end_src

   #+source: method
   #+begin_src ruby :comments yes :noweb yes
     def hello
       <<body>>
     end
   #+end_src

   #+source: main
   #+begin_src ruby :comments yes :tangle detangle.rb :noweb yes
     <<method>>
     hello
   #+end_src

and got the output:

   # [[][main]]

   def hello
     puts "hello"
   end
   hello

   # main ends here

which doesn't look right to me.

Regards,
Sean

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

* Re: Illiterate programming question
  2011-03-31 20:09       ` Sean O'Halpin
@ 2011-03-31 20:13         ` Nick Dokos
  2011-04-01  2:29           ` Sean O'Halpin
  0 siblings, 1 reply; 13+ messages in thread
From: Nick Dokos @ 2011-03-31 20:13 UTC (permalink / raw)
  To: Sean O'Halpin; +Cc: nicholas.dokos, Org Mode, rpgoldman

Sean O'Halpin <sean.ohalpin@gmail.com> wrote:

> On Wed, Mar 30, 2011 at 11:52 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
> > Babel does have a way to bring changes back from pure source code into
> > code blocks in an Org-mode document.  While it isn't perfect (especially
> > if you make extensive use of noweb references or variables) there are
> > mechanisms to maintain such a /sync/.  To try this out, tangle out code
> > with the ":comments yes" header argument, then change an element of the
> > tangled source code, and use the `org-babel-detangle' function to bring
> > the changes back into the Org-mode document.
> >
> > Improving the detangling (or "illiterate") features is an area ripe for
> > future Babel development.
> >
> > Cheers -- Eric
> >
> >
> Hi,
> 
> Could anyone please give a working example of this? I tried tangling
> the following:
> 
>    * A tangle example
> 
>    #+source: body
>    #+begin_src ruby :comments yes :noweb yes
>      puts "hello"
>    #+end_src
> 
>    #+source: method
>    #+begin_src ruby :comments yes :noweb yes
>      def hello
>        <<body>>
>      end
>    #+end_src
> 
>    #+source: main
>    #+begin_src ruby :comments yes :tangle detangle.rb :noweb yes
>      <<method>>
>      hello
>    #+end_src
> 
> and got the output:
> 
>    # [[][main]]
> 
>    def hello
>      puts "hello"
>    end
>    hello
> 
>    # main ends here
> 
> which doesn't look right to me.
> 

What should it look like?

Nick

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

* Re: Illiterate programming question
  2011-03-31 20:13         ` Nick Dokos
@ 2011-04-01  2:29           ` Sean O'Halpin
  2011-04-01  5:46             ` Nick Dokos
  0 siblings, 1 reply; 13+ messages in thread
From: Sean O'Halpin @ 2011-04-01  2:29 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Org Mode, rpgoldman

On Thu, Mar 31, 2011 at 9:13 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> Sean O'Halpin <sean.ohalpin@gmail.com> wrote:
>
>> On Wed, Mar 30, 2011 at 11:52 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
>> > Babel does have a way to bring changes back from pure source code into
>> > code blocks in an Org-mode document.  While it isn't perfect (especially
>> > if you make extensive use of noweb references or variables) there are
>> > mechanisms to maintain such a /sync/.  To try this out, tangle out code
>> > with the ":comments yes" header argument, then change an element of the
>> > tangled source code, and use the `org-babel-detangle' function to bring
>> > the changes back into the Org-mode document.
>> >
>> > Improving the detangling (or "illiterate") features is an area ripe for
>> > future Babel development.
>> >
>> > Cheers -- Eric
>> >
>> >
>> Hi,
>>
>> Could anyone please give a working example of this? I tried tangling
>> the following:
>>
>>    * A tangle example
>>
>>    #+source: body
>>    #+begin_src ruby :comments yes :noweb yes
>>      puts "hello"
>>    #+end_src
>>
>>    #+source: method
>>    #+begin_src ruby :comments yes :noweb yes
>>      def hello
>>        <<body>>
>>      end
>>    #+end_src
>>
>>    #+source: main
>>    #+begin_src ruby :comments yes :tangle detangle.rb :noweb yes
>>      <<method>>
>>      hello
>>    #+end_src
>>
>> and got the output:
>>
>>    # [[][main]]
>>
>>    def hello
>>      puts "hello"
>>    end
>>    hello
>>
>>    # main ends here
>>
>> which doesn't look right to me.
>>
>
> What should it look like?
>
> Nick
>
To be honest, I don't know what it /should/ look like but I have ':comments yes'
on three sections and get only one link on output, so I can't see how this
would detangle properly.

Also,

    # [[][main]]

is missing the file reference (in the first set of brackets), so it
won't work as a link.

Regards,
Sean

P.S. Apologies again for not replying to all first time.

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

* Re: Illiterate programming question
  2011-04-01  2:29           ` Sean O'Halpin
@ 2011-04-01  5:46             ` Nick Dokos
  2011-04-01 16:41               ` Eric Schulte
  0 siblings, 1 reply; 13+ messages in thread
From: Nick Dokos @ 2011-04-01  5:46 UTC (permalink / raw)
  To: Sean O'Halpin; +Cc: nicholas.dokos, Org Mode, rpgoldman

Sean O'Halpin <sean.ohalpin@gmail.com> wrote:

> On Thu, Mar 31, 2011 at 9:13 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> > Sean O'Halpin <sean.ohalpin@gmail.com> wrote:
> >
> >> On Wed, Mar 30, 2011 at 11:52 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
> >> > Babel does have a way to bring changes back from pure source code into
> >> > code blocks in an Org-mode document.  While it isn't perfect (especially
> >> > if you make extensive use of noweb references or variables) there are
> >> > mechanisms to maintain such a /sync/.  To try this out, tangle out code
> >> > with the ":comments yes" header argument, then change an element of the
> >> > tangled source code, and use the `org-babel-detangle' function to bring
> >> > the changes back into the Org-mode document.
> >> >
> >> > Improving the detangling (or "illiterate") features is an area ripe for
> >> > future Babel development.
> >> >

...example elided...

> >> 
> >> which doesn't look right to me.
> >>
> >
> > What should it look like?
> >
> > Nick
> >
> To be honest, I don't know what it /should/ look like but I have ':comments yes'
> on three sections and get only one link on output, so I can't see how this
> would detangle properly.
> 
> Also,
> 
>     # [[][main]]
> 
> is missing the file reference (in the first set of brackets), so it
> won't work as a link.
> 

Yes, it does look unlikely. I don't know about the other comments (line
numbers, etc.) but at least the link calculation in
org-babel-tangle-collect-blocks is wrong I believe: it uses
org-store-link to supposedly store a link to the current location on the
global org-stored-links stack and then pops it, takes the car of it and
sanitizes text properties of the result: that then becomes the link that
should be stored in the tangled file.

But it seems that org-store-link does not behave this way when called
non-interactively: I get nothing on the global stack. Instead it seems
to *return* the link as a string, which is then just thrown away.

One can argue that org-store-link is wrong to behave this way[fn:1]
but I will let Eric and Carsten fight it out :-)

Nick

Footnotes:

[fn:1] assuming that it *does* behave this way and I am not fooling
myself.

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

* Re: Illiterate programming question
  2011-04-01  5:46             ` Nick Dokos
@ 2011-04-01 16:41               ` Eric Schulte
  2011-04-01 21:11                 ` Sébastien Vauban
  0 siblings, 1 reply; 13+ messages in thread
From: Eric Schulte @ 2011-04-01 16:41 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Org Mode, rpgoldman

Nick Dokos <nicholas.dokos@hp.com> writes:

> Sean O'Halpin <sean.ohalpin@gmail.com> wrote:
>
>> On Thu, Mar 31, 2011 at 9:13 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>> > Sean O'Halpin <sean.ohalpin@gmail.com> wrote:
>> >
>> >> On Wed, Mar 30, 2011 at 11:52 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
>> >> > Babel does have a way to bring changes back from pure source code into
>> >> > code blocks in an Org-mode document.  While it isn't perfect (especially
>> >> > if you make extensive use of noweb references or variables) there are
>> >> > mechanisms to maintain such a /sync/.  To try this out, tangle out code
>> >> > with the ":comments yes" header argument, then change an element of the
>> >> > tangled source code, and use the `org-babel-detangle' function to bring
>> >> > the changes back into the Org-mode document.
>> >> >
>> >> > Improving the detangling (or "illiterate") features is an area ripe for
>> >> > future Babel development.
>> >> >
>
> ...example elided...
>
>> >> 
>> >> which doesn't look right to me.
>> >>
>> >
>> > What should it look like?
>> >
>> > Nick
>> >
>> To be honest, I don't know what it /should/ look like but I have
>> ':comments yes' on three sections and get only one link on output, so
>> I can't see how this would detangle properly.
>> 
>> Also,
>> 
>>     # [[][main]]
>> 
>> is missing the file reference (in the first set of brackets), so it
>> won't work as a link.
>> 
>
> Yes, it does look unlikely. I don't know about the other comments (line
> numbers, etc.) but at least the link calculation in
> org-babel-tangle-collect-blocks is wrong I believe: it uses
> org-store-link to supposedly store a link to the current location on the
> global org-stored-links stack and then pops it, takes the car of it and
> sanitizes text properties of the result: that then becomes the link that
> should be stored in the tangled file.
>
> But it seems that org-store-link does not behave this way when called
> non-interactively: I get nothing on the global stack. Instead it seems
> to *return* the link as a string, which is then just thrown away.
>

This all looks to be correct, thanks for debugging this one.  I've just
pushed up a fix which brings the tangling link-extraction code up to
date with the current version of org-store-link.

The tangled comments should now appear as fully formed links.

However, in testing this I noticed that the code for following these
links form a source code file back into the original org-mode file
(namely `org-babel-tangle-jump-to-org') is not currently working for
some link types (e.g. id: links).

The problem here is that there is no org function for parsing/following
a link which can be called non-interactively.  I'd like to either

1. change org-open-at-point (the function which currently holds all of
   the org-link following logic) so that it returns an object (probably
   the buffer, maybe the buffer and point) holding the information on
   the link target, so that other elisp code can follow org-mode links
   with something like.

   #+begin_src emacs-lisp
     (pop-to-buffer (org-open-link-at-point))
   #+end_src
   
2. or, another option would be to pull the link-parsing logic out of
   org-open-link-at-point into a separate function which could then be
   called by org-open-link-at-point, and by other elisp functions
   wishing to use org-mode links.

I'm not comfortable making either of these changes myself without
Carsten or Bastien giving their OK.

Best -- Eric

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

* Re: Illiterate programming question
  2011-04-01 16:41               ` Eric Schulte
@ 2011-04-01 21:11                 ` Sébastien Vauban
  0 siblings, 0 replies; 13+ messages in thread
From: Sébastien Vauban @ 2011-04-01 21:11 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Eric,

"Eric Schulte" wrote:
> Nick Dokos <nicholas.dokos-VXdhtT5mjnY@public.gmane.org> writes:
>> Sean O'Halpin <sean.ohalpin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> On Thu, Mar 31, 2011 at 9:13 PM, Nick Dokos <nicholas.dokos-VXdhtT5mjnY@public.gmane.org> wrote:
>>> > Sean O'Halpin <sean.ohalpin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> >> which doesn't look right to me.
>>>
>>> To be honest, I don't know what it /should/ look like but I have
>>> ':comments yes' on three sections and get only one link on output, so
>>> I can't see how this would detangle properly.
>>> 
>>> Also,
>>> 
>>>     # [[][main]]
>>> 
>>> is missing the file reference (in the first set of brackets), so it
>>> won't work as a link.
>>
>> Yes, it does look unlikely. I don't know about the other comments (line
>> numbers, etc.) but at least the link calculation in
>> org-babel-tangle-collect-blocks is wrong I believe: it uses
>> org-store-link to supposedly store a link to the current location on the
>> global org-stored-links stack and then pops it, takes the car of it and
>> sanitizes text properties of the result: that then becomes the link that
>> should be stored in the tangled file.
>>
>> But it seems that org-store-link does not behave this way when called
>> non-interactively: I get nothing on the global stack. Instead it seems
>> to *return* the link as a string, which is then just thrown away.
>
> This all looks to be correct, thanks for debugging this one.  I've just
> pushed up a fix which brings the tangling link-extraction code up to
> date with the current version of org-store-link.
>
> The tangled comments should now appear as fully formed links.
>
> However, in testing this I noticed that the code for following these
> links form a source code file back into the original org-mode file
> (namely `org-babel-tangle-jump-to-org') is not currently working for
> some link types (e.g. id: links).
>
> The problem here is that there is no org function for parsing/following
> a link which can be called non-interactively.  I'd like to either
>
> 1. change org-open-at-point (the function which currently holds all of
>    the org-link following logic) so that it returns an object (probably
>    the buffer, maybe the buffer and point) holding the information on
>    the link target, so that other elisp code can follow org-mode links
>    with something like.
>
>    #+begin_src emacs-lisp
>      (pop-to-buffer (org-open-link-at-point))
>    #+end_src
>    
> 2. or, another option would be to pull the link-parsing logic out of
>    org-open-link-at-point into a separate function which could then be
>    called by org-open-link-at-point, and by other elisp functions
>    wishing to use org-mode links.
>
> I'm not comfortable making either of these changes myself without
> Carsten or Bastien giving their OK.

For sure, this is a regression between somewhere around Wed Mar 23 2011 (can
be a couple of days before, would I have passed days without updating Org --
that can't be true?) and now...

--8<---------------cut here---------------start------------->8---
diff --git a/org/css/worg-leuven.css b/org/css/worg-leuven.css
index 0706bc2..970aa78 100755
--- a/org/css/worg-leuven.css
+++ b/org/css/worg-leuven.css
@@ -1,11 +1,11 @@
 
-/* [[id:a69e0323-2643-418b-bf1a-75c7dc53cf74][External-CSS:1]] */
+/* [[][External-CSS:1]] */
--8<---------------cut here---------------end--------------->8---

As you can see, I *had* correct ID comments the last time I tangled the CSS
file. Now, not anymore, with user changes (AFAICT).

Best regards,
  Seb

-- 
Sébastien Vauban

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

end of thread, other threads:[~2011-04-01 21:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-30 20:32 Illiterate programming question Robert Goldman
2011-03-30 21:33 ` Nick Dokos
2011-03-30 21:39   ` Erik Iverson
2011-03-30 21:44   ` Robert Goldman
2011-03-30 22:38     ` chris.m.malone
2011-03-30 22:45     ` Sébastien Vauban
2011-03-30 22:52     ` Eric Schulte
2011-03-31 20:09       ` Sean O'Halpin
2011-03-31 20:13         ` Nick Dokos
2011-04-01  2:29           ` Sean O'Halpin
2011-04-01  5:46             ` Nick Dokos
2011-04-01 16:41               ` Eric Schulte
2011-04-01 21:11                 ` Sébastien Vauban

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).