org-src: Fix indentation when tabs are involved
commit91236a3db3d99cbb4c011726929106fd2689c36d
authorNicolas Goaziou <mail@nicolasgoaziou.fr>
Sat, 29 Apr 2017 09:45:45 +0000 (29 11:45 +0200)
committerNicolas Goaziou <mail@nicolasgoaziou.fr>
Sat, 29 Apr 2017 09:45:45 +0000 (29 11:45 +0200)
tree04b8c7bfc49ea775f2c1549e7642afebda316aef
parentcb5ca4206fc564146f3895866f7b0f868df25011
org-src: Fix indentation when tabs are involved

* lisp/org-src.el (org-src--source-type):
(org-src--tab-width): New variables.
(org-src--edit-element): Set variables above.

(org-src--contents-for-write-back): Re-indent properly non-blank lines
before inserting contents back into the source buffer.
(org-edit-src-code): Delegate block indentation to
`org-src--contents-for-write-back'.

* testing/lisp/test-org-src.el (test-org-src/indented-blocks): New
  test.

Reported-by: Brent Goodrick <bgoodr@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113207>
lisp/org-src.el
testing/lisp/test-org-src.el