From mboxrd@z Thu Jan 1 00:00:00 1970 From: fm4d Subject: Re: BUG: Wrong indentation inside src block Date: Sat, 16 Apr 2016 10:45:05 +0200 Message-ID: <87fuum2b8u.fsf@fm4d.net> References: <87bn5axteh.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arLrJ-0004pd-Rh for emacs-orgmode@gnu.org; Sat, 16 Apr 2016 04:45:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1arLrF-00073W-Qe for emacs-orgmode@gnu.org; Sat, 16 Apr 2016 04:45:41 -0400 Received: from plane.gmane.org ([80.91.229.3]:45818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arLrF-00073R-KD for emacs-orgmode@gnu.org; Sat, 16 Apr 2016 04:45:37 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1arLrD-0008La-Qj for emacs-orgmode@gnu.org; Sat, 16 Apr 2016 10:45:36 +0200 Received: from 221.210.broadband5.iol.cz ([88.100.210.221]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Apr 2016 10:45:35 +0200 Received: from m by 221.210.broadband5.iol.cz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Apr 2016 10:45:35 +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@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Adam Porter writes: > fm4d writes: > >> Hello, I found an indentation bug in the master branch. >> >> Steps to reproduce: >> >> * Test 1 >> ** Test 2 >> #+BEGIN_SRC emacs-lisp >> (setq foo 1 >> bar 2) >> #+END_SRC >> >> Paste this code into org-mode buffer with org-startup-indented turn on >> org-indented-mode. You should see the src block missindented like this: >> >> (setq foo 1 >> bar 2) >> >> I've tracked this bug to this commit >> http://repo.or.cz/org-mode.git/commit/a311a856514e9245074b02c89d51a9f339784d1c > > Hm, I'm not sure I understand the problem. Org doesn't automatically > reindent source blocks, as far as I know. You can and reindent > the source buffer, and then when you save it it will be reflected in the > Org buffer. I made a little function to do that as a command, which I > could share if you like. > > Also, the examples you gave have mixed spaces and tabs, so it's hard to > tell whether they're indented correctly. For example, I see the second > example indented correctly, while the first is not. You might try > turning on whitespace-mode, which makes it easy to see where they are. > > BTW, that commit is a large merge commit, so it's hard to see where the > problem would be. You could try bisecting it on the branch it was > merged from. I can see that I should have explain it with more clarity. I am using and the actual code is indented correctly inside and when tangled, BUT it is displayed incorrectly in the src block after I return from and org-indent-mode is on. The code I posted should show what I mean, the expression inside src block (pasted and indented correctly inside ) is just incorrectly rendered outside of . Tracking it to this merge commit was the best I could do, I was trying to look throught the changes but with no luck.