emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* bug: babel: Export of temporary buffers fails
@ 2010-10-02 16:30 Puneeth
  2010-10-02 17:21 ` Eric Schulte
  0 siblings, 1 reply; 10+ messages in thread
From: Puneeth @ 2010-10-02 16:30 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Export of temporary buffers with babel src blocks fails.

Line 118 of ob-exp.el has

(set-buffer (get-file-buffer org-current-export-file))

But the value of org-current-exp-file is nil for a temporary buffer.

The following commit brought in that change.

commit efdf78172d9f7c0070c781d136a9b49a2a56fcc4
Author: Eric Schulte <schulte.eric@gmail.com>
Date:   Sat Sep 18 19:01:49 2010 -0600

    ob-exp: resolving code block parameters in the original file on export

    * lisp/ob-exp.el (org-babel-exp-src-blocks): now switching back to the
      original file before resolving code block parameters to ensure
      headline and buffer wide parameters are taken into consideration
      when only a narrowed portion of the file is exported


HTH,

Puneeth

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

* Re: bug: babel: Export of temporary buffers fails
  2010-10-02 16:30 bug: babel: Export of temporary buffers fails Puneeth
@ 2010-10-02 17:21 ` Eric Schulte
  2010-10-02 19:38   ` Sebastian Rose
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Schulte @ 2010-10-02 17:21 UTC (permalink / raw)
  To: Puneeth; +Cc: emacs-orgmode

Hi Puneeth,

I believe that export is only allowed from buffers visiting files, when
I tried to reproduce your problem exporting from a buffer without a file
name I get the following error message

  (error "Need a file name to be able to export")

which is thrown by org-latex, org-docbook, or org-html on attempted
export.

Unless I'm missing something, it is not a problem that Babel expects
org-current-export-file to have a value.

Best -- Eric

Puneeth <punchagan@gmail.com> writes:

> Hello,
>
> Export of temporary buffers with babel src blocks fails.
>
> Line 118 of ob-exp.el has
>
> (set-buffer (get-file-buffer org-current-export-file))
>
> But the value of org-current-exp-file is nil for a temporary buffer.
>
> The following commit brought in that change.
>
> commit efdf78172d9f7c0070c781d136a9b49a2a56fcc4
> Author: Eric Schulte <schulte.eric@gmail.com>
> Date:   Sat Sep 18 19:01:49 2010 -0600
>
>     ob-exp: resolving code block parameters in the original file on export
>
>     * lisp/ob-exp.el (org-babel-exp-src-blocks): now switching back to the
>       original file before resolving code block parameters to ensure
>       headline and buffer wide parameters are taken into consideration
>       when only a narrowed portion of the file is exported
>
>
> HTH,
>
> Puneeth
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: bug: babel: Export of temporary buffers fails
  2010-10-02 17:21 ` Eric Schulte
@ 2010-10-02 19:38   ` Sebastian Rose
  2010-10-03  3:37     ` Puneeth
  0 siblings, 1 reply; 10+ messages in thread
From: Sebastian Rose @ 2010-10-02 19:38 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

"Eric Schulte" <schulte.eric@gmail.com> writes:
> Hi Puneeth,
>
> I believe that export is only allowed from buffers visiting files, when
> I tried to reproduce your problem exporting from a buffer without a file
> name I get the following error message
>
>   (error "Need a file name to be able to export")
>
> which is thrown by org-latex, org-docbook, or org-html on attempted
> export.
>
> Unless I'm missing something, it is not a problem that Babel expects
> org-current-export-file to have a value.
>
> Best -- Eric
>
> Puneeth <punchagan@gmail.com> writes:
>
>> Hello,
>>
>> Export of temporary buffers with babel src blocks fails.
>>
>> Line 118 of ob-exp.el has
>>
>> (set-buffer (get-file-buffer org-current-export-file))
>>
>> But the value of org-current-exp-file is nil for a temporary buffer.
>>
>> The following commit brought in that change.
>>
>> commit efdf78172d9f7c0070c781d136a9b49a2a56fcc4
>> Author: Eric Schulte <schulte.eric@gmail.com>
>> Date:   Sat Sep 18 19:01:49 2010 -0600
>>
>>     ob-exp: resolving code block parameters in the original file on export
>>
>>     * lisp/ob-exp.el (org-babel-exp-src-blocks): now switching back to the
>>       original file before resolving code block parameters to ensure
>>       headline and buffer wide parameters are taken into consideration
>>       when only a narrowed portion of the file is exported


Usually an Org file NAME.org is exported to NAME.html, NAME.txt and so
forth.


You can still export to a temporary buffer (`A' instead of `a', `H'
instead of `h') ...


HTH


   Sebastian

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

* Re: bug: babel: Export of temporary buffers fails
  2010-10-02 19:38   ` Sebastian Rose
@ 2010-10-03  3:37     ` Puneeth
  2010-10-04 13:13       ` Eric Schulte
  0 siblings, 1 reply; 10+ messages in thread
From: Puneeth @ 2010-10-03  3:37 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: emacs-orgmode

Hi Eric,
>
> You can still export to a temporary buffer (`A' instead of `a', `H'
> instead of `h') ...

Yes. And this fails when there is an org-babel src block in the buffer.

-- Puneeth

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

* Re: bug: babel: Export of temporary buffers fails
  2010-10-03  3:37     ` Puneeth
@ 2010-10-04 13:13       ` Eric Schulte
  2010-10-04 13:59         ` Puneeth
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Schulte @ 2010-10-04 13:13 UTC (permalink / raw)
  To: Puneeth; +Cc: emacs-orgmode

Puneeth <punchagan@gmail.com> writes:

> Hi Eric,
>>
>> You can still export to a temporary buffer (`A' instead of `a', `H'
>> instead of `h') ...
>
> Yes. And this fails when there is an org-babel src block in the buffer.
>
> -- Puneeth

Hi Puneeth,

I've just tried exporting an org-mode buffer containing babel code
blocks to a temporary file using C-c C-e H, and it worked without
problem.  Could you send me an example org-mode file that throws the
error your described?

Thanks -- Eric

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

* Re: bug: babel: Export of temporary buffers fails
  2010-10-04 13:13       ` Eric Schulte
@ 2010-10-04 13:59         ` Puneeth
  2010-10-04 14:39           ` Eric Schulte
  0 siblings, 1 reply; 10+ messages in thread
From: Puneeth @ 2010-10-04 13:59 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

Hi Eric,

On Mon, Oct 4, 2010 at 6:43 PM, Eric Schulte <schulte.eric@gmail.com>
> I've just tried exporting an org-mode buffer containing babel code
> blocks to a temporary file using C-c C-e H, and it worked without
> problem.  Could you send me an example org-mode file that throws the
> error your described?

Have you exported from a temporary buffer? or a buffer visiting a file?

To reproduce the error that I get,

1. Switch to scratch buffer (or a new temporary buffer)
2. M-x org-mode to change the mode to Org-mode
3. Yank the following text into it
-----------------------------------------
* Hello World
  #+begin_src python
  print "Hello, World"
  #+end_src
-----------------------------------------
4. C-c C-e H

You should get the error
set-buffer: Wrong type argument: stringp, nil

HTH,
Puneeth

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

* Re: bug: babel: Export of temporary buffers fails
  2010-10-04 13:59         ` Puneeth
@ 2010-10-04 14:39           ` Eric Schulte
  2010-10-04 15:16             ` Puneeth
  2010-10-04 17:08             ` Hsiu-Khuern Tang
  0 siblings, 2 replies; 10+ messages in thread
From: Eric Schulte @ 2010-10-04 14:39 UTC (permalink / raw)
  To: Puneeth; +Cc: emacs-orgmode

Ok,

Thanks for your persistence in explaining this to me.  I've just pushed
up a change which should fix this issue.

Best -- Eric

Puneeth <punchagan@gmail.com> writes:

> Hi Eric,
>
> On Mon, Oct 4, 2010 at 6:43 PM, Eric Schulte <schulte.eric@gmail.com>
>> I've just tried exporting an org-mode buffer containing babel code
>> blocks to a temporary file using C-c C-e H, and it worked without
>> problem.  Could you send me an example org-mode file that throws the
>> error your described?
>
> Have you exported from a temporary buffer? or a buffer visiting a file?
>
> To reproduce the error that I get,
>
> 1. Switch to scratch buffer (or a new temporary buffer)
> 2. M-x org-mode to change the mode to Org-mode
> 3. Yank the following text into it
> -----------------------------------------
> * Hello World
>   #+begin_src python
>   print "Hello, World"
>   #+end_src
> -----------------------------------------
> 4. C-c C-e H
>
> You should get the error
> set-buffer: Wrong type argument: stringp, nil
>
> HTH,
> Puneeth

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

* Re: bug: babel: Export of temporary buffers fails
  2010-10-04 14:39           ` Eric Schulte
@ 2010-10-04 15:16             ` Puneeth
  2010-10-04 17:08             ` Hsiu-Khuern Tang
  1 sibling, 0 replies; 10+ messages in thread
From: Puneeth @ 2010-10-04 15:16 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

Eric,

On Mon, Oct 4, 2010 at 8:09 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
> Ok,
>
> Thanks for your persistence in explaining this to me.  I've just pushed
> up a change which should fix this issue.

Thanks for the fix. :)

I had my reasons for being persistent. org2blog [a client for posting
to Wordpress from Org-mode] uses temporary buffers when posting
subtrees.

-- Puneeth

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

* Re: bug: babel: Export of temporary buffers fails
  2010-10-04 14:39           ` Eric Schulte
  2010-10-04 15:16             ` Puneeth
@ 2010-10-04 17:08             ` Hsiu-Khuern Tang
  2010-10-05 17:56               ` Eric Schulte
  1 sibling, 1 reply; 10+ messages in thread
From: Hsiu-Khuern Tang @ 2010-10-04 17:08 UTC (permalink / raw)
  To: Eric Schulte, emacs-orgmode

Hi Eric,


Are you also seeing the problem reported at
http://thread.gmane.org/gmane.emacs.orgmode/30855?  I checked out the
latest git version and that problem still exists.


I don't know how closely it is related to the problem in this thread,
but it was caused by the same commit
(efdf78172d9f7c0070c781d136a9b49a2a56fcc4) -- hoping you can shed some
light on this.  Thanks!


-- 
Best,
Hsiu-Khuern.


On Mon, Oct 4, 2010 at 7:39 AM, Eric Schulte <schulte.eric@gmail.com> wrote:
> Ok,
>
> Thanks for your persistence in explaining this to me.  I've just pushed
> up a change which should fix this issue.
>
> Best -- Eric
>
> Puneeth <punchagan@gmail.com> writes:
>
>> Hi Eric,
>>
>> On Mon, Oct 4, 2010 at 6:43 PM, Eric Schulte <schulte.eric@gmail.com>
>>> I've just tried exporting an org-mode buffer containing babel code
>>> blocks to a temporary file using C-c C-e H, and it worked without
>>> problem.  Could you send me an example org-mode file that throws the
>>> error your described?
>>
>> Have you exported from a temporary buffer? or a buffer visiting a file?
>>
>> To reproduce the error that I get,
>>
>> 1. Switch to scratch buffer (or a new temporary buffer)
>> 2. M-x org-mode to change the mode to Org-mode
>> 3. Yank the following text into it
>> -----------------------------------------
>> * Hello World
>>   #+begin_src python
>>   print "Hello, World"
>>   #+end_src
>> -----------------------------------------
>> 4. C-c C-e H
>>
>> You should get the error
>> set-buffer: Wrong type argument: stringp, nil
>>
>> HTH,
>> Puneeth
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

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

* Re: bug: babel: Export of temporary buffers fails
  2010-10-04 17:08             ` Hsiu-Khuern Tang
@ 2010-10-05 17:56               ` Eric Schulte
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Schulte @ 2010-10-05 17:56 UTC (permalink / raw)
  To: Hsiu-Khuern Tang; +Cc: emacs-orgmode

Hi,

This issue is fixed in the "combined-testing" branch of the repository,
I hope to merge that branch into the master branch soon.

If anyone is interested, some of my thoughts on this commit which has
caused these couple of recent problems...  It seems that by using
org-links to find the location of a headline in an Org-mode file during
export I have introduced a handful of little bugs in the export process.
I think these have now been fixed but the fixes are a little bit hacky,
however I think that relying on org-mode links for finding these
headlines is still preferable to implementing a Babel-specific method of
linking back to the original export file.

Best -- Eric

Hsiu-Khuern Tang <tangoh@gmail.com> writes:

> Hi Eric,
>
>
> Are you also seeing the problem reported at
> http://thread.gmane.org/gmane.emacs.orgmode/30855?  I checked out the
> latest git version and that problem still exists.
>
>
> I don't know how closely it is related to the problem in this thread,
> but it was caused by the same commit
> (efdf78172d9f7c0070c781d136a9b49a2a56fcc4) -- hoping you can shed some
> light on this.  Thanks!

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

end of thread, other threads:[~2010-10-05 17:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-02 16:30 bug: babel: Export of temporary buffers fails Puneeth
2010-10-02 17:21 ` Eric Schulte
2010-10-02 19:38   ` Sebastian Rose
2010-10-03  3:37     ` Puneeth
2010-10-04 13:13       ` Eric Schulte
2010-10-04 13:59         ` Puneeth
2010-10-04 14:39           ` Eric Schulte
2010-10-04 15:16             ` Puneeth
2010-10-04 17:08             ` Hsiu-Khuern Tang
2010-10-05 17:56               ` Eric Schulte

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