I follow this tutorial. The code after selecting the region and <Tab>
or equivalently C-M-\
in an org file:
(setq trees '(pine fir oak maple)
herbivores '(gazelle antelope zebra))
I would have expected an indent before "herbivores".
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityindent-region
indents the region according to the current mode.
In a Lisp mode (e.g. emacs-lisp-mode
), selecting that as the region and using TAB
indents it as you say you expect, not as you show.
Why would expect it to behave similarly in Org mode?
(The section of the tutorial that you cite doesn't say anything about indentation, BTW.)
C-h f indent-region
tells us:
indent-region
is an interactive compiled Lisp function inindent.el
.It is bound to
C-M-\
, menu-bar edit region indent-region`.
(indent-region START END &optional COLUMN)
Indent each nonblank line in the region.
A numeric prefix argument specifies a column: indent each line to that column.
With no prefix argument, the command chooses one of these methods and indents all the lines with it:
- If
fill-prefix
is non-nil
, insertfill-prefix
at the beginning of each line in the region that does not already begin with it.- If
indent-region-function
is non-nil
, call that function to indent the region.- Indent each line via
indent-according-to-mode
.Called from a program,
START
andEND
specify the region to indent. If the third argumentCOLUMN
is an integer, it specifies the column to indent to; if it isnil
, use one of the three methods above.
Next, read what C-h f
tells you about indent-region-function
in a Lisp mode, and what it tells you about indent-according-to-mode
.