emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] BUG: Wrong indentation inside src block


From: fm4d
Subject: Re: [O] BUG: Wrong indentation inside src block
Date: Sat, 16 Apr 2016 10:45:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux)

Adam Porter <address@hidden> writes:

> fm4d <address@hidden> 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 <C-c '> 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 <C-c '> and the actual code is indented correctly inside
<C-c '> and when tangled, BUT it is displayed incorrectly in the
src block after I return from <C-c '> 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 <C-c '>) is just
incorrectly rendered outside of <C-c '>. Tracking it to this merge
commit was the best I could do, I was trying to look throught the
changes but with no luck.




reply via email to

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