From 12a912e9cbc1b2b475632dd724ca55af54b56236 Mon Sep 17 00:00:00 2001 From: Charles Berry Date: Fri, 25 Sep 2015 12:02:32 -0700 Subject: [PATCH] org-src-preserve-indentation: docstring and info fixes doc/org.texi: The `Literal examples' node mentions the effect of the `-i' switch on embedded tabs. The `Editing source code' node correctly states that setting `org-src-preserve-indentation' to `t' prevents converting tabs to spaces. Also, its effect on indentation operations is noted. A mention of the `-i' switch is given. lisp/org-src.el: The `org-src-preserve-indentation' docstring mentions the effect of setting its value to `t' is to protect conversion of tabs to spaces. --- doc/org.texi | 17 ++++++++++------- lisp/org-src.el | 7 ++++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 8de8efc..62c39e3 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -10053,8 +10053,8 @@ jumps to point-min. @end example @cindex indentation, in source blocks -Finally, you can use @code{-i} to preserve the indentation of a specific code -block (@pxref{Editing source code}). +Finally, you can use @code{-i} to preserve the indentation and tab +characters of a specific code block (@pxref{Editing source code}). @vindex org-coderef-label-format If the syntax for the label format conflicts with the language syntax, use a @@ -14826,11 +14826,14 @@ Controls the way Emacs windows are rearranged when the edit buffer is created. @cindex indentation, in source blocks By default, the value is @code{nil}, which means that when code blocks are evaluated during export or tangled, they are re-inserted into the code block, -which may replace sequences of spaces with tab characters. When address@hidden, -whitespace in code blocks will be preserved during export or tangling, -exactly as it appears. This variable is especially useful for tangling -languages such as Python, in which whitespace indentation in the output is -critical. +which may replace tab characters with sequences of spaces. When address@hidden, whitespace in code blocks will be preserved during export or +tangling, exactly as it appears. This variable is especially useful for +tangling languages such as Python, in which whitespace indentation in the +output is critical. A value of @code{t} prevents global indent/outdent +operations from moving source or example block contents. The @code{-i} switch +has a similar effect on a single source or example block (@pxref{Literal +examples}). @item org-src-ask-before-returning-to-edit-buffer By default, Org will ask before returning to an open edit buffer. Set this variable to @code{nil} to switch without asking. diff --git a/lisp/org-src.el b/lisp/org-src.el index 9c205e1..394633d 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -108,9 +108,10 @@ These are the regions where each line starts with a colon." (defcustom org-src-preserve-indentation nil "If non-nil preserve leading whitespace characters on export. -If non-nil leading whitespace characters in source code blocks -are preserved on export, and when switching between the org -buffer and the language mode edit buffer. +If non-nil leading whitespace characters and embedded tab +characters in source code blocks are preserved on export, and +when switching between the org buffer and the language mode edit +buffer. When this variable is nil, after editing with \\[org-edit-src-code], the minimum (across-lines) number of leading whitespace characters -- 2.3.8 (Apple Git-58)