I have defined a custom comment environment (through \usepackage{verbatim}
):
\newenvironment{customComment}[1]
{
\noindent{\textsc{Commented bloc}: #1}}
\comment}
Commented block
{\endcomment}
What I want to do is to highlight the content of the \begin...\end{customComment} either:
- as an already existing environment (
font-lock-comment-face
maybe but haven't found any working example); or - through a complete font/background etc. customization.
Already tried the defvar...
solution from here and (for a similar command this time) this example.
Would be great if you found a solution that only needs editing the .emacs or adding a
.el` (I've got a load of these customComments).
To the extent that the original poster (or anyone else) may be interested in highlighting the text that appears between opening/closing LaTeX codes, below are a few examples. The active ingredient is a regexp
(\\(.\\|\n\\)+?\\)
, which could be something else that is also similar, but would need to effectively do the same thing. The following examples are set up to highlight text appearing between quotation marks that LaTeX artists frown upon, a bold command, an underline and a double underline using a tex package calledulem
, bold and underline, and I threw in a begin/end document example so that the original poster (or anyone else) can combine the examples to make his / her own.NOTE: As the definitions become more complex and tend to overlap other definitions, the order in which they appear may be critical -- i.e., one definition may trump another.