2

For personal notes, I create ChangeLog files of the following format:

2015-01-27+0000  Felix E. Klee  <felix.klee@inka.de>

    * Today, I asked my first question on emacs.stackexchange.com:

      - My question is about issues with ChangeLog files.

Local Variables:
fill-column: 79
fill-indent-according-to-mode: nil
coding: utf-8
add-log-time-format: (lambda () (format-time-string "%Y-%m-%d%z"))
End:

The problem: After upgrading to version 24.4.1, when I press return at the end of files., then the line changes identation depth:

    * Today, I asked my first question on emacs.stackexchange.com:

    - My question is about issues with ChangeLog files.

How do I prevent identation from changing in that case?

Already I tried specifying buffer local variables, to no avail:

adaptive-fill-regexp: "\\s *\\|\\s -"
paragraph-start: "\\s *$\\|\f\\|^\\<\\|\\s -$"

FYI after upgrading to Emacs 23, I had another ChangeLog indentation issue, which IIRC I may have solved by editing changelog-mode source code. I would like to avoid that this time.

  • 1
    possible duplicate of How to disable auto-indentation of new lines? – legoscia Jan 27 '15 at 11:43
  • To what command is return bound (check with C-h k <return>)? The default bindings changed with 24.4, which effectively swapped the bindings for return and C-j. See comments and answers in this thread. – Dan Jan 27 '15 at 11:44
  • @Dan It is bound to RET. – feklee Jan 27 '15 at 11:48
  • RET is the key rather than the command. The next line will tell you the command (ie, the part in parentheses). I'm guessing yours will say newline-and-indent. You can either rebind the key (say, to newline), or follow the link that @legoscia posted. This question does, indeed, look like a duplicate. – Dan Jan 27 '15 at 11:56
  • @Dan Right, the command is: (newline &optional ARG INTERACTIVE). There is also the explanation: If `electric-indent-mode' is enabled, this indents the final new line that it adds, and reindents the preceding line. – feklee Jan 27 '15 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.