[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Continuation of comments in f90-mode with auto-fill
From: |
Nicolas Bock |
Subject: |
Re: Continuation of comments in f90-mode with auto-fill |
Date: |
Thu, 15 Jan 2015 11:43:10 -0700 |
Reading more in the manual I came across the key binding 'M-j'. When I type
!> beginning...
Press M-j, I get
!> beginning...
!
i.e. only a single '!' is inserted and not two as specified by
comment-continue. I read through the implementation in
newcomment.el::comment-indent-new-line() but I don't understand lisp
sufficiently to see where the single '! ' comes from. Could someone
give me a hint?
Thanks already,
nick
On Wed, Jan 14, 2015 at 6:15 PM, Nicolas Bock <nicolasbock@gmail.com> wrote:
> Hi Bernardo,
>
> that's awesome! Thanks! However, it's not quite working, although it's
> almost there. I added this to my ~/.emacs file:
>
> (add-hook 'f90-mode-hook
> (lambda ()
> (setq comment-start "!> ")
> (setq comment-continue "!! ")))
>
> Hoping to be able to type something like this with the right indentation:
>
> !> A subroutine.
> !!
> !! @param a Parameter a.
>
> However, what is happening is the following. I start the first line
> and hit enter at the end. The cursor is positioned underneath the
> "!>", so all is good. But no "!! " is inserted. Then I type "!!
> @param..." and hit enter, and the line is moved all the way to the
> left, so not aligned anymore with the comments above it. Could you
> suggest some other variable(s) I could change?
>
> Thanks already,
>
> nick
>
> On Wed, Jan 14, 2015 at 2:38 PM, Bernardo <bernardo.bacic@pobox.com> wrote:
>>
>>> When in f90-mode with auto-fill-mode, emacs continues a comment by
>>> indenting the new line and inserting a single '!' character at the
>>> beginning. How do I change this string, say to "!! "?
>>
>> completely untested but may give you an idea:
>>
>> (add-hook 'f90-hook
>> (lambda ()
>> (setq comment-start "!! ")))
>>