LaTeX export: Modify the structure of the listings name option.

The variable `org-export-latex-listings-langs' is now an alist.
This commit is contained in:
Carsten Dominik 2009-08-23 19:11:12 +02:00
parent a48fe32c4c
commit 0a7e8ab221
3 changed files with 37 additions and 18 deletions

View File

@ -1,3 +1,12 @@
2009-08-23 Carsten Dominik <carsten.dominik@gmail.com>
* org-exp.el (org-export-format-source-code-or-example): Deal wit
the new structure of the `org-export-latex-listings-langs'
variable.
* org-latex.el (org-export-latex-listings-langs): Change structure
of the variable from plist to alist.
2009-08-21 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-in-commented-line): New function.

View File

@ -2323,10 +2323,14 @@ INDENT was the original indentation of the block."
(if org-export-latex-listings
(concat
(if lang
(let* ((lang-sym (intern (concat ":" lang)))
(lstlang (or (plist-get org-export-latex-listings-langs
lang-sym)
lang)))
(let*
((lang-sym (intern lang))
(lstlang
(or (cadr
(assq
lang-sym
org-export-latex-listings-langs))
lang)))
(format "\\lstset{language=%s}\n" lstlang))
"")
"\\begin{lstlisting}\n"

View File

@ -318,21 +318,27 @@ for example using customize, or with something like
:type 'boolean)
(defcustom org-export-latex-listings-langs
'(:emacs-lisp "Lisp" :lisp "Lisp"
:c "C" :cc "C++"
:fortran "fortran"
:perl "Perl" :cperl "Perl" :python "Python" :ruby "Ruby"
:html "HTML" :xml "XML"
:tex "TeX" :latex "TeX"
:shell-script "bash"
:gnuplot "Gnuplot"
:ocaml "Caml" :caml "Caml"
:sql "SQL")
"Property list mapping languages to their listing language counterpart.
The key is the major mode symbol, the value is the string that should be
inserted as the language parameter for the listings package."
'((emacs-lisp "Lisp") (lisp "Lisp")
(c "C") (cc "C++")
(fortran "fortran")
(perl "Perl") (cperl "Perl") (python "Python") (ruby "Ruby")
(html "HTML") (xml "XML")
(tex "TeX") (latex "TeX")
(shell-script "bash")
(gnuplot "Gnuplot")
(ocaml "Caml") (caml "Caml")
(sql "SQL"))
"Alist mapping languages to their listing language counterpart.
The key is a symbol, the major mode symbol without the \"-mode\".
The value is the string that should be inserted as the language parameter
for the listings package. If the mode name and the listings name are
the same, the language does not need an entry in this list - but it does not
hurt if it is present."
:group 'org-export-latex
:type 'plist)
:type '(repeat
(list
(symbol :tag "Major mode ")
(string :tag "Listings language"))))
(defcustom org-export-latex-remove-from-headlines
'(:todo nil :priority nil :tags nil)