all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Adaptive filling in comments / highlighting outside them
@ 2003-02-25 13:45 Andrew Ferrier
  2003-02-26  2:09 ` Unknown
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Ferrier @ 2003-02-25 13:45 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-02-26 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-25 13:45 Adaptive filling in comments / highlighting outside them Andrew Ferrier
2003-02-26  2:09 ` Unknown
2003-02-26 14:25   ` Andrew Ferrier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.