ada-mode-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ada-mode-users] comment-indent doesn't work as expected; problem wi


From: Stephen Leake
Subject: Re: [Ada-mode-users] comment-indent doesn't work as expected; problem with wisi-comment-indent?
Date: Wed, 02 Nov 2016 14:40:28 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt)

SCHOEPFLIN Markus <address@hidden> writes:

> Comment-indent is documented as:
>
>   (comment-indent &optional CONTINUE)
>   
>   Indent this line's comment to `comment-column', or insert an empty comment.
>   If CONTINUE is non-nil, use the `comment-continue' markers if any.
>
> If I understand the implementation in 'newcomment.el' correctly, it
> basically forwards to 'wisi-comment-indent' when Ada mode is active
> and it is invoked in a line having some code and a comment. But
> 'wisi-comment-indent' does not seem to respect the setting for
> comment-column.
>
> So, for example:
>
>   X : Integer; -- some comment
>
> When I position the cursor anywhere on that line and invoke
> comment-indent, I'd expect the comment to be indented to
> 'comment-column', which is 55 in my case. What happens is that the
> cursor is positioned at the comment start, on the first letter after
> "-- ", but nothing else.
>
> Is this indeed a problem with 'wisi-comment-indent'?

It appears so, yes.

The function `comment-indent-default' does return comment-column, so
wisi-comment-indent should as well.

I never use 'comment-indent'; I just let 'align' deal with this; that
adapts better to the code at hand.

> Moreover, when I insert spaces between the code and the comment, so
> that the comment starts *after* column 63, and then invoke
> comment-indent, the comment gets positioned on column 63. I have no
> idea where that magic number comes from.

When I try this with the comment "-- some comment", the leading '-' is
put in column 55; the right end is at column 70. I think 70 is the
default for some fill function?

-- 
-- Stephe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]