From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarmo Hurri Subject: Babel code indentation problem Date: Thu, 03 Mar 2016 10:01:25 +0200 Message-ID: <87mvqgouqy.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abOCo-0005Yl-VL for emacs-orgmode@gnu.org; Thu, 03 Mar 2016 03:02:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abOCj-0005b2-1I for emacs-orgmode@gnu.org; Thu, 03 Mar 2016 03:01:54 -0500 Received: from plane.gmane.org ([80.91.229.3]:37523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abOCi-0005ah-R0 for emacs-orgmode@gnu.org; Thu, 03 Mar 2016 03:01:48 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1abOCb-0002oy-1x for emacs-orgmode@gnu.org; Thu, 03 Mar 2016 09:01:41 +0100 Received: from host-137-163-18-130.edu.hel.fi ([137.163.18.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Mar 2016 09:01:41 +0100 Received: from jarmo.hurri by host-137-163-18-130.edu.hel.fi with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Mar 2016 09:01:41 +0100 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@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 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