From 0a7e8ab2217364a300600efcd1f0fda9ac11a5ff Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sun, 23 Aug 2009 19:11:12 +0200 Subject: [PATCH] LaTeX export: Modify the structure of the listings name option. The variable `org-export-latex-listings-langs' is now an alist. --- lisp/ChangeLog | 9 +++++++++ lisp/org-exp.el | 12 ++++++++---- lisp/org-latex.el | 34 ++++++++++++++++++++-------------- 3 files changed, 37 insertions(+), 18 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e86907890..15d914b09 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2009-08-23 Carsten Dominik + + * 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 * org.el (org-in-commented-line): New function. diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 7e77fc54a..a28431d87 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -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" diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 40eb8188b..54bf46ff7 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -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)