I’m using Stefan Bruda’s Prolog mode for emacs but I find the behavior with tab and “%” to be annoying … it always indents comments to column 32 (variable comment-column), even for lines starting with “%!”.
How can I change this behaviour? If I set comment-column to 0, then single-line comments get indented incorrectly:
foo :-
% this is a comment
bar.
instead of
foo :-
% this is a comment
bar.
and if I leave comment-column at 32, then I get the following, which I don’t want:
I think I’ve linked this to you before, but I’m using a slightly-modified version of the prolog.el that I think comes with Emacs that doesn’t seem to have this issue with indenting (I originally started working on this to fix the indentation of terms with dictionaries & character things like 0'.).
I met the same problem recently, but it seems to have been fixed by:
(setq prolog-align-small-comments-flag nil)
Then the single-line comments get indented:
foo :-
% this is a comment
bar.
One new customizable variable has been added in version 1.28:
prolog-align-small-comments-flag (group “Prolog Indentation”) specifies how to handle “small” comments (the ones that start with a simgle “%”) as follows: When this variable is non-nil (default) small comments are aligned to comment-column' (default 32) in all circumstances. When the variable is set to nil however small comments that begin a line (blank characters notwithstanding) will be treated just like “large” comments (the ones that start with “%%”). Note that small comments that start somewhere other than at the beginning of the line are still aligned to comment-column’.
Also, the latest version (1.29) has a bug, I don’t know if it exists in the old version though, is that prolog-indent-buffer doesn’t work properly in some cases. The root cause is that the prolog-indent-line may throw an error “Beginning of buffer”.
PS. At the writing time, Stefan Bruda’s Prolog mode for emacs’ website said the prolog-mode is version 1.28, but it is actually 1.29. This may cause some confusion.