emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* export ICal without evaluate code block
@ 2014-02-24 22:39 OSiUX
  2014-02-26 14:17 ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: OSiUX @ 2014-02-24 22:39 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi!

Calendar can be exported without evaluating
babel code blocks?

I try setting in .emacs:

  (setq org-confirm-babel-evaluate nil)
  (setq org-export-babel-evaluate nil)

but always evaluate when exports iCalendar :-(

thanks!

Org-mode version 8.2.5h 
(release_8.2.5h-631-g076b8e @ /home/osiris/data/dev/emacs-lisp/org-mode/lisp/)

GNU Emacs 23.4.1
(i486-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-09-09 on murphy, modified by Debian 

-- 

::

  Osiris Alejandro Gomez (OSiUX) osiux@osiux.com.ar
  DC44 95D2 0D5D D544 FC1A F00F B308 A671 9237 D36C
  http://www.osiux.com.ar http://www.altermundi.net

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: export ICal without evaluate code block
  2014-02-24 22:39 export ICal without evaluate code block OSiUX
@ 2014-02-26 14:17 ` Nicolas Goaziou
  2014-02-26 16:06   ` OSiUX
  2014-02-26 20:00   ` Simon Thum
  0 siblings, 2 replies; 10+ messages in thread
From: Nicolas Goaziou @ 2014-02-26 14:17 UTC (permalink / raw)
  To: OSiUX; +Cc: emacs-orgmode

Hello,

OSiUX <xuiso@osiux.com.ar> writes:

> Calendar can be exported without evaluating
> babel code blocks?
>
> I try setting in .emacs:
>
>   (setq org-confirm-babel-evaluate nil)
>   (setq org-export-babel-evaluate nil)
>
> but always evaluate when exports iCalendar :-(

You could use something like this:

  (defun my-toggle-off-babel (backend)
    (when (org-export-derived-backend-p backend 'icalendar)
      (org-set-local 'org-confirm-babel-evaluate nil)
      (org-set-local 'org-export-babel-evaluate nil)))

  (add-hook org-export-before-processing-hook #'my-toggle-off-babel)


Regards,

-- 
Nicolas Goaziou

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

* Re: export ICal without evaluate code block
  2014-02-26 14:17 ` Nicolas Goaziou
@ 2014-02-26 16:06   ` OSiUX
  2014-02-26 16:46     ` Nicolas Goaziou
  2014-02-26 20:00   ` Simon Thum
  1 sibling, 1 reply; 10+ messages in thread
From: OSiUX @ 2014-02-26 16:06 UTC (permalink / raw)
  To: emacs-orgmode

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

El mié, 26 feb 2014, Nicolas Goaziou decía:

> Hello,
>
> OSiUX <xuiso@osiux.com.ar> writes:
>
> > Calendar can be exported without evaluating
> > babel code blocks?
> >
> > I try setting in .emacs:
> >
> >   (setq org-confirm-babel-evaluate nil)
> >   (setq org-export-babel-evaluate nil)
> >
> > but always evaluate when exports iCalendar :-(
>
> You could use something like this:
>
>   (defun my-toggle-off-babel (backend)
>     (when (org-export-derived-backend-p backend 'icalendar)
>       (org-set-local 'org-confirm-babel-evaluate nil)
>       (org-set-local 'org-export-babel-evaluate nil)))
>
>   (add-hook org-export-before-processing-hook #'my-toggle-off-babel)

Thanks Nicolas, your workaround don't work for me:

  Debugger entered--Lisp error:
    (void-variable org-export-before-processing-hook)
    (add-hook org-export-before-processing-hook (function my-toggle-off-babel))

Looking the source I found this commit:

  commit 69ebb265be118ea1a37afb9603c4582d25d33d09
  Author: Bastien Guerry <bzg@altern.org>
  Date:   Wed Apr 10 18:40:47 2013 +0200

      ox-icalendar.el (org-icalendar-export-current-agenda): Do not evaluate babel co$

      * ox-icalendar.el (org-icalendar-export-current-agenda): Do
      not evaluate babel code blocks.

      Thanks to Nicolas for directions about this.

should work with the export current file option
but does not work :-(

--

::

  Osiris Alejandro Gomez (OSiUX) osiux@osiux.com.ar
  DC44 95D2 0D5D D544 FC1A F00F B308 A671 9237 D36C
  http://www.osiux.com.ar http://www.altermundi.net

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: export ICal without evaluate code block
  2014-02-26 16:06   ` OSiUX
@ 2014-02-26 16:46     ` Nicolas Goaziou
  2014-02-26 19:25       ` OSiUX
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2014-02-26 16:46 UTC (permalink / raw)
  To: OSiUX; +Cc: emacs-orgmode

OSiUX <xuiso@osiux.com.ar> writes:

> El mié, 26 feb 2014, Nicolas Goaziou decía:

>> You could use something like this:
>>
>>   (defun my-toggle-off-babel (backend)
>>     (when (org-export-derived-backend-p backend 'icalendar)
>>       (org-set-local 'org-confirm-babel-evaluate nil)
>>       (org-set-local 'org-export-babel-evaluate nil)))
>>
>>   (add-hook org-export-before-processing-hook #'my-toggle-off-babel)
>
> Thanks Nicolas, your workaround don't work for me:
>
>   Debugger entered--Lisp error:
>     (void-variable org-export-before-processing-hook)
>     (add-hook org-export-before-processing-hook (function my-toggle-off-babel))

I forgot a quote:

    (add-hook 'org-export-before-processing-hook #'my-toggle-off-babel))

> Looking the source I found this commit:
>
>   commit 69ebb265be118ea1a37afb9603c4582d25d33d09
>   Author: Bastien Guerry <bzg@altern.org>
>   Date:   Wed Apr 10 18:40:47 2013 +0200
>
>       ox-icalendar.el (org-icalendar-export-current-agenda): Do not evaluate babel co$
>
>       * ox-icalendar.el (org-icalendar-export-current-agenda): Do
>       not evaluate babel code blocks.
>
>       Thanks to Nicolas for directions about this.
>
> should work with the export current file option
> but does not work :-(

No, this patch is about calling icalendar exporter on the agenda.
I guess you are calling it on an Org buffer, which is different.


Regards,

-- 
Nicolas Goaziou

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

* Re: export ICal without evaluate code block
  2014-02-26 16:46     ` Nicolas Goaziou
@ 2014-02-26 19:25       ` OSiUX
  0 siblings, 0 replies; 10+ messages in thread
From: OSiUX @ 2014-02-26 19:25 UTC (permalink / raw)
  To: emacs-orgmode

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

El mié, 26 feb 2014, Nicolas Goaziou decía:

> OSiUX <xuiso@osiux.com.ar> writes:
> 
> > El mié, 26 feb 2014, Nicolas Goaziou decía:
> 
> >> You could use something like this:
> >>
> >>   (defun my-toggle-off-babel (backend)
> >>     (when (org-export-derived-backend-p backend 'icalendar)
> >>       (org-set-local 'org-confirm-babel-evaluate nil)
> >>       (org-set-local 'org-export-babel-evaluate nil)))
> >>
> >>   (add-hook org-export-before-processing-hook #'my-toggle-off-babel)
> >
> > Thanks Nicolas, your workaround don't work for me:
> >
> >   Debugger entered--Lisp error:
> >     (void-variable org-export-before-processing-hook)
> >     (add-hook org-export-before-processing-hook (function my-toggle-off-babel))
> 
> I forgot a quote:
> 
>     (add-hook 'org-export-before-processing-hook #'my-toggle-off-babel))

oops! OK thanks, now it works great!

> > Looking the source I found this commit:
> >
> >   commit 69ebb265be118ea1a37afb9603c4582d25d33d09
> >   Author: Bastien Guerry <bzg@altern.org>
> >   Date:   Wed Apr 10 18:40:47 2013 +0200
> >
> >       ox-icalendar.el (org-icalendar-export-current-agenda): Do not evaluate babel co$
> >
> >       * ox-icalendar.el (org-icalendar-export-current-agenda): Do
> >       not evaluate babel code blocks.
> >
> >       Thanks to Nicolas for directions about this.
> >
> > should work with the export current file option
> > but does not work :-(
> 
> No, this patch is about calling icalendar exporter on the agenda.
> I guess you are calling it on an Org buffer, which is different.

No problem, I use batch mode export:

  ORG -> ICS -> REM -> TXT

https://github.com/osiris/org-bash-utils/blob/master/agenda-ascii

> Regards,

thank you!

-- 

::

  Osiris Alejandro Gomez (OSiUX) osiux@osiux.com.ar
  DC44 95D2 0D5D D544 FC1A F00F B308 A671 9237 D36C
  http://www.osiux.com.ar http://www.altermundi.net

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: export ICal without evaluate code block
  2014-02-26 14:17 ` Nicolas Goaziou
  2014-02-26 16:06   ` OSiUX
@ 2014-02-26 20:00   ` Simon Thum
  2014-02-26 21:21     ` Nicolas Goaziou
  1 sibling, 1 reply; 10+ messages in thread
From: Simon Thum @ 2014-02-26 20:00 UTC (permalink / raw)
  To: Nicolas Goaziou, OSiUX; +Cc: emacs-orgmode

Nicolas,

I recently had a similar problem, though in my case the iClaendar export 
wasn't even reached because emacs started asking in other exports that 
came before.

I have some worries here; Why is it so hard to avoid 
evaluation/modification in org files during export?

I use -batch, I would have tought that was enough, but if I'm getting 
your answer below right, then setting those 2 parameters is not enough 
either, because some backends fiddle with them?

I have searched the docs but did not find anything about backends 
overriding these settings.

Enlightenment is appreciated.

Cheers,

Simon


On 02/26/2014 03:17 PM, Nicolas Goaziou wrote:
> Hello,
>
> OSiUX <xuiso@osiux.com.ar> writes:
>
>> Calendar can be exported without evaluating
>> babel code blocks?
>>
>> I try setting in .emacs:
>>
>>    (setq org-confirm-babel-evaluate nil)
>>    (setq org-export-babel-evaluate nil)
>>
>> but always evaluate when exports iCalendar :-(
>
> You could use something like this:
>
>    (defun my-toggle-off-babel (backend)
>      (when (org-export-derived-backend-p backend 'icalendar)
>        (org-set-local 'org-confirm-babel-evaluate nil)
>        (org-set-local 'org-export-babel-evaluate nil)))
>
>    (add-hook org-export-before-processing-hook #'my-toggle-off-babel)
>
>
> Regards,
>

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

* Re: export ICal without evaluate code block
  2014-02-26 20:00   ` Simon Thum
@ 2014-02-26 21:21     ` Nicolas Goaziou
  2014-03-03 21:02       ` Simon Thum
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2014-02-26 21:21 UTC (permalink / raw)
  To: Simon Thum; +Cc: OSiUX, emacs-orgmode

Hello,

Simon Thum <simon.thum@gmx.de> writes:

> I have some worries here; Why is it so hard to avoid
> evaluation/modification in org files during export?

I don't think it is. There is a single variable to switch in order to
control this: `org-export-babel-evaluate'.

Do you think that it doesn't behave as expected?

> I use -batch, I would have tought that was enough, but if I'm getting
> your answer below right, then setting those 2 parameters is not enough
> either, because some backends fiddle with them?
>
> I have searched the docs but did not find anything about backends
> overriding these settings.

Besides `icalendar' in a very specific configuration (when exporting
a calendar, not a single document) I don't think any back-end overwrites
the previous variable.


Regards,

-- 
Nicolas Goaziou

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

* Re: export ICal without evaluate code block
  2014-02-26 21:21     ` Nicolas Goaziou
@ 2014-03-03 21:02       ` Simon Thum
  2014-03-13 15:42         ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Thum @ 2014-03-03 21:02 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: OSiUX, emacs-orgmode

Greppig org confirms icalendar is likely the only exception. While i 
find this surprising I guess there is a good reason, right?


Cheers,

Simon	

On 02/26/2014 10:21 PM, Nicolas Goaziou wrote:
> Hello,
>
> Simon Thum <simon.thum@gmx.de> writes:
>
>> I have some worries here; Why is it so hard to avoid
>> evaluation/modification in org files during export?
>
> I don't think it is. There is a single variable to switch in order to
> control this: `org-export-babel-evaluate'.
>
> Do you think that it doesn't behave as expected?
>
>> I use -batch, I would have tought that was enough, but if I'm getting
>> your answer below right, then setting those 2 parameters is not enough
>> either, because some backends fiddle with them?
>>
>> I have searched the docs but did not find anything about backends
>> overriding these settings.
>
> Besides `icalendar' in a very specific configuration (when exporting
> a calendar, not a single document) I don't think any back-end overwrites
> the previous variable.
>
>
> Regards,
>

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

* Re: export ICal without evaluate code block
  2014-03-03 21:02       ` Simon Thum
@ 2014-03-13 15:42         ` Bastien
  2014-03-17 15:16           ` Simon Thum
  0 siblings, 1 reply; 10+ messages in thread
From: Bastien @ 2014-03-13 15:42 UTC (permalink / raw)
  To: Simon Thum; +Cc: emacs-orgmode, OSiUX, Nicolas Goaziou

Hi Simon,

Simon Thum <simon.thum@gmx.de> writes:

> Greppig org confirms icalendar is likely the only exception. While i
> find this surprising I guess there is a good reason, right?

The "good" reason is that it's very unlikely for a user to need Babel
evaluation in an org-mode buffer before exporting this buffer to a
.ics file.

But we may as well be wrong, of course.

-- 
 Bastien

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

* Re: export ICal without evaluate code block
  2014-03-13 15:42         ` Bastien
@ 2014-03-17 15:16           ` Simon Thum
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Thum @ 2014-03-17 15:16 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, OSiUX, Nicolas Goaziou

Well, I was kind of shocked because the mails sounded to imply I need to 
switch evaluation off and, supposedly, extra-off-for-ical, too.

In fact that is the default, or so the source code comment reads but I 
have no idea how that works out.

Cheers,

Simon

On 03/13/2014 04:42 PM, Bastien wrote:
> Hi Simon,
>
> Simon Thum <simon.thum@gmx.de> writes:
>
>> Greppig org confirms icalendar is likely the only exception. While i
>> find this surprising I guess there is a good reason, right?
>
> The "good" reason is that it's very unlikely for a user to need Babel
> evaluation in an org-mode buffer before exporting this buffer to a
> .ics file.
>
> But we may as well be wrong, of course.
>

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

end of thread, other threads:[~2014-03-17 15:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-24 22:39 export ICal without evaluate code block OSiUX
2014-02-26 14:17 ` Nicolas Goaziou
2014-02-26 16:06   ` OSiUX
2014-02-26 16:46     ` Nicolas Goaziou
2014-02-26 19:25       ` OSiUX
2014-02-26 20:00   ` Simon Thum
2014-02-26 21:21     ` Nicolas Goaziou
2014-03-03 21:02       ` Simon Thum
2014-03-13 15:42         ` Bastien
2014-03-17 15:16           ` Simon Thum

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