[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex c03ca2c 38/42: Improve style/epigraph.el
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex c03ca2c 38/42: Improve style/epigraph.el |
Date: |
Thu, 23 Nov 2017 06:06:15 -0500 (EST) |
branch: externals/auctex
commit c03ca2c9b12091aa1d62f39f33f230746ab2fd3d
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>
Improve style/epigraph.el
* style/epigraph.el ("epigraph"): Leave point inside first pair of
braces for \epigraph and \qitem.
Use `LaTeX-add-lengths' for skips instead of `TeX-add-symbols'.
Use `TeX-arg-length' instead of `TeX-arg-size' for \dropchapter.
Append qitem macro to `LaTeX-item-regexp'.
Improve fontification.
---
style/epigraph.el | 62 ++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 43 insertions(+), 19 deletions(-)
diff --git a/style/epigraph.el b/style/epigraph.el
index c25b148..1d10c6a 100644
--- a/style/epigraph.el
+++ b/style/epigraph.el
@@ -1,6 +1,6 @@
-;;; epigraph.el --- AUCTeX style for `epigraph.sty'
+;;; epigraph.el --- AUCTeX style for `epigraph.sty' v1.5c
-;; Copyright (C) 2012 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2017 Free Software Foundation, Inc.
;; Author: Mads Jensen <address@hidden>
;; Maintainer: address@hidden
@@ -26,7 +26,7 @@
;;; Commentary:
-;; This file adds support for `epigraph.sty'.
+;; This file adds support for `epigraph.sty' v1.5c from 2009/09/02.
;;; Code:
@@ -34,33 +34,57 @@
"epigraph"
(lambda ()
(TeX-add-symbols
- '("epigraph" t t)
- '("qitem" t t)
- '("epigraphhead" [ "Distance (a number)" ] t)
- '("dropchapter" TeX-arg-size)
- "epigraphwidth"
+ ;; 2.1 The epigraph command
+ '("epigraph" 2)
+ ;; 2.2 The epigraphs environment
+ '("qitem" 2)
+ ;; 2.3 General
"textflush"
"epigraphflush"
"sourceflush"
"epigraphsize"
- "epigraphrule"
- "beforeepigraphskip"
- "afterepigraphskip"
+ ;; 2.4 Epigraphs before chapter headings
+ '("epigraphhead" [ "Distance (a number)" ] t)
+ '("dropchapter" TeX-arg-length)
"undodrop"
- "cleartoevenpage")
+ ;; \cleartoevenpage takes an optional argument. Don't query for
+ ;; it, just insert the macro and leave the rest to the user
+ '("cleartoevenpage" 0))
+ ;; 2.2 The epigraphs environment
(LaTeX-add-environments
'("epigraphs" LaTeX-env-item))
- (add-to-list 'LaTeX-item-list '("epigraphs" . LaTeX-epigraph-qitem))
-
+ ;; The value of these lengths can be changed with \setlength
+ (LaTeX-add-lengths "epigraphwidth" "epigraphrule"
+ "beforeepigraphskip"
+ "afterepigraphskip")
+
+ ;; Append epigraphs to `LaTeX-item-list':
+ (add-to-list 'LaTeX-item-list
+ '("epigraphs" . LaTeX-epigraph-qitem) t)
+
+ ;; Append qitem to `LaTeX-item-regexp':
+ (unless (string-match "qitem" LaTeX-item-regexp)
+ (set (make-local-variable 'LaTeX-item-regexp)
+ (concat
+ LaTeX-item-regexp
+ "\\|"
+ "qitem\\b"))
+ (LaTeX-set-paragraph-start))
+
+ ;; Fontification:
(when (and (featurep 'font-latex)
(eq TeX-install-font-lock 'font-latex-setup))
- (font-latex-add-keywords '(("epigraph" "{{")
- ("qitem" "{{")
- ("dropchapter" "{")
- ("epigraphhead" "{")) 'function)
- (font-latex-add-keywords '("cleartoevenpage") 'warning)))
+ (font-latex-add-keywords '(("epigraph" "{{")
+ ("qitem" "{{")
+ ("epigraphhead" "[{"))
+ 'textual)
+ (font-latex-add-keywords '(("dropchapter" "{")
+ ("undodrop" ""))
+ 'variable)
+ (font-latex-add-keywords '("cleartoevenpage")
+ 'warning)))
LaTeX-dialect)
(defvar LaTeX-epigraph-package-options nil
- [elpa] externals/auctex f0145f4 30/42: Add new function `LaTeX-env-longtable', (continued)
- [elpa] externals/auctex f0145f4 30/42: Add new function `LaTeX-env-longtable', Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 213b705 33/42: Mention the necessity of GNU make, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 842471c 37/42: Give proper argument to `TeX-command-expand', Tassilo Horn, 2017/11/23
- [elpa] externals/auctex b69d894 39/42: * doc/changes.texi: Mention compatibility of preview with GS 9.22., Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 5d6839e 36/42: Add test for the recent change about `TeX-kpathsea-path-delimiter', Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 5f007f1 42/42: Regenerate tex-site.el and docs, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex b20eea0 26/42: Fix Copyright year, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 463ead7 35/42: Document `TeX-view-evince-keep-focus', Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 420ec0e 32/42: Bug fix and code refactoring related to kpathsea, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex ee4cc54 31/42: Add new style/xltabular.el, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex c03ca2c 38/42: Improve style/epigraph.el,
Tassilo Horn <=
- [elpa] externals/auctex 800064f 41/42: Merge branch 'master' into externals/auctex, Tassilo Horn, 2017/11/23