From: "Francesco Pizzolante" <fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org>
To: Nicolas Goaziou <n.goaziou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: public-emacs-orgmode-mXXj517/zsQ-wOFGN7rlS/M9smdsby/KFg@public.gmane.org,
Sebastien Vauban
<public-sva-news-D0wtAvR13HarG/iDocfnWg-wOFGN7rlS/M9smdsby/KFg@public.gmane.org>
Subject: Re: Indentation of code blocks within lists
Date: Fri, 24 May 2013 16:33:37 +0200 [thread overview]
Message-ID: <87ip28o3b2.fsf@somewhere.org> (raw)
In-Reply-To: <87sj1c7e60.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> (Nicolas Goaziou's message of "Fri, 24 May 2013 14:31:03 +0200")
Hi Nicolas,
> I also cannot reproduce OP's problem. It may be related to
> `org-src-preserve-indentation' value.
Thanks for your answer.
I checked the `org-src-preserve-indentation' variable and saw that it was non
`nil'.
Setting this variable to `nil' fixes the demonstrated issue. But, even then, I
still have an indentation problem.
In the following example (with `org-src-preserve-indentation' set to `nil'):
- in the first headline, I have a code block in a list which is correctly
exported ignoring the spaces due to the indentation of the Org list;
- in the second headline, I have the same source code but it is split in
several code blocks in order to better document it. The last 2 blocks are
not correctly exported as *all spaces before the code* (even those I
manually added) are ignored.
--8<---------------cut here---------------start------------->8---
* First situation
My list:
- Example which works
#+begin_src emacs-lisp
(if complex-condition
then-block
else-block)
#+end_src
* Second situation
My list:
- Example which does not work anymore
#+begin_src emacs-lisp
(if complex-condition
#+end_src
The "then" block does this:
#+begin_src emacs-lisp
then-block
#+end_src
The else-block does that:
#+begin_src emacs-lisp
else-block)
#+end_src
--8<---------------cut here---------------end--------------->8---
I think that only the spaces due to the Org indentation (here the number of
spaces before the `#' which delimits the source block, hence 2 spaces) should
be ignored.
IOW, just the "margin" should be removed, and the margin is (IMO) defined as
the spaces from column 0 up to the `#' character.
Thanks for your help.
Regards,
Francesco
next prev parent reply other threads:[~2013-05-24 14:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-13 12:11 Indentation of code blocks within lists Francesco Pizzolante
[not found] ` <87ehdb13lo.fsf-oHC15RC7JGTNLxjTenLetw@public.gmane.org>
2013-05-21 8:25 ` Francesco Pizzolante
2013-05-23 22:20 ` Sebastien Vauban
2013-05-24 12:31 ` Nicolas Goaziou
[not found] ` <87sj1c7e60.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-24 14:33 ` Francesco Pizzolante [this message]
2013-05-24 21:26 ` Sebastien Vauban
2013-05-25 12:39 ` Nicolas Goaziou
[not found] ` <87zjvj5j3n.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-27 8:23 ` Francesco Pizzolante
2013-05-27 14:15 ` Sebastien Vauban
2013-05-27 14:46 ` Sebastien Vauban
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=87ip28o3b2.fsf@somewhere.org \
--to=fpz-djc/ipccudyqhejpep6iedvlejwurmry@public.gmane.org \
--cc=n.goaziou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=public-emacs-orgmode-mXXj517/zsQ-wOFGN7rlS/M9smdsby/KFg@public.gmane.org \
--cc=public-sva-news-D0wtAvR13HarG/iDocfnWg-wOFGN7rlS/M9smdsby/KFg@public.gmane.org \
/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
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
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).