X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/1b589bba5f75a9ff86de6069604006c01b021578..fe623377defcfb3a80ce30b2b4c8f62d9999818f:/packages/auctex/context.el diff --git a/packages/auctex/context.el b/packages/auctex/context.el index f7042a69f..6dff15e59 100644 --- a/packages/auctex/context.el +++ b/packages/auctex/context.el @@ -1,6 +1,7 @@ ;;; context.el --- Support for ConTeXt documents. -;; Copyright (C) 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Free Software +;; Foundation, Inc. ;; Maintainer: Berend de Boer ;; Keywords: tex @@ -51,8 +52,8 @@ (require 'tex-buf) (require 'tex) -;; need functions like TeX-look-at and LaTeX-split-long-menu -(require 'latex) +(require 'latex) ; for functions like `TeX-look-at' and `LaTeX-split-long-menu' +(require 'plain-tex) ; for `plain-TeX-common-initialization' (defgroup ConTeXt-macro nil "Special support for ConTeXt macros in AUCTeX." @@ -904,10 +905,6 @@ If OPTIONAL, only insert it if not empty, and then use square brackets." (defvar ConTeXt-item-list () "List of macro's considered items.") -(defvar ConTeXt-extra-paragraph-commands - '("crlf" "par") - "List of ConTeXt macros that should have their own line besides the section(-block) commands.") - (defun ConTeXt-paragraph-commands-regexp () "Return a regexp matching macros that should have their own line." (concat @@ -1065,7 +1062,7 @@ An optional fourth (or sixth) element means always replace if t." (defvar ConTeXt-indent-arg 2) (defvar ConTeXt-indent-basic 2) (defvar ConTeXt-indent-item ConTeXt-indent-basic) -(defvar ConTeXt-indent-item-re "\\\\\item\\>") +(defvar ConTeXt-indent-item-re "\\\\\\(item\\|sym\\)\\>") (defvar ConTeXt-indent-syntax-table (make-syntax-table TeX-mode-syntax-table) "Syntax table used while computing indentation.") @@ -1486,7 +1483,7 @@ else. There might be text before point." (defun ConTeXt-expand-options () "Expand options for texexec command." (concat - (let ((engine (nth 4 (assq TeX-engine (TeX-engine-alist))))) + (let ((engine (eval (nth 4 (assq TeX-engine (TeX-engine-alist)))))) (when engine (format "--engine=%s " engine))) (unless (eq ConTeXt-current-interface "en") @@ -1505,10 +1502,16 @@ else. There might be text before point." ;; They are mapped to interface specific variables (defvar ConTeXt-language-variable-list - '(ConTeXt-define-list ConTeXt-setup-list ConTeXt-referencing-list ConTeXt-other-macro-list - ConTeXt-project-structure-list - ConTeXt-section-block-list ConTeXt-section-list - ConTeXt-text ConTeXt-item-list)) + '(ConTeXt-define-list + ConTeXt-setup-list + ConTeXt-referencing-list + ConTeXt-other-macro-list + ConTeXt-project-structure-list + ConTeXt-section-block-list + ConTeXt-section-list + ConTeXt-text + ConTeXt-item-list + ConTeXt-extra-paragraph-commands)) (defcustom ConTeXt-clean-intermediate-suffixes ;; See *suffixes in texutil.pl. @@ -1530,6 +1533,8 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $." :type '(repeat regexp) :group 'TeX-command) +(TeX-abbrev-mode-setup context-mode) + (defun ConTeXt-mode-common-initialization () "Initialization code that is common for all ConTeXt interfaces." ;; `plain-TeX-common-initialization' kills all local variables, but @@ -1541,6 +1546,8 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $." (setq ConTeXt-current-interface save-ConTeXt-current-interface)) (setq major-mode 'context-mode) + (setq local-abbrev-table context-mode-abbrev-table) + ;; Make language specific variables buffer local (dolist (symbol ConTeXt-language-variable-list) (make-variable-buffer-local symbol)) @@ -1550,6 +1557,8 @@ i.e. you do _not_ have to cater for this yourself by adding \\\\' or $." (set symbol (symbol-value (intern (concat (symbol-name symbol) "-" ConTeXt-current-interface))))) + ;; Create certain regular expressions based on language + (setq ConTeXt-indent-item-re (concat "\\\\\\(" (mapconcat 'identity ConTeXt-item-list "\\|") "\\)\\>")) ;; What's the deepest level at we can collapse a document? ;; set only if user has not set it. Need to be set before menu is created.