Re: [O] Opening an odt file - problem solved

2012-05-25 Thread Bastien
Hi Jambunathan,

Jambunathan K  writes:

> This fix is back-firing.  I have pushed an updated fix.

Fixed in Org 7.8.11 and Emacs 24.1 branches.

> Note:: nxml-mode is not really needed for ODT export to go through
> [1]. I will remove this dependency for the new exporter (org-e-odt.el)
> but retain it for the current exporter (org-odt.el) [2].

That's good news, thanks.

> [2] I don't want to distrub the stability of org-odt.el in Emacs-24.1
> due to last minute changes.

It was about to happen because Emacs RC will be released this week-end
and I thought I would not have any internet connection between today
noon and tuesday.  But that's okay.

-- 
 Bastien



Re: [O] Opening an odt file - problem solved

2012-05-25 Thread Jambunathan K
Bastien  writes:

> Jambunathan K  writes:
>
>>> Can you fix it?
>>
>> OK.  Fixed in both maint and master.  The exported ODT file will not
>> have multiple XML declrations.
>
> Great, thanks a lot!

This fix is back-firing.  I have pushed an updated fix.

I ignored the following warning
Warning: defvar ignored because
nxml-auto-insert-xml-declaration-flag is let-bound

which leads to the following error while creating a new xml file
File mode specification error: (void-variable
nxml-auto-insert-xml-declaration-flag)

To workaround above issue (i.e., if this fix is not applied for whatever
reasons), make sure you do
M-x load-library RET nxml-mode RET before
starting a ODT export

or add a
(require 'nxml-mode)

to your init file.

Note:: nxml-mode is not really needed for ODT export to go through
[1]. I will remove this dependency for the new exporter (org-e-odt.el)
but retain it for the current exporter (org-odt.el) [2].

Footnotes:

[1] nxml-mode is triggered because of the auto-mode activities on XML
buffer.  The mode chosen by auto-mode would depend upon user
configuration and it is not guaranteed to be nxml-mode in all cases.

[2] I don't want to distrub the stability of org-odt.el in Emacs-24.1
due to last minute changes.



Re: [O] Opening an odt file - problem solved

2012-05-24 Thread Jambunathan K
Jambunathan K  writes:

> I see that there is a bug in nxml-mode.  I file a bug report against
> Emacs sometime soon.  The bug is:
>
> When `nxml-auto-insert-xml-declaration-flag' is on, if one opens a ODT
> file in archive mode and presses RET on say content.xml, an "extra" XML
> declaration is added.  (i.e., Emacs tampers with XML file) This
> shouldn't happen.

So to verify the fix:

1. Unzip ODT file in a shell and then 
2. Do M-x find-file-literally RET content.xml RET
3. Verify that none of the XML files have multiple XML declarations.

-- 



Re: [O] Opening an odt file - problem solved

2012-05-24 Thread Bastien
Jambunathan K  writes:

>> Can you fix it?
>
> OK.  Fixed in both maint and master.  The exported ODT file will not
> have multiple XML declrations.

Great, thanks a lot!

-- 
 Bastien



Re: [O] Opening an odt file - problem solved

2012-05-24 Thread Jambunathan K
Bastien  writes:

> Hi Jambunathan,
>
> Jambunathan K  writes:
>
>>> So if want to be able to open odt files created with orgmode odt
>>> exporter you have to have nxml-auto-insert-xml-declaration-flag set to
>>> nil.
>>
>> Thanks for writing this down.  It seems you aren't insisting on a fix.
>
> I think the fix would be nice to have.
>
> Can you fix it?

OK.  Fixed in both maint and master.  The exported ODT file will not
have multiple XML declrations.

I see that there is a bug in nxml-mode.  I file a bug report against
Emacs sometime soon.  The bug is:

When `nxml-auto-insert-xml-declaration-flag' is on, if one opens a ODT
file in archive mode and presses RET on say content.xml, an "extra" XML
declaration is added.  (i.e., Emacs tampers with XML file) This
shouldn't happen.

> Thanks,



Re: [O] Opening an odt file - problem solved

2012-05-24 Thread Bastien
Hi Jambunathan,

Jambunathan K  writes:

>> So if want to be able to open odt files created with orgmode odt
>> exporter you have to have nxml-auto-insert-xml-declaration-flag set to
>> nil.
>
> Thanks for writing this down.  It seems you aren't insisting on a fix.

I think the fix would be nice to have.

Can you fix it?

Thanks,

-- 
 Bastien



Re: [O] Opening an odt file - problem solved

2012-05-20 Thread Jambunathan K

> So if want to be able to open odt files created with orgmode odt
> exporter you have to have nxml-auto-insert-xml-declaration-flag set to
> nil.

Thanks for writing this down.  It seems you aren't insisting on a fix.
So I will keep things as they are now.
-- 



Re: [O] Opening an odt file - problem solved

2012-05-19 Thread Achim Gratz
itm...@chrikro.net writes:
> After changed it to
> '(nxml-auto-insert-xml-declaration-flag nil)

Good catch.  It would be preferable if that variable was let-bound to
nil in the export functions that write out the templates so that users
can set it to whatever they want in their configuration.

Jambunathan, are you listening?


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada




[O] Opening an odt file - problem solved

2012-05-19 Thread itm...@chrikro.net
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello!

Sharing a solution to a problem I had myself with opening an odt file
after export. I use emacs 23.4 on win7 with orgmode 7.8.03.

I could not open the new exported odt file with word2010 or
libreoffice. Somewhere I found out that content.xml that is inside the
odt file was the faulty part.

Parts of odt file

M Filemode  Length  Date Time  File
- - --    ---    -
  -rw-rw-rw-39  19-May-2012  11:35:06  mimetype
  -rw-rw-rw- 40104  19-May-2012  11:35:06  content.xml
  drwxrwxrwx 0  19-May-2012  11:35:06  Images/
  -rw-rw-rw-  1132  19-May-2012  11:35:04  Images/0001.png
  -rw-rw-rw-  1132  19-May-2012  11:35:06  Images/0002.png
  -rw-rw-rw-  1132  19-May-2012  11:35:06  Images/0003.png
  drwxrwxrwx 0  19-May-2012  11:35:06  meta-inf/
  -rw-rw-rw-   966  19-May-2012  11:35:06  META-INF/manifest.xml
  -rw-rw-rw-   846  19-May-2012  11:35:06  meta.xml
  -rw-rw-rw- 61814  19-May-2012  11:35:06  styles.xml
- - --    ---    -
107165 10 files


The top of content.xml looked like this: