From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Francesco Pizzolante" Subject: Re: Indentation of code blocks within lists Date: Fri, 24 May 2013 16:33:37 +0200 Message-ID: <87ip28o3b2.fsf@somewhere.org> References: <87ehdb13lo.fsf@somewhere.org> <874ndwg2os.fsf@somewhere.org> <86txlt8hkf.fsf@somewhere.org> <87sj1c7e60.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <87sj1c7e60.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> (Nicolas Goaziou's message of "Fri, 24 May 2013 14:31:03 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: Nicolas Goaziou Cc: public-emacs-orgmode-mXXj517/zsQ-wOFGN7rlS/M9smdsby/KFg@public.gmane.org, Sebastien Vauban 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