* [PATCH] Works around bug in exporting subtree with HTML_CONTAINER_CLASS
@ 2012-09-01 10:31 T.F. Torrey
2012-09-02 11:10 ` Bastien
0 siblings, 1 reply; 2+ messages in thread
From: T.F. Torrey @ 2012-09-01 10:31 UTC (permalink / raw
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]
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
[-- Attachment #2: Patch for org-export-remember-html-container-classes --]
[-- Type: text/plain, Size: 569 bytes --]
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.
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Works around bug in exporting subtree with HTML_CONTAINER_CLASS
2012-09-01 10:31 [PATCH] Works around bug in exporting subtree with HTML_CONTAINER_CLASS T.F. Torrey
@ 2012-09-02 11:10 ` Bastien
0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2012-09-02 11:10 UTC (permalink / raw
To: T.F. Torrey; +Cc: emacs-orgmode
Hi Terry,
I applied this patch, thanks for the explanations and the ChangeLog.
Best,
--
Bastien
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-02 11:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-01 10:31 [PATCH] Works around bug in exporting subtree with HTML_CONTAINER_CLASS T.F. Torrey
2012-09-02 11:10 ` Bastien
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.