[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] Filling of code comments
From: |
David Kastrup |
Subject: |
Re: [AUCTeX-devel] Filling of code comments |
Date: |
Thu, 28 Jul 2005 14:31:56 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Ralf Angeli <address@hidden> writes:
> As noted in <URL:http://article.gmane.org/gmane.emacs.auctex.bugs/252>
> there currently is a glitch with filling of code comments.
>
> Code comments receive special treatment in paragraph filling. If you
> call `LaTeX-fill-paragraph' on a line with a code comment, not the
> whole paragraph but only the line with the code comment will be
> filled. I think this functionality should be removed from
> `LaTeX-fill-paragraph'. The consequence will be that even if `M-q' is
> typed on a line with a code comment, the whole paragraph will be
> filled and the code comment be treated as code comments encountered at
> arbitrary places in a paragraph are treated now.
>
> What we currently do with them if they don't fit into a line, is adding
> a linebreak just before the last non-comment word. That means a
> paragraph like
>
> text text text text text text text text text text text text text text
> text text text text text text text text text text text % comment comment
> comment
> text text text text text text text text text text text text text text
>
> will become
>
> text text text text text text text text text text text text text text
> text text text text text text text text text text
> text % comment comment comment
> text text text text text text text text text text text text text text
>
> In contrast to the comment in `LaTeX-fill-region-as-para-do', we now
> could generate something like
>
> text text text text text text text text text text text text text text
> text text text text text text text text text text text % comment comment
> % comment
> text text text text text text text text text text text text text text
>
> But that would mean filling a paragraph may result in it becoming two
> separate paragraphs which might be problematic.
>
> So my suggestion would be to leave the treatment of code comments as
> is and make the functionality of filling code comments available in a
> separate function which may be called interactively.
>
> Does this sound reasonable?
Not really. I think that M-q should not reflow code comments when
executed before the % sign, and it should only reflow the comments
when executed after the % sign (if the % signs occur in the same
column, the comment block is formatted as one block).
Of course, this can get pretty much insanely complicated. I think
that we should probably just leave code comments completely alone.
auto-fill-mode will have to do something about them, but M-q might
just be too hard.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum