GNU bug report logs - #9914
24.0.91; htmlfontify.el: Add support for code block fontification on ODT export

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Mon, 31 Oct 2011 09:09:02 UTC

Severity: wishlist

Tags: patch

Found in version 24.0.91

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9914 in the body.
You can then email your comments to 9914 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Mon, 31 Oct 2011 09:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jambunathan K <kjambunathan <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 31 Oct 2011 09:09:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Mon, 31 Oct 2011 14:34:48 +0530
[Message part 1 (text/plain, inline)]
I have added support for exporting of Orgmode files to OpenDocument Text
format. See
http://lists.gnu.org/archive/html/bug-gnu-emacs/2011-10/msg01313.html.

As part of the above work, I have enhanced htmlfontify.el so that Org
babel blocks are fontified in the exported document. 

See the attached README.org for details.

[README.org (text/x-org, attachment)]
[Message part 3 (text/plain, inline)]
The standalone files are bundled in to the htmlfontify.tar.gz for ease
of examination.

[htmlfontify.tar.gz (application/octet-stream, attachment)]
[Message part 5 (text/plain, inline)]
Sample test files:

[test.odt (application/vnd.oasis.opendocument.text, attachment)]
[test.org (text/x-org, attachment)]
[Message part 8 (text/plain, inline)]
Attachments:

[htmlfontify.el (application/emacs-lisp, attachment)]
[htmlfontify.el (application/emacs-lisp, attachment)]
[htmlfontify.el.patch (text/x-patch, attachment)]
[0001-htmlfontify.el-Add-new-output-option-body-text-only.patch (text/x-patch, attachment)]
[0002-htmlfontify.el-Allow-customization-of-begin-and-end-.patch (text/x-patch, attachment)]
[0003-htmlfontify.el-Allow-customization-of-face-to-style-.patch (text/x-patch, attachment)]
[0004-htmlfontify.el-Add-support-for-building-stylesheet-o.patch (text/x-patch, attachment)]
[0005-htmlfontify.el-Add-htmlfontify-string-fix-a-bug-in-f.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Mon, 07 Nov 2011 12:26:01 GMT) Full text and rfc822 format available.

Message #8 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Bastien <bzg <at> altern.org>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: 9914 <at> debbugs.gnu.org
Subject: Re: bug#9914: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Mon, 07 Nov 2011 10:20:03 +0100
Hi Jambunathan,

Jambunathan K <kjambunathan <at> gmail.com> writes:

> As part of the above work, I have enhanced htmlfontify.el so that Org
> babel blocks are fontified in the exported document. 

htmlfontify.el can be part of the contrib/ directory for next Org
release -- but we should document this clearly so that users are not
confused by having two instances of htmlfontify.el in their setup.

Another possibility is to use Drew syntax for enhanced libraries 
and to call it htmlfontify+.el and make your exporter depend on this.

I actually think this would be the best solution.

What do you think?

-- 
 Bastien




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Wed, 25 Jan 2012 10:25:01 GMT) Full text and rfc822 format available.

Message #11 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: 9914 <at> debbugs.gnu.org
Subject: Re: bug#9914: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Wed, 25 Jan 2012 15:53:36 +0530
ODT exporter is now available with regular Emacs builds.

It will be wonderful if someone could review the patches that I had
attached earlier and commit them to trunk.

Jambunathan K.



Jambunathan K <kjambunathan <at> gmail.com> writes:

> I have added support for exporting of Orgmode files to OpenDocument Text
> format. See
> http://lists.gnu.org/archive/html/bug-gnu-emacs/2011-10/msg01313.html.
>
> As part of the above work, I have enhanced htmlfontify.el so that Org
> babel blocks are fontified in the exported document. 
>
> See the attached README.org for details.
>
>
>
> The standalone files are bundled in to the htmlfontify.tar.gz for ease
> of examination.
>
>
>
> Sample test files:
>
>
>
>
> Attachments:




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Wed, 25 Jan 2012 13:45:01 GMT) Full text and rfc822 format available.

Message #14 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: 9914 <at> debbugs.gnu.org
Subject: Re: bug#9914: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Wed, 25 Jan 2012 08:44:10 -0500
> It will be wonderful if someone could review the patches that I had
> attached earlier and commit them to trunk.

Just to be clear and make the job easier for that someone, could you
send them again, or point precisely to the message in which you
sent them?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Wed, 25 Jan 2012 14:51:01 GMT) Full text and rfc822 format available.

Message #17 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Bastien <bzg <at> altern.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Jambunathan K <kjambunathan <at> gmail.com>, 9914 <at> debbugs.gnu.org
Subject: Re: bug#9914: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Wed, 25 Jan 2012 15:50:50 +0100
Hi Stefan and Jambunathan,

Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> It will be wonderful if someone could review the patches that I had
>> attached earlier and commit them to trunk.
>
> Just to be clear and make the job easier for that someone, could you
> send them again, or point precisely to the message in which you
> sent them?

The complete patch is here:
  http://lists.gnu.org/archive/html/bug-gnu-emacs/2011-10/txtgfUjItYpSe.txt

The explanations are here:
  http://lists.gnu.org/archive/html/bug-gnu-emacs/2011-10/msg01314.html

HTH,

-- 
 Bastien




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Mon, 12 Mar 2012 07:13:02 GMT) Full text and rfc822 format available.

Message #20 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Vivek Dasmohapatra <vivek <at> etla.org>
Cc: Jambunathan K <kjambunathan <at> gmail.com>, 9914 <at> debbugs.gnu.org
Subject: Re: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Mon, 12 Mar 2012 14:42:53 +0800
Hi Vivek,

Jambunathan K has written an addition to htmlfontify.  Do you have any
objection to this patch?  See

http://lists.gnu.org/archive/html/bug-gnu-emacs/2011-10/txtgfUjItYpSe.txt

and the rest of the discussion at

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9914


Jambunathan: Could you write a ChangeLog entry for these changes?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Mon, 12 Mar 2012 09:49:01 GMT) Full text and rfc822 format available.

Message #23 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Chong Yidong <cyd <at> gnu.org>
Cc: Vivek Dasmohapatra <vivek <at> etla.org>, 9914 <at> debbugs.gnu.org
Subject: Re: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Mon, 12 Mar 2012 14:48:10 +0530
Thanks Chong.

> Jambunathan: Could you write a ChangeLog entry for these changes?

There are 5 patches.  The patches are generated with "git format-patch"
so the changelogs are embedded within the patch themselves. I had
downloaded htmlfontify separately and put it under local git before
generating the patches.

Vivek

org-odt.el is part of regular Emacs-24.1 pretest builds.  

You will find it convenient to proceed as follows.

0. Put the modified htmlfontify.el in to load-path.

1. Export test.org file to ODT with C-c C-e O (or you can use the
   test.odt file used in the bug report) Open the test.odt with
   LibreOffice, if you need some visual cues on what the patch does.

2. Open the test.odt file in archive-mode or equivalently you can unzip
   it. 

3. Under test.odt/content.xml file you can see the OpenDocument tags
   used for markup.

4. Under test.odt/styles.xml you can see the various style-names (the
   css equivalent) for the various faces.

For some insight in to how these changes in htmlfontify are used,

1. Changes in content.xml is being generated by
   `org-odt-format-source-code-or-example-colored'.

   The main entry point in to htmlfontify library is
   `htmlfontify-string' - Fontification happens line by line as opposed
   to en-bloc.

2. Changes in styles.xml is being generated by
   `org-odt-insert-custom-styles-for-srcblocks'.  An Orgmode file can
   have multiple src blocks of different languages.  So a single export
   of Org file can potentially run multiple htmlfontifys.  As a result
   styles are collected, duplicates eliminated and unique stylenames
   dumped to styles.xml at the end of the export.

I will be happy to provide further clarifications.

Jambunathan K.






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Mon, 12 Mar 2012 09:59:01 GMT) Full text and rfc822 format available.

Message #26 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: Vivek Dasmohapatra <vivek <at> etla.org>, 9914 <at> debbugs.gnu.org
Subject: Re: bug#9914: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Mon, 12 Mar 2012 17:28:19 +0800
Jambunathan K <kjambunathan <at> gmail.com> writes:

> There are 5 patches.  The patches are generated with "git
> format-patch" so the changelogs are embedded within the patch
> themselves. I had downloaded htmlfontify separately and put it under
> local git before generating the patches.

Please attach the entire patch, as a diff against Emacs trunk, including
the ChangeLog.  Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Mon, 12 Mar 2012 10:11:02 GMT) Full text and rfc822 format available.

Message #29 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Chong Yidong <cyd <at> gnu.org>
Cc: Vivek Dasmohapatra <vivek <at> etla.org>, 9914 <at> debbugs.gnu.org
Subject: Re: bug#9914: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Mon, 12 Mar 2012 15:10:08 +0530
Chong Yidong <cyd <at> gnu.org> writes:

> Jambunathan K <kjambunathan <at> gmail.com> writes:
>
>> There are 5 patches.  The patches are generated with "git
>> format-patch" so the changelogs are embedded within the patch
>> themselves. I had downloaded htmlfontify separately and put it under
>> local git before generating the patches.
>
> Please attach the entire patch, as a diff against Emacs trunk, including
> the ChangeLog.  Thanks.

I will let Vivek review the patches first.  He can take the Changelog in
individual patches as a cue.  I will wait for his `preliminary' feedback
before making additional changes.

IMO, he has all the information that is needed to review the patch at
this moment.

The patches should apply cleanly since htmlfontify doesn't change or
hardly changes much.

Jambunathan K.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Mon, 12 Mar 2012 10:11:02 GMT) Full text and rfc822 format available.

Message #32 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Chong Yidong <cyd <at> gnu.org>
Cc: Vivek Dasmohapatra <vivek <at> etla.org>, 9914 <at> debbugs.gnu.org
Subject: Re: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Mon, 12 Mar 2012 15:10:44 +0530
Chong Yidong <cyd <at> gnu.org> writes:

> Hi Vivek,
>
> Jambunathan K has written an addition to htmlfontify.  Do you have any
> objection to this patch?  See
>
> http://lists.gnu.org/archive/html/bug-gnu-emacs/2011-10/txtgfUjItYpSe.txt
>
> and the rest of the discussion at
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9914
>
>
> Jambunathan: Could you write a ChangeLog entry for these changes?

Those are "git format-patches". There is a change description within
each patch units.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Mon, 12 Mar 2012 13:41:01 GMT) Full text and rfc822 format available.

Message #35 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Vivek Dasmohapatra <vivek <at> etla.org>
To: Chong Yidong <cyd <at> gnu.org>
Cc: Jambunathan K <kjambunathan <at> gmail.com>, 9914 <at> debbugs.gnu.org
Subject: Re: 24.0.91; htmlfontify.el: Add support for code block fontification
	on ODT export
Date: Mon, 12 Mar 2012 13:10:38 +0000 (GMT)
On Mon, 12 Mar 2012, Chong Yidong wrote:

> Hi Vivek,
>
> Jambunathan K has written an addition to htmlfontify.  Do you have any
> objection to this patch?  See

No objections in principle... I'll go through the patch(es) and let you
know if I have any feedback.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Tue, 13 Mar 2012 04:06:02 GMT) Full text and rfc822 format available.

Message #38 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Vivek Dasmohapatra <vivek <at> etla.org>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: Chong Yidong <cyd <at> gnu.org>, 9914 <at> debbugs.gnu.org
Subject: Re: bug#9914: 24.0.91; htmlfontify.el: Add support for code block
	fontification on ODT export
Date: Tue, 13 Mar 2012 03:35:35 +0000 (GMT)
This looks reasonable to me, I have only one point to make from an initial
review:

The patches seem to introduce tabs into the code - I believe I only
ever used spaces, and I'd prefer to keep it that way (this is a minor
point: if the project wishes to change the indent style, this should 
be done separately to a feature patchset, just to keep the history sane).

Oh... just noticed - in the fontify-string defun:

    (with-temp-buffer
      (insert string)
      (htmlfontify-buffer)
      (prog1 (buffer-string)
	(setq buffer-modified-p nil)
	(kill-buffer)))))

susect this would be neater as:

    (with-temp-buffer
      (insert string)
      (htmlfontify-buffer)
      (set-buffer-modified-p nil)
      (buffer-string))







Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Tue, 13 Mar 2012 08:34:02 GMT) Full text and rfc822 format available.

Message #41 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Vivek Dasmohapatra <vivek <at> etla.org>
Cc: Chong Yidong <cyd <at> gnu.org>, 9914 <at> debbugs.gnu.org
Subject: Re: bug#9914: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Tue, 13 Mar 2012 13:33:06 +0530
[Message part 1 (text/plain, inline)]
Vivek

Here goes the modified patch.  I have removed stray tabs and fixed
`htmlfontify-string'.

I don't have commit access to Bzr Repository.  So please commit on my
behalf.

Jambunathan K.

[0001-htmlfontify.el-Fix-for-Bug-9914.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Sat, 17 Mar 2012 05:36:02 GMT) Full text and rfc822 format available.

Message #44 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Vivek Dasmohapatra <vivek <at> etla.org>
Cc: Chong Yidong <cyd <at> gnu.org>, 9914 <at> debbugs.gnu.org
Subject: Re: bug#9914: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Sat, 17 Mar 2012 10:35:19 +0530
Vivek

> I don't have commit access to Bzr Repository.  So please commit on my
> behalf.

Do you want any more changes on the patch I circulated earlier?
Otherwise, could you please commit it.

I am feeling uncomfortable about the current state of suspended
animation.

Jambunathan K.






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9914; Package emacs. (Sat, 17 Mar 2012 14:35:01 GMT) Full text and rfc822 format available.

Message #47 received at 9914 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: Vivek Dasmohapatra <vivek <at> etla.org>, 9914 <at> debbugs.gnu.org
Subject: Re: bug#9914: 24.0.91;
	htmlfontify.el: Add support for code block fontification on ODT export
Date: Sat, 17 Mar 2012 22:04:02 +0800
Jambunathan K <kjambunathan <at> gmail.com> writes:

> Here goes the modified patch.  I have removed stray tabs and fixed
> `htmlfontify-string'.
>
> I don't have commit access to Bzr Repository.  So please commit on my
> behalf.

Committed.




bug closed, send any further explanations to 9914 <at> debbugs.gnu.org and Jambunathan K <kjambunathan <at> gmail.com> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 17 Mar 2012 14:35:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 15 Apr 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 36 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.