Prechádzať zdrojové kódy

ox-latex.el (org-latex-src-block): Fix wrong propagation of labels and captions

* ox-latex.el (org-latex-src-block): Fix wrong propagation of
labels and captions when using the listings environment.

Thanks to Dominik Ernst for reporting this:
http://article.gmane.org/gmane.emacs.orgmode/84932
Bastien Guerry 11 rokov pred
rodič
commit
eaaa5c2e48
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      lisp/ox-latex.el

+ 2 - 2
lisp/ox-latex.el

@@ -2165,8 +2165,8 @@ contextual information."
 	       ((and float (not (assoc "float" org-latex-listings-options)))
 		`(("float" ,org-latex-default-figure-position))))
 	      `(("language" ,lst-lang))
-	      (when label `(("label" ,label)))
-	      (when caption-str `(("caption" ,caption-str)))
+	      (if label `(("label" ,label)) '(("label" " ")))
+	      (if caption-str `(("caption" ,caption-str)) '(("caption" " ")))
 	      (cond ((assoc "numbers" org-latex-listings-options) nil)
 		    ((not num-start) '(("numbers" "none")))
 		    ((zerop num-start) '(("numbers" "left")))