Dear fellows!
GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of
2019-08-29
Org mode version 9.2.6 (release_9.2.6-544-gd215c3 @
/home/w/borg/emacs/org/lisp/)
The variable org-edit-src-content-indentation has a default value of 2.
Buffer-local values for that variable currently are not respected when
using org-edit-src-code. Buffer-local values for this variable are set
in e.g. worg/.dir-locals.el.
The bug can be fixed by changing
org-edit-src-content-indentation
into
(with-current-buffer (marker-buffer org-src--beg-marker)
org-edit-src-content-indentation)
in the definition of org-src--contents-for-write-back. However, the
general patterns in the org-src.el suggest, that something similar to
(defvar-local org-src--preserve-indentation nil)
(put 'org-src--preserve-indentation 'permanent-local t)
should be introduced, set up, and used.
But except following the pattern, I see no advantage in the latter
approach, even two slight disadvantages. The first beeing that it uses
more lines of code, and the second being so minor and opinionated that I
don't mention it.
Which route shall I take when preparing a patch?
Best wishes
Sebastian