[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex e6c95e9 78/95: * tests/latex/fontification-verb-
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex e6c95e9 78/95: * tests/latex/fontification-verb-macros.tex: New file. |
Date: |
Sun, 16 Apr 2017 01:27:01 -0400 (EDT) |
branch: externals/auctex
commit e6c95e9ee92d37b3a854ca877b45f72fbe1405c1
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>
* tests/latex/fontification-verb-macros.tex: New file.
---
tests/latex/fontification-verb-macros.tex | 143 ++++++++++++++++++++++++++++++
1 file changed, 143 insertions(+)
diff --git a/tests/latex/fontification-verb-macros.tex
b/tests/latex/fontification-verb-macros.tex
new file mode 100644
index 0000000..519de0a
--- /dev/null
+++ b/tests/latex/fontification-verb-macros.tex
@@ -0,0 +1,143 @@
+\documentclass[a4paper]{article}
+
+\usepackage{minted}
+\usepackage{listings}
+\usepackage{fancyvrb}
+
+\begin{document}
+
+This is a test document for fontification support of verbatim
+\emph{macros} provided by \LaTeX{} and other packages within AUC\TeX.
+As it is not part of \verb|ert|-tests, it does not have an
+\verb|out|-counterpart. Parsing should be enabled when loading this
+file, namely \verb|(setq TeX-parse-self t)| in \verb|.emacs|.
+
+\section{The problem}
+
+The \verb|verb| macro provided by vanilla \LaTeX{} does not receive
+any special fontification within AUC\TeX. It is fontified with
+\verb|font-latex-sedate-face|. Other \verb|verb| macros provided by
+packages like \verb|listings|, \verb|minted| or \verb|fancyvrb| are
+fontified with \verb|font-lock-keyword-face| as they are added to
+\verb|textual| keyword class within \verb|font-latex.el|.
+
+Next issue is that \verb|verb| macros from modern packages take an
+optional argument or even a mandatory argument before the
+\verb|verbatim| content. This issue was not addressed in
+\verb|font-latex.el|.
+
+\section{The solution}
+
+\subsection{Vanilla \LaTeX}
+
+The issue with fontification of \verb|verb| macro is solved in
+\verb|font-latex.el| by adding \verb|("verb" "*")| to
+\verb|`font-latex-built-in-keyword-classes'|. This construct
+fontifies only the macro itself---the argument is left out for
+syntactic fontification.
+
+\subsection{Optional argument}
+
+This issue can be fixed in \verb|font-latex.el| by extending the
+regexp for \verb|verb| macros with delimiters/braces in
+\verb|`font-latex-set-syntactic-keywords'| with:
+\begin{quote}
+ \verb|"\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"|
+\end{quote}
+The same line is used for matching optional arguments in verbatim
+environments.
+
+\section{The result}
+
+\subsection{Vanilla \LaTeX}
+
+Some text \verb|verb input|, % comment
+$a+b$ and \verb*"verb input" % comment
+
+\subsection{listings package}
+
+Some text \lstinline|verb input with delims|, % comment
+$a+b$ \lstinline[showspaces,basicstyle=\ttfamily]/verb input with delims/, %
comment
+%
+\lstinline[%
+basicstyle=\sffamily]!multiline in opt. arg!, % comment
+%
+\lstinline[%
+basicstyle=\sffamily
+]-multiline in opt. arg- % comment
+
+Some text \lstinline{verb input with braces}, % comment
+$a+b$ \lstinline[showspaces]{verb input with braces}, % comment
+%
+\lstinline[%
+basicstyle=\sffamily]{multiline in opt. arg}, % comment
+%
+\lstinline[
+basicstyle=\sffamily
+]{multiline in opt. arg} % comment
+
+\subsection{minted package}
+
+Some text \mint{text}|verb input| % comment
+$a+b$ \mint[showspaces]{text}/verb input/ % comment
+Some text \mint[
+showspaces
+]{text}!verb input! % comment
+Some text \mint[showspaces]{%
+ text%
+}+verb input+ % comment
+
+\newmint{text}{showspaces} %
+\text|verb input| and \text[showspaces=false]|verb input| % comment
+
+\newmint[mytext]{text}{showspaces} %
+\mytext|verb input| and \mytext[%
+showspaces=false
+]|verb input| % comment
+
+Some text \mintinline{text}|verb input| % comment
+$a+b$ \mintinline[showspaces]{text}|verb input| % comment
+Some text \mintinline[
+showspaces
+]{text}|verb input| % comment
+Some text \mintinline[showspaces]{%
+ text%
+}|verb input| % comment
+
+\newmintinline{text}{showspaces} %
+\textinline|verb input with delims| and \textinline[%
+showspaces=false
+]|verb input with delims| % comment
+
+\textinline{verb input with braces} and \textinline[%
+showspaces=false
+]{verb input with braces} % comment
+
+\newmintinline[mytextinline]{text}{showspaces} %
+\mytextinline|verb input with delims| and \mytextinline[%
+showspaces=false
+]|verb input with delims|
+
+\mytextinline{verb input with braces} and \mytextinline[%
+showspaces=false
+]{verb input with braces}
+
+\subsection{fancyvrb package}
+
+Some text \Verb|verb input| and % comment
+\Verb[showspaces]|verb input| and \Verb[
+showspaces
+]|verb input|
+
+Some text \Verb!verb input! and % comment
+\Verb[showspaces]"verb input" and \Verb[
+showspaces
+]#verb input#
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% TeX-command-extra-options: "-shell-escape"
+%%% End:
- [elpa] externals/auctex 0cde29b 87/95: ; * tex-ispell.el (TeX-ispell-verb-delimiters): Remove `*'., (continued)
- [elpa] externals/auctex 0cde29b 87/95: ; * tex-ispell.el (TeX-ispell-verb-delimiters): Remove `*'., Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 07a2903 82/95: Don't alter standard value or saved value themselves of customize option, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 194a8f8 62/95: Add LaTeX inline math delimiters to Ispell skip list, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 7390999 61/95: ; Simplify insertion of a newline after label, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 6a298a8 47/95: Fix documents and add trivial improvements., Tassilo Horn, 2017/04/16
- [elpa] externals/auctex a286e8b 57/95: Improve parsing capabilities of style/fancyvrb.el, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 11e234b 55/95: Remove spurious entries of view settings., Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 83a875b 83/95: ; * tex.el (TeX-ispell-tex-arg-verb-end): Drop unnecessary `format'., Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 2116248 94/95: * doc/changes.texi: Update with recent changes., Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 65e56e1 93/95: ; Make sure that `regex-opt' builds a shy group., Tassilo Horn, 2017/04/16
- [elpa] externals/auctex e6c95e9 78/95: * tests/latex/fontification-verb-macros.tex: New file.,
Tassilo Horn <=
- [elpa] externals/auctex a8dba19 60/95: Fix addition of key=val's, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 4688310 65/95: Add new compat function `TeX-replace-regexp-in-string', Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 6b5a7e0 56/95: Improve fallback for indentation when & is omitted, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 592297d 64/95: Avoid altering user option as much as possible, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 7a382d2 72/95: * texmathp.el (texmathp-tex-commands-default): Add entries for empheq.sty., Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 2fef12e 80/95: ; Clear out byte compile warning, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 51d8d3d 75/95: Recognize optional argument in verb macros with delimiters/braces, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex d5951e6 79/95: Improve skipping of inline verbatim macros, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex a45821b 92/95: ; * latex.el (LaTeX-section-list-add-locally): Fix doc string., Tassilo Horn, 2017/04/16
- [elpa] externals/auctex d82f66c 91/95: ; * style/paracol.el (TeX-arg-paracol-switchcolumn*): Guard point movement., Tassilo Horn, 2017/04/16