emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Timothy <tecosaur@gmail.com>
To: "Frédéric Santos" <frederic.santos@u-bordeaux.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: Behavior of org-adapt-indentation [9.4.6 (9.4.6-10-gee652a-elpa @ /home/fsantos/.emacs.d/elpa/org-20210705/)]
Date: Tue, 31 Aug 2021 23:59:33 +0800	[thread overview]
Message-ID: <87a6kxob19.fsf@gmail.com> (raw)
In-Reply-To: <87wnq2ws13.fsf@u-bordeaux.fr>

[-- Attachment #1: Type: text/plain, Size: 2022 bytes --]

Hi Frédéric,

I tried to reproduce with emacs -Q but I had no luck (see the image attached).
Could you give emacs -Q a go and let us know how it goes?

Frédéric Santos <frederic.santos@u-bordeaux.fr> writes:

> Hi!
>
> 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
>   :config
>   (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:
> <https://www.zupimages.net/up/21/26/8b3n.gif>
>
> Is there a workaround to avoid this indentation of code blocks?
>
> All the best,
> Frédéric
>
> ==
> 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/)

All the best,
Timothy

[-- Attachment #2: org-indent-Q.png --]
[-- Type: image/png, Size: 17233 bytes --]

      reply	other threads:[~2021-08-31 16:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07  6:35 Frédéric Santos
2021-08-31 15:59 ` Timothy [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=87a6kxob19.fsf@gmail.com \
    --to=tecosaur@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=frederic.santos@u-bordeaux.fr \
    --subject='Re: Bug: Behavior of org-adapt-indentation [9.4.6 (9.4.6-10-gee652a-elpa @ /home/fsantos/.emacs.d/elpa/org-20210705/)]' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).