[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 433b5f9 15/42: Parse package/class option with c
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 433b5f9 15/42: Parse package/class option with comments correctly |
Date: |
Thu, 23 Nov 2017 06:06:10 -0500 (EST) |
branch: externals/auctex
commit 433b5f9ee70411aa09e16b5de855e69c310448f1
Author: Ikumi Keita <address@hidden>
Commit: Ikumi Keita <address@hidden>
Parse package/class option with comments correctly
* latex.el: (LaTeX-auto-class-regexp-list): Replace the regexp for
RequirePackage/LoadClass option with the same one for usepackage.
* tests/latex/latex-test.el: Add test for the change above.
---
latex.el | 4 ++--
tests/latex/latex-test.el | 16 ++++++++++++++++
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/latex.el b/latex.el
index 8dc9fa3..76c15de 100644
--- a/latex.el
+++ b/latex.el
@@ -1530,14 +1530,14 @@ This is necessary since index entries may contain
commands and stuff.")
(defvar LaTeX-auto-class-regexp-list
'(;; \RequirePackage[<options>]{<package>}[<date>]
- ("\\\\Require\\(Package\\)\\(\\[\\([^#\\.%]*?\\)\\]\\)?\
+ ("\\\\Require\\(Package\\)\\(\\[\\([^\]\\]*\\)\\]\\)?\
{\\([^#\\.\n\r]+?\\)}"
(3 4 1) LaTeX-auto-style)
;; \RequirePackageWithOptions{<package>}[<date>],
("\\\\Require\\(Package\\)WithOptions\\(\\){\\([^#\\.\n\r]+?\\)}"
(2 3 1) LaTeX-auto-style)
;; \LoadClass[<options>]{<package>}[<date>]
- ("\\\\Load\\(Class\\)\\(\\[\\([^#\\.%]*?\\)\\]\\)?{\\([^#\\.\n\r]+?\\)}"
+ ("\\\\Load\\(Class\\)\\(\\[\\([^\]\\]*\\)\\]\\)?{\\([^#\\.\n\r]+?\\)}"
(3 4 1) LaTeX-auto-style)
;; \LoadClassWithOptions{<package>}[<date>]
("\\\\Load\\(Class\\)WithOptions\\(\\){\\([^#\\.\n\r]+?\\)}"
diff --git a/tests/latex/latex-test.el b/tests/latex/latex-test.el
index 05ca2c8..a53d48e 100644
--- a/tests/latex/latex-test.el
+++ b/tests/latex/latex-test.el
@@ -165,4 +165,20 @@ last extension is stripped."
(LaTeX-bibliography-list))
'(("../foo-1.bar_2.qux3")))))
+(ert-deftest LaTeX-auto-class-regexp ()
+ "Check parsing optional argument with comment correctly.
+
+Test against RequirePackage."
+ (with-temp-buffer
+ (insert "\\RequirePackage[
+backend=biber % here is a comment
+]{biblatex}
+")
+ (latex-mode)
+ (let ((TeX-parse-self t))
+ (TeX-update-style t))
+ (should (member "biblatex" (TeX-style-list)))
+ (should (LaTeX-provided-package-options-member
+ "biblatex" "backend=biber"))))
+
;;; latex-test.el ends here
- [elpa] externals/auctex updated (c576c01 -> 5f007f1), Tassilo Horn, 2017/11/23
- [elpa] externals/auctex f73ccfe 03/42: * style/amsthm.el ("amsthm"): Use `LaTeX-amsthm-env-label'., Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 8337345 02/42: ; * style/minted.el: Fix header., Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 17d86b5 01/42: Conform to elisp coding convention in context.el, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 90a2c29 06/42: Use #' to quote function names, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex f3180f8 10/42: Fix doc string and indent, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 2ed9d93 09/42: Add %(PDF) when undumped format is used in preview-latex, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 433b5f9 15/42: Parse package/class option with comments correctly,
Tassilo Horn <=
- [elpa] externals/auctex 01224b6 11/42: Add test for my commit on Aug 18, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex bfaa079 14/42: Conform to elisp coding convention, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 075eab7 07/42: Improvements for tex-info.el, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex aaf22a9 08/42: Add new style/arabxetex.el, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex cf0ff70 16/42: Add test for infinite loop, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 9e5e5f6 20/42: ; * tex.el (TeX-doc-backend-alist): Use `TeX-search-files-by-type'., Tassilo Horn, 2017/11/23
- [elpa] externals/auctex b43ec94 04/42: * style/XCharter.el ("XCharter"): Update to package v1.094 from 2017/08/08., Tassilo Horn, 2017/11/23
- [elpa] externals/auctex ff07544 05/42: Delay setting Japanese TeX engine in `japanese-latex-mode', Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 6dcf0e1 18/42: Add a new option for evince compatible viewer., Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 7863f42 13/42: Prevent possible infinite loop, Tassilo Horn, 2017/11/23