Commit 45fd731c authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-1): Highlight not only

$$..$$ but also $..$ using regexps.
Use tex-verbatim for \url and \path.
(tex-font-lock-keywords): Define as defconst like the others.
(tex-common-initialization): Don't use font-lock-syntax-table any more.
* test/indent/latex-mode.tex: New file.

Fixes: debbugs:11953
parent 9ea10cc3
2012-07-17 Stefan Monnier <monnier@iro.umontreal.ca>
* textmodes/tex-mode.el (tex-font-lock-keywords-1): Highlight not only
$$..$$ but also $..$ using regexps (bug#11953).
Use tex-verbatim for \url and \path.
(tex-font-lock-keywords): Define as defconst like the others.
(tex-common-initialization): Don't use font-lock-syntax-table any more.
2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
 
* international/mule-cmds.el (ucs-insert): Make it an obsolete
......@@ -14,8 +22,8 @@
Remove vars.
(python-nav-list-defun-positions, python-nav-read-defun)
(python-imenu-tree-assoc, python-imenu-make-element-tree)
(python-imenu-make-tree, python-imenu-create-index): Remove
functions.
(python-imenu-make-tree, python-imenu-create-index):
Remove functions.
(python-mode): Update to interact with imenu by setting
`imenu-extract-index-name-function' only.
 
......@@ -56,8 +64,8 @@
(xterm-mouse-event): New arg specifying mouse protocol.
(turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal): Send DEC 1006
sequence to toggle extended coordinates on newer XTerms. This
appears to be harmless on terminals which do not support this.
sequence to toggle extended coordinates on newer XTerms.
This appears to be harmless on terminals which do not support this.
 
2012-07-14 Leo Liu <sdl.web@gmail.com>
 
......@@ -81,8 +89,8 @@
 
2012-07-14 Chong Yidong <cyd@gnu.org>
 
* bindings.el: Consolidate ctl-x-r-map bindings. Bind
copy-rectangle-as-kill to C-x r w.
* bindings.el: Consolidate ctl-x-r-map bindings.
Bind copy-rectangle-as-kill to C-x r w.
 
* rect.el, register.el: Move bindings to bindings.el.
 
......@@ -123,8 +131,8 @@
Remove toggle-read-only.
 
* bs.el (bs-toggle-readonly):
* buff-menu.el (Buffer-menu-toggle-read-only): Remove
with-no-warnings around toggle-read-only.
* buff-menu.el (Buffer-menu-toggle-read-only):
Remove with-no-warnings around toggle-read-only.
 
* ffap.el (ffap--toggle-read-only): Accept a list of buffers.
Remove with-no-warnings around toggle-read-only.
......
......@@ -476,46 +476,51 @@ An alternative value is \" . \", if you use a font with a narrow period."
'("input" "include" "includeonly" "bibliography"
"epsfig" "psfig" "epsf" "nofiles" "usepackage"
"documentstyle" "documentclass" "verbatiminput"
"includegraphics" "includegraphics*"
"url" "nolinkurl")
"includegraphics" "includegraphics*")
t))
(verbish (regexp-opt '("url" "nolinkurl" "path") t))
;; Miscellany.
(slash "\\\\")
(opt " *\\(\\[[^]]*\\] *\\)*")
;; This would allow highlighting \newcommand\CMD but requires
;; adapting subgroup numbers below.
;; (arg "\\(?:{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)\\|\\\\[a-z*]+\\)"))
(arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"))
(list
;; display $$ math $$
;; We only mark the match between $$ and $$ because the $$ delimiters
;; themselves have already been marked (along with $..$) by syntactic
;; fontification. Also this is done at the very beginning so as to
;; interact with the other keywords in the same way as $...$ does.
(list "\\$\\$\\([^$]+\\)\\$\\$" 1 'tex-math-face)
;; Heading args.
(list (concat slash headings "\\*?" opt arg)
;; If ARG ends up matching too much (if the {} don't match, e.g.)
;; jit-lock will do funny things: when updating the buffer
;; the re-highlighting is only done locally so it will just
;; match the local line, but defer-contextually will
;; match more lines at a time, so ARG will end up matching
;; a lot more, which might suddenly include a comment
;; so you get things highlighted bold when you type them
;; but they get turned back to normal a little while later
;; because "there's already a face there".
;; Using `keep' works around this un-intuitive behavior as well
;; as improves the behavior in the very rare case where you do
;; have a comment in ARG.
3 'font-lock-function-name-face 'keep)
(list (concat slash "\\(?:provide\\|\\(?:re\\)?new\\)command\\** *\\(\\\\[A-Za-z@]+\\)")
1 'font-lock-function-name-face 'keep)
;; Variable args.
(list (concat slash variables " *" arg) 2 'font-lock-variable-name-face)
;; Include args.
(list (concat slash includes opt arg) 3 'font-lock-builtin-face)
;; Definitions. I think.
'("^[ \t]*\\\\def *\\\\\\(\\(\\w\\|@\\)+\\)"
(inbraces-re (lambda (re)
(concat "\\(?:[^{}\\]\\|\\\\.\\|" re "\\)")))
(arg (concat "{\\(" (funcall inbraces-re "{[^}]*}") "+\\)")))
`( ;; Highlight $$math$$ and $math$.
;; This is done at the very beginning so as to interact with the other
;; keywords in the same way as comments and strings.
(,(concat "\\$\\$?\\(?:[^$\\{}]\\|\\\\.\\|{"
(funcall inbraces-re
(concat "{" (funcall inbraces-re "{[^}]*}") "*}"))
"*}\\)+\\$?\\$")
(0 tex-math-face))
;; Heading args.
(,(concat slash headings "\\*?" opt arg)
;; If ARG ends up matching too much (if the {} don't match, e.g.)
;; jit-lock will do funny things: when updating the buffer
;; the re-highlighting is only done locally so it will just
;; match the local line, but defer-contextually will
;; match more lines at a time, so ARG will end up matching
;; a lot more, which might suddenly include a comment
;; so you get things highlighted bold when you type them
;; but they get turned back to normal a little while later
;; because "there's already a face there".
;; Using `keep' works around this un-intuitive behavior as well
;; as improves the behavior in the very rare case where you do
;; have a comment in ARG.
3 font-lock-function-name-face keep)
(,(concat slash "\\(?:provide\\|\\(?:re\\)?new\\)command\\** *\\(\\\\[A-Za-z@]+\\)")
1 font-lock-function-name-face keep)
;; Variable args.
(,(concat slash variables " *" arg) 2 font-lock-variable-name-face)
;; Include args.
(,(concat slash includes opt arg) 3 font-lock-builtin-face)
;; Verbatim-like args.
(,(concat slash verbish opt arg) 3 'tex-verbatim)
;; Definitions. I think.
("^[ \t]*\\\\def *\\\\\\(\\(\\w\\|@\\)+\\)"
1 font-lock-function-name-face))))
"Subdued expressions to highlight in TeX modes.")
......@@ -629,7 +634,7 @@ An alternative value is \" . \", if you use a font with a narrow period."
(1 (tex-font-lock-suscript (match-beginning 0)) append))))
"Experimental expressions to highlight in TeX modes.")
(defvar tex-font-lock-keywords tex-font-lock-keywords-1
(defconst tex-font-lock-keywords tex-font-lock-keywords-1
"Default expressions to highlight in TeX modes.")
(defvar tex-verbatim-environments
......@@ -1219,7 +1224,7 @@ Entering SliTeX mode runs the hook `text-mode-hook', then the hook
(set (make-local-variable 'font-lock-defaults)
'((tex-font-lock-keywords tex-font-lock-keywords-1
tex-font-lock-keywords-2 tex-font-lock-keywords-3)
nil nil ((?$ . "\"")) nil
nil nil nil nil
;; Who ever uses that anyway ???
(font-lock-mark-block-function . mark-paragraph)
(font-lock-syntactic-face-function
......
2012-07-17 Stefan Monnier <monnier@iro.umontreal.ca>
* indent/latex-mode.tex: New file.
2012-07-11 Stefan Monnier <monnier@iro.umontreal.ca>
* eshell.el: Use cl-lib.
......
\documentclass{article} % -*- eval: (bug-reference-mode 1) -*-
\usepackage[utf8]{inputenc}
\begin{document}
To fix this, remove the \url{sn9c102.ko} from where it appears in
\url{/lib/modules/$(uname -r)}, %bug#11953.
and install the appropriate \url{gspca-modules} package.
\end{document}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment