emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Frédéric Santos" <frederic.santos@u-bordeaux.fr>
To: emacs-orgmode@gnu.org
Subject: Bug: Behavior of org-adapt-indentation [9.4.6 (9.4.6-10-gee652a-elpa @ /home/fsantos/.emacs.d/elpa/org-20210705/)]
Date: Wed, 07 Jul 2021 08:35:04 +0200	[thread overview]
Message-ID: <87wnq2ws13.fsf@u-bordeaux.fr> (raw)


This might not be *really* a bug, but since a recent update of Org, I
noticed an unwanted indentation of code blocks when the variable
org-adapt-indentation is set to 'headline-data. It can be reproduced
with this very minimal org config:

(use-package org
  (require 'org-tempo)
  (setq org-adapt-indentation 'headline-data))

In an org buffer, create a headline, and then:

1. Type some text which does *not* follow an empty line an press TAB:
    nothing happens (which is the expected behavior).
2. Type some text which does follow an empty line an hit TAB: this text
    gets indented according to the current headline level (the help page
    looks unclear to me: it might also be the expected behavior,
    although I don't really understand the rationale for it).

Point 2. has a side effect: when you still use the old template
expansion mechanism for code blocks (the one provided by org-tempo.el,
e.g. type <s and then hit TAB to expand a template), those code blocks
now get indented according to the headline level (because you press TAB,
I guess). I think it's not the expected behavior, since those code
blocks that follow an empty line will have a different indentation than
the text before and after them.

Here is an animated gif to better illustrate what I mean:

Is there a workaround to avoid this indentation of code blocks?

All the best,

Emacs  : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4)
 of 2021-03-26
Package: Org mode version 9.4.6 (9.4.6-10-gee652a-elpa @ /home/fsantos/.emacs.d/elpa/org-20210705/)

             reply	other threads:[~2021-07-07  6:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07  6:35 Frédéric Santos [this message]
2021-08-31 15:59 ` Bug: Behavior of org-adapt-indentation [9.4.6 (9.4.6-10-gee652a-elpa @ /home/fsantos/.emacs.d/elpa/org-20210705/)] Timothy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnq2ws13.fsf@u-bordeaux.fr \
    --to=frederic.santos@u-bordeaux.fr \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).