org-e-latex: Ignore empty captions in lstlisting environments

* contrib/lisp/org-e-latex.el (org-e-latex-src-block): Ignore empty
  captions in lstlisting environments.
This commit is contained in:
Nicolas Goaziou 2012-09-13 18:27:39 +02:00
parent a0e3e84edc
commit 7efd61249b
1 changed files with 7 additions and 6 deletions

View File

@ -2096,12 +2096,13 @@ contextual information."
(let ((lst-lang
(or (cadr (assq (intern lang) org-e-latex-listings-langs)) lang))
(caption-str
(when caption
(let ((main (org-export-get-caption src-block))
(secondary (org-export-get-caption src-block t)))
(if (not secondary) (format "{%s}" (org-export-data main info))
(format "{[%s]%s}"
(org-export-data secondary info)
(org-export-data main info))))))
(org-export-data main info)))))))
(concat
;; Options.
(format "\\lstset{%s}\n"