beamer: completion for \usetheme and \usecolortheme

Reiner Steib <[email protected]>
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>
Hi,

unless there is objection, I intent to commit completion for \usetheme
and \usecolortheme to `style/beamer.el' (TeX-arg-beamer-*theme) and
`latex.el' (the variables `LaTeX-beamer-*themes') tomorrow.  Below
you'll find a draft version (I will convert the defvars into
defcustoms later).

I guess there is no way to create the list of themes via
`TeX-search-files' (the LaTeX files are called beamertheme*.sty and
beamercolortheme*.sty).  Or am I missing something?

(defvar LaTeX-beamer-themes '("Antibes"
			      "Bergen"
                              [...]
			      "Szeged"
			      "Warsaw"
			      "boxes"
			      "default")
  "Beamer themes.")

(defvar LaTeX-beamer-colorthemes '("albatross"
				   "beetle"
                                   [...]
				   "structure"
				   "whale")
  "Beamer color themes.")

(defun TeX-arg-beamer-theme (optional &optional prompt)
  "Prompt for beamer theme with completion."
  (TeX-argument-insert
   (completing-read
    (TeX-argument-prompt optional prompt "Theme")
    (mapcar 'list LaTeX-beamer-themes)
    nil nil nil)
   optional))

(defun TeX-arg-beamer-colortheme (optional &optional prompt)
  "Prompt for beamer color theme with completion."
  (TeX-argument-insert
   (completing-read
    (TeX-argument-prompt optional prompt "Theme")
    (mapcar 'list LaTeX-beamer-colorthemes)
    nil nil nil)
   optional))

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.