help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adaptive filling in comments / highlighting outside them


From: Andrew Ferrier
Subject: Adaptive filling in comments / highlighting outside them
Date: Tue, 25 Feb 2003 13:45:33 +0000 (UTC)
User-agent: slrn/0.9.7.4 (Linux)

I have two comment-related problems:

1. I'm trying to figure out how to do adaptive filling within comments
(an example being Emacs lisp ;; style comments). Does anyone know of a
language-independent way of doing this? I can think that possibly I
could play with the adaptive-fill-function, but I can't think how this
could detect comments in a language-independent way (i.e. portable
between different major modes), without re-writing it significantly for
each major mode.

2. I have some special highlighting for C-style languages (C, Perl,
Java), which highlights items like this:

if (x)
{
        return blah;
}

in red, as I don't like the space between the if and the open
parenthesis. I implement this by adding a regex via
font-lock-add-keywords. Unfortunately, this also matches in comments. Is
there (and I suspect the solution might be related to problem 1) a way
of detecting comments and ignoring these patterns within them? I don't
know that much about the syntax parsing Emacs does for most major modes.
I have researched the above topics and not come up with much. If anyone
could help propose a partial solution, or point me to docs. that might
help, I'd greatly appreciate it.

Regards,
Andrew.

--
Andrew Ferrier
andrew.ferrier@uk.ibm.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]