[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Babel code indentation problem
From: |
Jarmo Hurri |
Subject: |
[O] Babel code indentation problem |
Date: |
Thu, 03 Mar 2016 10:01:25 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Greetings.
I would appreciate help in fixing a Babel indentation problem. I
recently added support for Processing programming language in Babel. It
is working very nicely except for an indentation problem I ran into.
The Org snippet below shows two basically indentical code blocks, one in
C and the other in Processing. When I edit the code blocks with "C-c '"
and return to the Org file, the C code indents correctly, while the
Processing code doesn't. To be more specific, one line doesn't, and the
line is indicated in the file.
# ------------------------------------------------------------------
* Example with C
#+BEGIN_SRC c
#include <stdlib.h>
int main (int argc, char* argv[])
{
int a = 0, b = 0;
while (a == 0)
{
if (a == 0)
{
if (b == 0)
a++; /* this line indents correctly */
}
}
exit (0);
}
#+END_SRC
* Example with Processing
#+BEGIN_SRC processing
size (400, 400);
int a = 0, b = 0;
while (a == 0)
{
if (a == 0)
{
if (b == 0)
a++; // while this one doesn't
}
}
#+END_SRC
# ------------------------------------------------------------------
Now when I edit the Processing code with "C-c '", go to the problematic
line and press tab, the line is indented correctly:
----------------------------------------------------------------------
size (400, 400);
int a = 0, b = 0;
while (a == 0)
{
if (a == 0)
{
if (b == 0)
a++; // while this one doesn't
}
}
----------------------------------------------------------------------
So the problem is not in indentation in Processing mode itself, but the
error appears upon return from editing. This suggests that the issue
is in the communication between the editing mode and Org mode. As you
can see, I have different indentation settings for C and Processing, so
that might be one thing that makes the difference appear.
The incorrect indentation carries over to, for example, exported files.
Any ideas on how I would start fixing this?
Jarmo
- [O] Babel code indentation problem,
Jarmo Hurri <=