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?


From documentation:


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:
  • Assume there is a more fundamental solution. – Andreas Röhler Dec 27 '19 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.