From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: [BUG] R src blocks untabify literal constant TABs Date: Wed, 7 Oct 2015 14:49:28 -0700 Message-ID: References: <87r3low81u.fsf@nicolasgoaziou.fr> <87vbaijve9.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zjwbz-0002HW-9Z for emacs-orgmode@gnu.org; Wed, 07 Oct 2015 17:51:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zjwau-0007ea-Re for emacs-orgmode@gnu.org; Wed, 07 Oct 2015 17:50:58 -0400 Received: from iport-acv4-out.ucsd.edu ([132.239.0.7]:62451) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zjwau-0006cO-7I for emacs-orgmode@gnu.org; Wed, 07 Oct 2015 17:49:52 -0400 In-Reply-To: <87vbaijve9.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: Org-Mode mailing list On Wed, 7 Oct 2015, Nicolas Goaziou wrote: > Hello, > > "Charles C. Berry" writes: > >> Attached is a patch. > > Thank you. > >> I think it is an improvement, but `org-src-preserve-indentation' >> behaves differently according to context, which makes it hard to >> document succinctly. > > There's something suspicious here. > > This variable is supposed to only replace tab characters used in > indentation, not anywhere else. However, it seems that your > documentation patch suggests otherwise. It may be a bug then. > More than one bug, I am afraid. > Do you have any such example? Sure, make sure that the whitespace in the `> <' below is a TAB character (C-q C-i). Running the src block replaces the TAB when `org-src-preserve-indentation' is nil. Also, use `org-edit-src-code' with point in the block and immediately exist, i.e. =C-c ' C-c '=, and the embedded tab disappears. #+BEGIN_SRC emacs-lisp "this is a TAB--> <--" #+END_SRC `untabify' is called by some functions that honor (in some way) `org-src-preserve-indentation' which explains some of this. FWIW, here is a summary of functions that use the variable: |---------------------------------------+-----------------------+---------------------------| | function | protect-leading space | effect on tabs | |---------------------------------------+-----------------------+---------------------------| | org-babel-exp-process-buffer | yes or no | ignore (+/- to indent) | | org-export-unravel-code | yes or no | ignore | | org-element-src-block-interpreter | contents only or not | ignore | | org-element-example-block-interpreter | contents only or not | ignore | | org-fixup-indentation | contents only or not | ignore (+/- to indent) | | org-babel-parse-src-block-match | yes or no | keep or remove | | org-babel-haskell-export-to-lhs | yes or no | keep or remove | | org-babel-spec-to-string | yes or no | keep or remove lead+trail | | org-src--edit-element | yes or no | keep or remove | | org-edit-src-code | yes or no | keep or remove | |---------------------------------------+-----------------------+---------------------------| the '(+/- to indent)' means that leading tabs may be added or removed with org-metaright and friends. `keep or remove lead+trail' == "keep or remove leading or trailing TABs only". 'contents only or not' means there is no effect on `#+BEGIN...' etc. HTH, Chuck