diff --git a/context.el b/context.el index 42d1594..882ed83 100644 --- a/context.el +++ b/context.el @@ -1,6 +1,6 @@ ;;; context.el --- Support for ConTeXt documents. -;; Copyright (C) 2003-2006, 2008, 2010, 2012, 2014, 2015 +;; Copyright (C) 2003-2006, 2008, 2010, 2012, 2014-2016 ;; Free Software Foundation, Inc. ;; Maintainer: Berend de Boer @@ -1661,6 +1661,12 @@ Use `ConTeXt-Mark-version' to choose the command." ConTeXt-item-list ConTeXt-extra-paragraph-commands)) +(defconst ConTeXt-dialect :context + "Default dialect for use with function `TeX-add-style-hook' for +argument DIALECT-EXPR when the hook is to be run only on ConTeXt +file, or any mode derived thereof. See variable +`TeX-style-hook-dialect'." ) + (defcustom ConTeXt-clean-intermediate-suffixes ;; See *suffixes in texutil.pl. '("\\.tui" "\\.tup" "\\.ted" "\\.tes" "\\.top" "\\.log" "\\.tmp" "\\.run" @@ -1695,6 +1701,7 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $." (setq major-mode 'context-mode) (setq local-abbrev-table context-mode-abbrev-table) + (set (make-local-variable 'TeX-style-hook-dialect) ConTeXt-dialect) ;; Make language specific variables buffer local (dolist (symbol ConTeXt-language-variable-list) diff --git a/plain-tex.el b/plain-tex.el index 3df6196..dfdc423 100644 --- a/plain-tex.el +++ b/plain-tex.el @@ -1,6 +1,6 @@ ;;; plain-tex.el --- Support for plain TeX documents. -;; Copyright (C) 2010 Free Software Foundation, Inc. +;; Copyright (C) 2010, 2013, 2016 Free Software Foundation, Inc. ;; Maintainer: address@hidden ;; Keywords: tex @@ -103,6 +103,12 @@ Install tool bar if `plain-TeX-enable-toolbar' is non-nil." ;;; The mode +(defconst plain-TeX-dialect :plain-tex + "Default dialect for use with function `TeX-add-style-hook' for +argument DIALECT-EXPR when the hook is to be run only on +plain-TeX file, or any mode derived thereof. See variable +`TeX-style-hook-dialect'." ) + (defcustom plain-TeX-mode-hook nil "A hook run in plain TeX mode buffers." :type 'hook @@ -143,6 +149,7 @@ of plain-TeX-mode-hook." (VirTeX-common-initialization) (set-syntax-table TeX-mode-syntax-table) (setq local-abbrev-table plain-tex-mode-abbrev-table) + (set (make-local-variable 'TeX-style-hook-dialect) plain-TeX-dialect) (setq paragraph-start (concat "\\(^[ \t]*$" diff --git a/tex.el b/tex.el index b70f363..c2c247c 100644 --- a/tex.el +++ b/tex.el @@ -2603,8 +2603,10 @@ For supported dialects, see variables `TeX-style-hook-dialect'.") Supported values are described below: * `:bibtex' for files in BibTeX mode. +* `:context' for files in ConTeXt mode. * `:latex' for files in LaTeX mode, or any mode derived thereof. +* `:plain-tex' for files in plain-TeX mode. * `:texinfo' for Texinfo files. Purpose is notably to prevent non-Texinfo hooks to be run in @@ -2667,6 +2669,6 @@ side effect e.g. on variable `TeX-font-list'.") (load-file el))))) (defconst TeX-style-hook-dialect-weight-alist - '((:latex . 1) (:texinfo . 2) (:bibtex . 4)) + '((:latex . 1) (:texinfo . 2) (:bibtex . 4) (:plain-tex . 8) (:context . 16)) "Association list to map dialects to binary weight, in order to implement dialect sets as bitmaps." )