summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-02-10 17:51:06 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2013-02-10 17:51:06 +0100
commitba38de197eb0662d503d6e237c6812cb20dc269f (patch)
treed603448ef6f6d2b3952f6885fbd202bcc0edee31
parent6b7101b910556fccea3a0437551e3e326c7f0948 (diff)
downloadorg-mode-ba38de197eb0662d503d6e237c6812cb20dc269f.tar.gz
ox-latex: Fix behaviour when headline sectionning command is a function
* lisp/ox-latex.el (org-latex-headline): When a function returns a sectionning command, only one placeholder should be required. Thanks to Florian Beck for reporting this.
-rw-r--r--lisp/ox-latex.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index df6c729..5fc57f1 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1420,15 +1420,15 @@ holding contextual information."
;; Section formatting will set two placeholders: one for the
;; title and the other for the contents.
(section-fmt
- (let ((sec (if (and (symbolp (nth 2 class-sectionning))
- (fboundp (nth 2 class-sectionning)))
+ (let ((sec (if (functionp (nth 2 class-sectionning))
(funcall (nth 2 class-sectionning) level numberedp)
(nth (1+ level) class-sectionning))))
(cond
;; No section available for that LEVEL.
((not sec) nil)
- ;; Section format directly returned by a function.
- ((stringp sec) sec)
+ ;; Section format directly returned by a function. Add
+ ;; placeholder for contents.
+ ((stringp sec) (concat sec "\n%s"))
;; (numbered-section . unnumbered-section)
((not (consp (cdr sec)))
(concat (funcall (if numberedp #'car #'cdr) sec) "\n%s"))