branch: externals/auctex commit cfb6b1fb5bf1d04aae82856ef30f73a83b9d1938 Author: Arash Esbati <ar...@gnu.org> Commit: Arash Esbati <ar...@gnu.org>
Fontify content of comment environment * style/verbatim.el ("verbatim"): Add fontification support for comment environment. Delete unnecessary `function' in the hook. --- style/verbatim.el | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/style/verbatim.el b/style/verbatim.el index 1fb7bdd..8491dfe 100644 --- a/style/verbatim.el +++ b/style/verbatim.el @@ -1,6 +1,6 @@ ;;; verbatim.el --- Style hook for the verbatim package. -;; Copyright (C) 2001 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2020 Free Software Foundation, Inc. ;; Author: Masayuki Ataka <masayuki.at...@gmail.com> ;; Maintainer: auctex-de...@gnu.org @@ -29,13 +29,28 @@ ;;; Code -(TeX-add-style-hook "verbatim" - (function - (lambda () - (LaTeX-add-environments - "comment") - (TeX-add-symbols - '("verbatiminput" TeX-arg-file)))) +(TeX-add-style-hook + "verbatim" + (lambda () + (LaTeX-add-environments + "comment") + (TeX-add-symbols + '("verbatiminput" TeX-arg-file)) + + ;; Fontification: + ;; Code taken from `comment.sty' + (when (and (boundp 'font-latex-syntactic-keywords-extra) + (fboundp 'font-latex-update-font-lock) + (eq TeX-install-font-lock 'font-latex-setup)) + ;; For syntactic fontification. + (add-to-list 'font-latex-syntactic-keywords-extra + '("^[ \t]*\\\\begin *{comment}.*\\(\n\\)" + (1 "!" t))) + (add-to-list 'font-latex-syntactic-keywords-extra + '("^[ \t]*\\(\\\\\\)end *{comment}" + (1 "!" t))) + ;; Tell font-lock about the update. + (font-latex-update-font-lock t))) LaTeX-dialect) (defvar LaTeX-verbatim-package-options nil