1

Emacs 26.3, Org 9.3

When using python src block, it changes 8 spaces to tab. When tangling this, python errors with "inconsistent use of tabs and spaces in indentation". How fix it?

1 Answer 1

1

From documentation:

‘org-src-preserve-indentation’

Default is ‘nil’. Source code is indented. This indentation applies during export or tangling, and depending on the context, may alter leading spaces and tabs. When non-‘nil’, source code is aligned with the leftmost column. No lines are modified during export or tangling, which is very useful for white-space sensitive languages, such as Python.

So, I've set this variable as local for buffer in the end of the file

;;; Local Variables:
;;; org-src-preserve-indentation: t
;;; End:
1
  • Assume there is a more fundamental solution. Commented Dec 27, 2019 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.