Georg Bauhaus <[email protected]> writes:

> Hi,
>
> I see this in *Messages*
>
> wisi-comment-indent: wisi-comment-indent called after non-comment
>
> This happens when calling comment-dwim on a line that ends with "=>".
> The dashes are inserted, and the Emacs beeps. Type M-; on the line
> declaring X.
>
> procedure Non_Comment is
>    X : String := (1 =>          --
>                     'A');
> begin
>    null;
> end Non_Comment;

Hmm. This is using wisi-comment-indent in a place I had not anticipated.

The doc string for "comment-indent-function" is:

   Function to compute desired indentation for a comment.
This function is called with no args with point at the beginning of
the comment's starting delimiter and should return either the desired
column indentation or nil.


I've always assumed "indent" only applies to whitespace at the start of
a line, not whitespace between the end of code and the start of a
comment (that's "align").

But I'm guessing if I asked on emacs-devel, I'd be told I'm wrong.

So what do you want wisi-comment-indent to do in this case (besides not
signal an error)?

I'd vote for either "return the current comment column", or
"delete all but one whitespace".
 
In general, I leave formatting comments after code to align, not indent.
That leaves just one space in this case.

wisi-comment-indent can't simply call align for this, because it
actually edits the buffer, but we need to just compute the new comment
column.

-- 
-- Stephe

_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to