• Fortran

    From Dieter Britz@21:1/5 to Dieter Britz on Thu Jan 12 13:42:12 2017
    On Thu, 12 Jan 2017 13:39:55 +0000, Dieter Britz wrote:

    Next question: my new emacs "helps" me type in Fortran text, by
    providing indentation, but it guesses wrong, which is irritating. I
    can't find the option to turn that off. Which is it?

    I ought to add that it is only the unasked-for indentation
    I want to turn off. The other things, like colouring etc
    is in fact helpful.

    --
    Dieter Britz

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From N. Jackson@21:1/5 to Dieter Britz on Thu Jan 12 11:58:57 2017
    At 13:39 +0000 on Thursday 2017-01-12, Dieter Britz wrote:

    Next question: my new emacs "helps" me type in
    Fortran text, by providing indentation, but it guesses
    wrong, which is irritating. I can't find the option to
    turn that off. Which is it?

    1. I haven't edited Fortran for a long time, but poking around
    in the docs, my first question would be "are you using the right
    mode"?

    Typing `M-h f fortran-mode RET', I see (prominently displayed
    near the top):

    Major mode for editing Fortran code in fixed format. For free
    format code, use `f90-mode'.

    Also, looking at `auto-mode-alist' (`C-h v auto-mode-alist RET')
    I see -- on my Emacs at least -- that files with an extension of
    `.f' or `.for' will open in fortran-mode; those with an
    extension of `.f90' or `.f95' will open in f90-mode.

    If your files have a different extension, you will probably want
    to add it to your auto-mode-alist.


    2. Assuming you are editing your files in the right mode, and
    you are still experiencing incorrect indentation, I would
    recommend that you report this with

    `M-x report-emacs-bug RET'

    showing the code to be indented, how you expect it to indented,
    and how Emacs is actually indenting it. Then the problem can
    (potentially) be fixed for everyone.


    3. Turning off automatic indentation would seem to be a
    drastic measure, but you can learn how to do it if you read
    "Chapter 24 Indentation" in the Emacs Manual
    (use `M-: (info "(emacs) Indentation")' to view it).

    You will see in the last paragraph of the chapter:

    Electric Indent mode is a global minor mode that automatically
    indents the line after every <RET> you type. This mode is
    enabled by default. To toggle this minor mode, type `M-x
    electric-indent-mode'. To toggle the mode in a single buffer,
    use `M-x electric-indent-local-mode'.

    N.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dieter Britz@21:1/5 to N. Jackson on Thu Feb 2 10:12:46 2017
    On Thu, 12 Jan 2017 11:58:57 -0500, N. Jackson wrote:

    At 13:39 +0000 on Thursday 2017-01-12, Dieter Britz wrote:

    Next question: my new emacs "helps" me type in Fortran text, by
    providing indentation, but it guesses wrong, which is irritating. I
    can't find the option to turn that off. Which is it?

    1. I haven't edited Fortran for a long time, but poking around in the
    docs, my first question would be "are you using the right mode"?

    Typing `M-h f fortran-mode RET', I see (prominently displayed near the
    top):

    Major mode for editing Fortran code in fixed format. For free format
    code, use `f90-mode'.

    Also, looking at `auto-mode-alist' (`C-h v auto-mode-alist RET')
    I see -- on my Emacs at least -- that files with an extension of `.f' or `.for' will open in fortran-mode; those with an extension of `.f90' or
    `.f95' will open in f90-mode.

    If your files have a different extension, you will probably want to add
    it to your auto-mode-alist.


    2. Assuming you are editing your files in the right mode, and you are
    still experiencing incorrect indentation, I would recommend that you
    report this with

    `M-x report-emacs-bug RET'

    showing the code to be indented, how you expect it to indented, and how
    Emacs is actually indenting it. Then the problem can (potentially) be
    fixed for everyone.


    3. Turning off automatic indentation would seem to be a drastic measure,
    but you can learn how to do it if you read "Chapter 24 Indentation" in
    the Emacs Manual (use `M-: (info "(emacs) Indentation")' to view it).

    You will see in the last paragraph of the chapter:

    Electric Indent mode is a global minor mode that automatically indents
    the line after every <RET> you type. This mode is enabled by default.
    To toggle this minor mode, type `M-x electric-indent-mode'. To toggle
    the mode in a single buffer, use `M-x electric-indent-local-mode'.

    N.

    The indentation is mostly fine, but when I type in a new comment line
    after an existing one, the new, and the previous line, get indented.
    That is annoying. Emacs says "F90" at the top. I'd like to stop that.

    --
    Dieter Britz

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)