I am working with a simple major mode. The format has one single line comment delimiter, i.e., %
. However, I get strange results when running fill-paragraph
on a comment. Specifically, the result I see when running fill-paragraph
on the first line of the following comment
% 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
% 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
is
% 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
% 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
% 27
Observe how the next line is indented by one more space. I expect fill-paragraph
to not change the comment at all. If I were to run fill-paragraph
again on the second line of this resultant comment the third line is preceded, following the %
, by yet another space.
I am looking for a way to change the major mode such that this "cascading" behavior no longer occurs when fill-paragraph
is called on a comment.
UPDATE 1
I have verified that the issue is related to the particular major mode I am using. Specifically, I started emacs using emacs -Q
, loaded the major mode manually, and then enabled the major mode. After doing this, the "cascading" behavior was exhibited again.
The major mode I am using can be found here: https://github.com/abella-prover/abella/blob/master/emacs/abella.el
UPDATE 2
Following @JeanPierre's comment regarding emacs 25. I have confirmed that this behavior does not occur in emacs 25 but DOES occur in emacs 26.