emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-babel-trangle, proble when loop is interrupted by documentat


From: Nicolas Goaziou
Subject: Re: [O] org-babel-trangle, proble when loop is interrupted by documentation
Date: Sat, 21 Apr 2018 11:17:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello,

Uwe Brauer <address@hidden> writes:

> Please consider the following test org file
> * A test example
> ,----
> | #+BEGIN_SRC matlab :tangle test.m 
> | function [ll x]=mitest(A0,x0)
> | % initialization 
> | format long
> | epsi=1.e-3;
> | nit=0;
> | nmaxit=200;
> | Delta=10;
> | A=A0;
> | while Delta>epsi & nit<nmaxit
> |     nit=nit+1; % counter
> | #+END_SRC
> | Some explanation...
> | #+BEGIN_SRC matlab :tangle test.m 
> |     y=A*x0;
> | end
> | #+END_SRC
> | The basic idea is.
> `----
>
>
> I have interrupted the while loop by some text, when I now toggle, the
> indentation  is broken as you can see.
>
> ,----
> | function [ll x]=mitest(A0,x0)
> | % initialization 
> | format long
> | epsi=1.e-3;
> | nit=0;
> | nmaxit=200;
> | Delta=10;
> | A=A0;
> | while Delta>epsi & nit<nmaxit
> |     nit=nit+1; % counter
> | 
> | y=A*x0;
> | end
> `----
>
> There is an empty line and
> y=A*x0 is not indented.
>
> How can this behavior be avoided?

I guess you have to set `org-src-preserve-indentation' globally, or use
"-i" flag for the block, which is locally equivalent.

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]