1 |
;;; listings.el --- AUCTeX style for `listings.sty' |
;;; listings.el --- AUCTeX style for `listings.sty' |
2 |
|
|
3 |
;; Copyright (C) 2004 Free Software Foundation, Inc. |
;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Author: Ralf Angeli <angeli@iwi.uni-sb.de> |
;; Author: Ralf Angeli <angeli@iwi.uni-sb.de> |
6 |
;; Maintainer: auctex-devel@gnu.org |
;; Maintainer: auctex-devel@gnu.org |
49 |
(LaTeX-add-environments |
(LaTeX-add-environments |
50 |
"lstlisting") |
"lstlisting") |
51 |
;; Filling |
;; Filling |
|
(make-local-variable 'LaTeX-verbatim-macros) |
|
|
(add-to-list 'LaTeX-verbatim-macros "lstinline") |
|
52 |
(make-local-variable 'LaTeX-indent-environment-list) |
(make-local-variable 'LaTeX-indent-environment-list) |
53 |
(add-to-list 'LaTeX-indent-environment-list |
(add-to-list 'LaTeX-indent-environment-list |
54 |
'("lstlisting" current-indentation)) |
'("lstlisting" current-indentation)) |
55 |
(make-local-variable 'LaTeX-verbatim-regexp) |
(make-local-variable 'LaTeX-verbatim-regexp) |
56 |
(setq LaTeX-verbatim-regexp (concat LaTeX-verbatim-regexp "\\|lstlisting")) |
(setq LaTeX-verbatim-regexp (concat LaTeX-verbatim-regexp "\\|lstlisting")) |
57 |
|
(add-to-list 'LaTeX-verbatim-environments-local "lstlisting") |
58 |
|
(add-to-list 'LaTeX-verbatim-macros-with-delims-local "lstinline") |
59 |
|
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "lstinline") |
60 |
;; Fontification |
;; Fontification |
61 |
(when (and (featurep 'font-latex) |
(when (and (featurep 'font-latex) |
62 |
(eq TeX-install-font-lock 'font-latex-setup)) |
(eq TeX-install-font-lock 'font-latex-setup)) |
72 |
(add-to-list 'font-latex-match-variable-keywords-local "lstdefinestyle") |
(add-to-list 'font-latex-match-variable-keywords-local "lstdefinestyle") |
73 |
(add-to-list 'font-latex-match-variable-keywords-local "lstset") |
(add-to-list 'font-latex-match-variable-keywords-local "lstset") |
74 |
(font-latex-match-variable-make) |
(font-latex-match-variable-make) |
75 |
(add-to-list 'font-latex-verbatim-environments-local "lstlisting") |
;; For syntactic fontification, e.g. verbatim constructs. |
|
(add-to-list 'font-latex-verbatim-macros-local "lstinline") |
|
|
(add-to-list 'font-latex-verb-like-commands-local "lstinline") |
|
76 |
(font-latex-set-syntactic-keywords) |
(font-latex-set-syntactic-keywords) |
77 |
;; Tell font-lock about the update. |
;; Tell font-lock about the update. |
78 |
(setq font-lock-set-defaults nil) |
(setq font-lock-set-defaults nil) |