all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Getting fill-paragraph to play nice with javadoc-like comments
@ 2008-07-06 12:05 joakim.harsman
  0 siblings, 0 replies; only message in thread
From: joakim.harsman @ 2008-07-06 12:05 UTC (permalink / raw)
  To: help-gnu-emacs

I'm writing a major mode for an APL dialect I use at work. I've gotten
basic font locking to work, and after setting comment-start and
comment-start-skip, comment/uncomment region and fill paragraph also
work.

However, comment blocks often contain javadoc style comments and i
would like fill-paragraph to avoid gluing together lines starting
with such commands.

If I have this (\ instead of javadoc @):

# This is a comment that is long and should be wrapped.
# \arg Description of argument
# \ret Description of return value

M-q gives me:

# This is a comment that is long and
# should be wrapped. \arg Description
# of argument \ret Description of
# return value

But I want:

# This is a comment that is long and
# should be wrapped.
# \arg Description of argument
# \ret Description of return value

I've tried setting up paragraph-start and paragraph-separate to
appropriate values, but fill-paragraph still doesn't work inside a
comment block. If I remove the comment markers, M-q works as I want
to, so the regexp I use for paragraph-start seems to work.

Any ideas? Do I have to write a custom fill-paragraph for my major
mode? cc-mode has one that handles cases like this, but it's really
complex, I'd like to avoid it if possible.

I also tried setting fill-nobreak-predicate to an appropriate
function, but that didn't seem to have any effect at all.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-06 12:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-06 12:05 Getting fill-paragraph to play nice with javadoc-like comments joakim.harsman

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.