[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX] Re: Comment filling : I would like to make a contribution
From: |
Vincent Belaïche |
Subject: |
[AUCTeX] Re: Comment filling : I would like to make a contribution |
Date: |
Sun, 10 Aug 2008 21:25:40 +0200 |
User-agent: |
Thunderbird 2.0.0.16 (Windows/20080708) |
Ralf Angeli a écrit :
I don't think that this would be enough, because even though by some
tampering with variable `paragraph-separate' one line of preprocessor
code could be recognized as a single paragraph, this would not prevent
that this line may be folded into two lines if it is too long, which
would cause the absence of an Eupp end-mark for the first line, and of
an Eupp start mark for the second line.
The idea was not to make each line a of the preprocessor code its own
paragraph separator, but to establish some separation between a normal
comment and the preprocessor code. Then when you fill a comment
paragraph it will not mess up the preprocessor code.
The solution for the preprocessor code is simply not to type `M-q' when
point is in it. In case there should be more control about how the code
is to be indented or filled, using a separate major mode which gets
switched on if the preprocessor code is entered and off when left would
probably be a better idea than shoehorning filling restrictions into
AUCTeX.
Then there are two drawbacks for that
1) the user has to care not to make a M-q when the point is in the
pre-preprocessor code
2) the pre-processor code will split paragraphs into pieces, which I
think is awkward.
I can still see some use for the definition of sections which should be
spared from filling (especially if a larger region is to be filled), but
perhaps there should better be a general mechanism in Emacs which could
be used or adopted by AUCTeX once it is there.
I do not object to this suggestion, however what you say is
contradictory with the fact that currently AUCTeX does not rely on Emacs
general filling procedure : AUCTeX uses function
`LaTeX-fill-region-as-para-do' instead of function
`fill-region-as-paragraph', just as if people wanted AUCTeX to be
independant from Emacs fill.el.
If AUCTeX would use fill-region-as-paragraph, then I could modify this
function to make into it some support for unfillable sections, but as
AUCTeX does not use it (but use a copy `LaTeX-fill-region-as-para-do' of
it), then I had rather make the checks and skips one level above (in
function `LaTeX-fill-region-as-paragraph') as this seemed easier.
What you suggest would need that AUCTeX filling mechanism should be a
layer on top of some general filling kernel provided by Emacs, whereas
it seems to be currently a complete overload of Emacs filling procedure
(w/o reuse).
*Please confirm your intention* :
do you object to my contribution ?
If yes, you seem however to see some need for unfillable sections, could
you please tell me how I could make this function available in an
acceptable manner, as I do need for it, and I am sure that other people
may need for it too.
<URL:http://www.gnu.org/software/auctex/mailing-lists.html>
Thanks for the link.
By the way I have checked that there is no infinite loop in the code
that I have provided, because when LaTeX-fill-region-as-paragraph is
called, the calling code has already made sure that a paragraph does not
end at buffer end, ie a newline has been inserted before buffer end when
need be.
Still I could make a modification in the code that I have already
provided to you in order to make it more robust (actually I have already
made this modification, and I can make it available on request). But I
am not sure whether this is needed, because many other part of the code
may assume that the last char in a paragraph is not at eob, and that a
(beginning-of-line 2) would always move one line forward.
BR,
Vincent.
- [AucTeX] Comment filling : I would like to make a contribution, Vincent Belaïche, 2008/08/08
- Re: [AucTeX] Comment filling : I would like to make a contribution, Vincent Belaïche, 2008/08/08
- Re: [AucTeX] Comment filling : I would like to make a contribution, Ralf Angeli, 2008/08/09
- Re: [AucTeX] Comment filling : I would like to make a contribution, Vincent Belaïche, 2008/08/09
- [AUCTeX] Re: Comment filling : I would like to make a contribution, Ralf Angeli, 2008/08/09
- Message not available
- [AUCTeX] Re: Comment filling : I would like to make a contribution, Vincent Belaïche, 2008/08/09
- [AUCTeX] Re: Comment filling : I would like to make a contribution, Ralf Angeli, 2008/08/10
- [AUCTeX] Re: Comment filling : I would like to make a contribution,
Vincent Belaïche <=
- [AUCTeX] Re: Comment filling : I would like to make a contribution, Ralf Angeli, 2008/08/10
- [AUCTeX] Re: Comment filling : I would like to make a contribution, Vincent Belaïche, 2008/08/11
- [AUCTeX] Re: Comment filling : I would like to make a contribution, Vincent Belaïche, 2008/08/15