emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] Works around bug in exporting subtree with HTML_CONTAINER_CL


From: T.F. Torrey
Subject: [O] [PATCH] Works around bug in exporting subtree with HTML_CONTAINER_CLASS
Date: Sat, 01 Sep 2012 03:31:06 -0700

Hello all,

When exporting a subtree with an HTML_CONTAINER_CLASS property set,
exporting fails with this error: (error "Before first headline at
position 455 in buffer *temp*") This happens because the system is
trying to apply the class to the parent level, but the exporting of a
subtree doesn't bring the parent level into the temp buffer.

The attached patch modifies org-export-remember-html-container-classes
to ignore the HTML_CONTAINER_CLASS property altogether in these cases.
It would probably be better to apply the designated class to the
container div or perhaps the body, but this change works for me, and I
may be the only one bothered by this.

If it is determined that another fix is more in the spirit of these
files, I will not be offended.

ChangeLog entry: Fix export of subtree with HTML_CONTAINER_CLASS

Modify org-export-remember-html-container-classes to work around problem
when exporting subtree with HTML_CONTAINER_CLASS property.

TINYCHANGE

All the best,
Terry
-- 
T.F. Torrey

diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index c901a88..875bdf8 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -1476,8 +1476,11 @@ the current file."
            "^[ \t]*:HTML_CONTAINER_CLASS:[ \t]+\\(.+\\)$" nil t)
       (setq class (match-string 1))
       (save-excursion
+       (if (re-search-backward "^\\*" (point-min) t)
+           (progn
        (org-back-to-heading t)
        (put-text-property (point-at-bol) (point-at-eol) 'html-container-class 
class)))))
+))
 
 (defvar org-export-format-drawer-function nil
   "Function to be called to format the contents of a drawer.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]