emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problem with org-babel-detangle
@ 2016-01-30  0:34 Titus von der Malsburg
  2016-01-31 19:50 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Titus von der Malsburg @ 2016-01-30  0:34 UTC (permalink / raw)
  To: emacs-org list

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


I tangeled the following org-mode file:

  #+BEGIN_SRC R :tangle /tmp/test.R :comments link
  1 + 2
  #+END_SRC
  
  #+BEGIN_SRC R :tangle /tmp/test.R :comments link
  3 + 4
  #+END_SRC

The result was:

  ## [[file:test.org][No\ heading:1]]
  1 + 2
  ## No\ heading:1 ends here
  
  ## [[file:test.org][No\ heading:2]]
  3 + 4
  ## No\ heading:2 ends here

Then I changes “3 + 4” to “3 + 5”, revisited the org buffer, and
executed `org-babel-detangle'.

Expected behavior: The second code block in org file is updated to contain
“3 + 5”.

Actual behaviour: I find myself in a buffer containing test.R, the
cursor is inside the first code block at “1”, the second code block’s
content in the org buffer is highlighted, and I have an edit buffer for
that code block.  The content of the second code block is not updated.

No error message.

Tested with a current development Emacs and the development version of
org-mode.

I think the culprit is `org-babel-tangle-jump-to-org'.  When I call it
in test.R, it does not jump to the org file as it should according to
the documentation.

When I call it with point on the first code block, it opens an edit
buffer for the second code block in the background.

When I call it with point on the second code block, it opens test.org in
the background but doesn’t do anything else.

  Titus


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

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

* Re: Problem with org-babel-detangle
  2016-01-30  0:34 Problem with org-babel-detangle Titus von der Malsburg
@ 2016-01-31 19:50 ` Nicolas Goaziou
  2016-01-31 20:32   ` Titus von der Malsburg
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2016-01-31 19:50 UTC (permalink / raw)
  To: Titus von der Malsburg; +Cc: emacs-org list

Hello,

Titus von der Malsburg <malsburg@posteo.de> writes:

> I tangeled the following org-mode file:
>
>   #+BEGIN_SRC R :tangle /tmp/test.R :comments link
>   1 + 2
>   #+END_SRC
>   
>   #+BEGIN_SRC R :tangle /tmp/test.R :comments link
>   3 + 4
>   #+END_SRC
>
> The result was:
>
>   ## [[file:test.org][No\ heading:1]]
>   1 + 2
>   ## No\ heading:1 ends here
>   
>   ## [[file:test.org][No\ heading:2]]
>   3 + 4
>   ## No\ heading:2 ends here
>
> Then I changes “3 + 4” to “3 + 5”, revisited the org buffer, and
> executed `org-babel-detangle'.
>
> Expected behavior: The second code block in org file is updated to contain
> “3 + 5”.
>
> Actual behaviour: I find myself in a buffer containing test.R, the
> cursor is inside the first code block at “1”, the second code block’s
> content in the org buffer is highlighted, and I have an edit buffer for
> that code block.  The content of the second code block is not updated.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou

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

* Re: Problem with org-babel-detangle
  2016-01-31 19:50 ` Nicolas Goaziou
@ 2016-01-31 20:32   ` Titus von der Malsburg
  2016-02-02 22:29     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Titus von der Malsburg @ 2016-01-31 20:32 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-org list

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


Thanks for looking into it.  Detangling seems to work now but there is
one problem left:

If I open the org-buffer and the tangled files side by side, and then
detangle, both windows show the org-buffer afterwards.  I think
detangling should leave the buffers alone.  Perhaps there is a misplaced
save-excursion somewhere?

Thanks again, Nicolas!

  Titus

On 2016-01-31 Sun 11:50, Nicolas Goaziou wrote:
> Hello,
>
> Titus von der Malsburg <malsburg@posteo.de> writes:
>
>> I tangeled the following org-mode file:
>>
>>   #+BEGIN_SRC R :tangle /tmp/test.R :comments link
>>   1 + 2
>>   #+END_SRC
>>   
>>   #+BEGIN_SRC R :tangle /tmp/test.R :comments link
>>   3 + 4
>>   #+END_SRC
>>
>> The result was:
>>
>>   ## [[file:test.org][No\ heading:1]]
>>   1 + 2
>>   ## No\ heading:1 ends here
>>   
>>   ## [[file:test.org][No\ heading:2]]
>>   3 + 4
>>   ## No\ heading:2 ends here
>>
>> Then I changes “3 + 4” to “3 + 5”, revisited the org buffer, and
>> executed `org-babel-detangle'.
>>
>> Expected behavior: The second code block in org file is updated to contain
>> “3 + 5”.
>>
>> Actual behaviour: I find myself in a buffer containing test.R, the
>> cursor is inside the first code block at “1”, the second code block’s
>> content in the org buffer is highlighted, and I have an edit buffer for
>> that code block.  The content of the second code block is not updated.
>
> Fixed. Thank you.
>
> Regards,


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

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

* Re: Problem with org-babel-detangle
  2016-01-31 20:32   ` Titus von der Malsburg
@ 2016-02-02 22:29     ` Nicolas Goaziou
  2016-02-02 22:37       ` Titus von der Malsburg
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2016-02-02 22:29 UTC (permalink / raw)
  To: Titus von der Malsburg; +Cc: emacs-org list

Hello,

Titus von der Malsburg <malsburg@posteo.de> writes:

> If I open the org-buffer and the tangled files side by side, and then
> detangle, both windows show the org-buffer afterwards.  I think
> detangling should leave the buffers alone.  Perhaps there is a misplaced
> save-excursion somewhere?

I cannot reproduce it, but I assume it comes from your
`org-src-window-setup' setting. For some
reason,`org-babel-tangle-jump-to-org' calls `org-src-switch-to-buffer'.

Regards,

-- 
Nicolas Goaziou

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

* Re: Problem with org-babel-detangle
  2016-02-02 22:29     ` Nicolas Goaziou
@ 2016-02-02 22:37       ` Titus von der Malsburg
  0 siblings, 0 replies; 5+ messages in thread
From: Titus von der Malsburg @ 2016-02-02 22:37 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-org list

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


On 2016-02-02 Tue 14:29, Nicolas Goaziou wrote:
> Hello,
>
> Titus von der Malsburg <malsburg@posteo.de> writes:
>
>> If I open the org-buffer and the tangled files side by side, and then
>> detangle, both windows show the org-buffer afterwards.  I think
>> detangling should leave the buffers alone.  Perhaps there is a misplaced
>> save-excursion somewhere?
>
> I cannot reproduce it, but I assume it comes from your
> `org-src-window-setup' setting.

Hm, I haven’t changed the value of `org-src-window-setup' from its
default (which is `reorganize-frame').  I will look into it.

  Titus

> For some
> reason,`org-babel-tangle-jump-to-org' calls `org-src-switch-to-buffer'.
>
> Regards,


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

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

end of thread, other threads:[~2016-02-02 22:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-30  0:34 Problem with org-babel-detangle Titus von der Malsburg
2016-01-31 19:50 ` Nicolas Goaziou
2016-01-31 20:32   ` Titus von der Malsburg
2016-02-02 22:29     ` Nicolas Goaziou
2016-02-02 22:37       ` Titus von der Malsburg

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