From: Harald Hanche-Olsen <hanche@math.ntnu.no>
To: help-gnu-emacs@gnu.org
Subject: Fontifying latex.ltx
Date: Mon, 17 Jan 2011 01:06:23 +0100 [thread overview]
Message-ID: <pcooc7gl7gg.fsf@math.ntnu.no> (raw)
Whenever I visit latex.ltx, I encounter two rather annoying problems
with the resulting fontification via font-lock-mode:
1. In the definition \def\verb{...,
everything from there to the end of the buffer is fontified as if it
were the argument of \verb. (Sometimes only up to the next left curly
brace.)
2. A bit later, a macro definition includes a single dollar sign:
\def\@argarraycr[#1]{%
\ifnum0=`{\fi}${}\ifdim #1>\z@ \@xargarraycr{#1}\else
\@yargarraycr{#1}\fi}
and so the rest of the file is fontified as math (in those cases
where #1 does not affect the rest of the file, or when I have
cured #1 by the method below).
After a bit of experimentation I managed to cure #1 by doing this:
(defadvice tex-common-initialization (after nopropertize activate)
(when (string= (file-name-nondirectory (buffer-file-name)) "latex.ltx")
(setq syntax-propertize-function nil)))
To cure #2, I thought I would disable the fontification of math
altogether in latex.ltx. But neither changing the character syntax of
the dollar nor removing the pair
(font-lock-syntactic-face-function . tex-font-lock-syntactic-face-function)
from font-lock-defaults has the slightest effect.
Maybe my approach to this is wrong. Any suggestions?
Followups set to gnu.emacs.help.
--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
when there is no ground whatsoever for supposing it is true.
-- Bertrand Russell
next reply other threads:[~2011-01-17 0:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-17 0:06 Harald Hanche-Olsen [this message]
2011-01-18 4:12 ` Fontifying latex.ltx Stefan Monnier
2011-01-18 7:33 ` Ilya Zakharevich
2011-01-18 19:38 ` Harald Hanche-Olsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pcooc7gl7gg.fsf@math.ntnu.no \
--to=hanche@math.ntnu.no \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).