Emacs' fine org-mode has CODE and EXAMPLE blocks that are easily edited in a proper major mode using C-c '
. But for quick alterations and minor edits one might prefer editing the block inline without opening new popup windows for a two-second operations.
Of course org lets you do that but the automatic indentations are off radar while editing inline like that. Where and what should I hack to make org's indentation logic to act like default dumb autoindentation (ie. copy the indent level of the previous line) while the cursor is in a code block?
#+BEGIN_SRC python
def foo():
return 42
#+END_SRC
#+BEGIN_EXAMPLE
Oh my
hh
#+END_EXAMPLE
If the cursor was at the end of the line containing hh
, pressing C-j
would get me a new line with the same indentation as the previous one.