[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 83306b4 13/35: Add some expl3 support
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 83306b4 13/35: Add some expl3 support |
Date: |
Sun, 22 Mar 2015 09:27:00 +0000 |
branch: externals/auctex
commit 83306b4a02162fc2acb3b4db4b6fe0aa7cf5ccd1
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>
Add some expl3 support
* style/expl3.el: New style for the wrapper package for
experimental LaTeX 3.
* Makefile.in (STYLESRC): Activate new style.
* font-latex.el (font-latex-match-simple-command)
(font-latex-match-command-with-arguments): Use \s_ and \sw regexp
classes instead of hard-coding address@hidden as LaTeX macro chars.
---
ChangeLog | 11 +++++++++++
Makefile.in | 2 +-
font-latex.el | 6 ++++--
style/expl3.el | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 67 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d3ba7df..7a6d03c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-02-24 Tassilo Horn <address@hidden>
+
+ * style/expl3.el: New style for the wrapper package for
+ experimental LaTeX 3.
+
+ * Makefile.in (STYLESRC): Activate new style.
+
+ * font-latex.el (font-latex-match-simple-command)
+ (font-latex-match-command-with-arguments): Use \s_ and \sw regexp
+ classes instead of hard-coding address@hidden as LaTeX macro chars.
+
2015-02-17 Tassilo Horn <address@hidden>
* latex.el (LaTeX-after-insert-env-hook): Rename from
diff --git a/Makefile.in b/Makefile.in
index 7a0851c..9320db2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -144,7 +144,7 @@ STYLESRC = style/prosper.el \
style/fbb.el style/newtxmath.el style/newtxsf.el \
style/newtxtext.el style/newtxttt.el style/minted.el \
style/wrapfig.el style/relsize.el style/currvita.el \
- style/tcolorbox.el style/color.el
+ style/tcolorbox.el style/color.el style/expl3.el
STYLEELC = $(STYLESRC:.el=.elc)
ifeq (@preview_enabled@,yes)
diff --git a/font-latex.el b/font-latex.el
index 0a1b8ad..c2f6536 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1494,7 +1494,8 @@ Returns nil if none of KEYWORDS is found."
(list (point)
(progn
(forward-char)
- (if (zerop (skip-chars-forward "A-Za-z@"))
+ (if (zerop (skip-chars-forward
+ "\\\\\\(?:\\s_\\|\\sw\\)+"))
(forward-char) ; Single-char macro.
(skip-chars-forward "*"))
(point))))
@@ -1634,7 +1635,8 @@ marks boundaries for searching for group ends."
(defun font-latex-match-simple-command (limit)
"Search for command like \\foo before LIMIT."
- (TeX-re-search-forward-unescaped "address@hidden" limit t))
+ ;; \s_ matches chars with symbol syntax, \sw chars with word syntax
+ (TeX-re-search-forward-unescaped "\\\\\\(?:\\s_\\|\\sw\\)+" limit t))
(defun font-latex-match-math-env (limit)
"Match math pattern up to LIMIT.
diff --git a/style/expl3.el b/style/expl3.el
new file mode 100644
index 0000000..6293b87
--- /dev/null
+++ b/style/expl3.el
@@ -0,0 +1,51 @@
+;;; expl3.el --- AUCTeX style for `expl3.sty'
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Tassilo Horn <address@hidden>
+;; Maintainer: address@hidden
+;; Created: 2015-02-22
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING. If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file adds support for `expl3.sty'.
+
+;;; Code:
+
+(defvar LaTeX-expl3-syntax-table
+ (let ((st (copy-syntax-table LaTeX-mode-syntax-table)))
+ ;; Make _ and : symbol chars
+ (modify-syntax-entry ?\_ "_" st)
+ (modify-syntax-entry ?\: "_" st)
+ st))
+
+(TeX-add-style-hook
+ "expl3"
+ (lambda ()
+ (set-syntax-table LaTeX-expl3-syntax-table)
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ ;; For syntactic fontification, e.g. verbatim constructs.
+ (font-latex-set-syntactic-keywords)
+ ;; Tell font-lock about the update.
+ (setq font-lock-set-defaults nil)
+ (font-lock-set-defaults)))
+ LaTeX-dialect)
- [elpa] externals/auctex cef38f9 04/35: Handle TeX-region in backward search with both PDF Tools and Evince, (continued)
- [elpa] externals/auctex cef38f9 04/35: Handle TeX-region in backward search with both PDF Tools and Evince, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 51e3aa8 06/35: Adapt to PDF Tool changes, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 1bc721b 07/35: Fix error introduced in previous commit, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex adf90e9 09/35: Simplify TeX-pdf-tools-sync-view, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex b858aae 10/35: Make TeX-pdf-tools-sync-view work with region files, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex b2957c8 11/35: Fix bug in pdf-tools support, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 86f4a1e 12/35: Add a hook that's run after an environment is modified, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 566426b 08/35: New style for color.sty, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 3cf92fc 14/35: Fix font-locking issue, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 39badf0 15/35: New defcustom LaTeX-fill-excluded-macros, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 83306b4 13/35: Add some expl3 support,
Tassilo Horn <=
- [elpa] externals/auctex 074af82 16/35: Add docs for LaTeX-fill-excluded-macros, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 61ed48c 19/35: Replace add-to-list with pushnew, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 31c42ca 23/35: Indent \[...\] display math as a normal environment., Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 41c5f9a 24/35: Improve error/warning reporting when file cannot be determined., Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 59f9440 26/35: Fix void-function error occuring if cl is not loaded, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 4034de2 21/35: New style for caption.sty., Tassilo Horn, 2015/03/22
- [elpa] externals/auctex a2a4777 25/35: Add TeX-after-TeX-LaTeX-command-finished-hook, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex b853739 17/35: Add uninstall rules to Makefiles., Tassilo Horn, 2015/03/22
- [elpa] externals/auctex d23de0a 18/35: Style for bidibeamer which delegates to beamer, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex a375093 20/35: New style enumitem.el, Tassilo Horn, 2015/03/22