From mboxrd@z Thu Jan  1 00:00:00 1970
From: Grant Rettke <gcr@wisdomandwonder.com>
Subject: Re: Tabs in export of code
Date: Sun, 11 Jan 2015 15:16:15 -0600
Message-ID: <CAAjq1mcgeFLarX7TTQtc6DLHQ5VmRd+jMkpOX2Z-suFdQ9S22w@mail.gmail.com>
References: <CABHo5SBxfUWnc6YhoRc7YGzv6USC=ho-p6eDROxMCqMMrJk4=g@mail.gmail.com>
	<87lhl96vsq.fsf@ucl.ac.uk>
	<CABHo5SALe2qZPq9MS-_E2niN32UFcNFn_0013m65kHoy2cPf3Q@mail.gmail.com>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a1134dd4c6e90b1050c66e6cc
Return-path: <emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org>
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44349)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <grettke@gmail.com>) id 1YAPrx-00075N-0B
	for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 16:16:22 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <grettke@gmail.com>) id 1YAPrt-0006B8-9B
	for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 16:16:20 -0500
Received: from mail-we0-x231.google.com ([2a00:1450:400c:c03::231]:35675)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <grettke@gmail.com>) id 1YAPrs-0006Ak-UB
	for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 16:16:17 -0500
Received: by mail-we0-f177.google.com with SMTP id q59so16070845wes.8
	for <emacs-orgmode@gnu.org>; Sun, 11 Jan 2015 13:16:15 -0800 (PST)
In-Reply-To: <CABHo5SALe2qZPq9MS-_E2niN32UFcNFn_0013m65kHoy2cPf3Q@mail.gmail.com>
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=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: Giuseppe Lipari <giulipari@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>

--001a1134dd4c6e90b1050c66e6cc
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Unsure but perhaps these are involved, what are your setting for:

org-src-preserve-indentation

and

org-edit-src-content-indentation

On Sun, Jan 11, 2015 at 12:30 PM, Giuseppe Lipari <giulipari@gmail.com>
wrote:

> Dear Eric,
>
> thanks for your quick answer. However this does not solve the problem.
> I use source code fontification for source blocks in org mode:
>
> #+begin_src emacs-lisp
>   (setq org-src-fontify-natively  t)
>   (setq org-src-tab-acts-natively t)
> #+end_src
>
>
> Normally, when I program in C or java, I disable indent-tabs mode. So, I
> have this hook
>
>  (add-hook 'java-mode-hook (lambda ()
>                               (setq c-basic-offset 4
>                                     tab-width 4
>                                     indent-tabs-mode nil)))
>
> somewhere in my init file.
>
> If I understand well what "org-src-fontify-natively" means, it should cal=
l
> the hook when I edit a code block whose language is Java, and this should
> in turn set the variable to nil. In fact, no tab is ever inserted anywher=
e
> in my org file, and the value od "indent-tabs-mode" at the buffer local
> level is nil, exactly as in your case. I have no idea if it can be set to
> nil at the global level (the documentation seems to say that it is not
> possible).
>
> Summarising
>
>     no tab in the org file, --> a tab appears in the tex file
>
> Thanks anyway.
>
> Giuseppe Lipari
>
>
>
>
> 2015-01-11 19:01 GMT+01:00 Eric S Fraga <e.fraga@ucl.ac.uk>:
>
>> On Sunday, 11 Jan 2015 at 17:31, Giuseppe Lipari wrote:
>>
>> [...]
>>
>> > There is not tab in this snipper (I never use tabs in code, only
>> spaces).
>> > Unfortunately, when opening the tex file, I see that a tab has been
>> > introduced whenever 8 consecutive spaces are found, in particular at
>> line 4.
>>
>> Shot in the dark: are tabs inserted when code is auto-indented?  If so,
>> maybe:
>>
>> ,----[ C-h v indent-tabs-mode RET ]
>> | indent-tabs-mode is a variable defined in `C source code'.
>> | Its value is nil
>> | Original value was t
>> | Local in buffer *unsent wide reply to Giuseppe Lipari*; global value i=
s
>> the same.
>> |
>> |   Automatically becomes buffer-local when set.
>> |   This variable is safe as a file local variable if its value
>> |   satisfies the predicate `booleanp'.
>> |
>> | Documentation:
>> | Indentation can insert tabs if this is non-nil.
>> |
>> | You can customize this variable.
>> |
>> `----
>>
>> --
>> : Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org
>> release_8.3beta-703-gef523b.dirty
>>
>
>
>
> --
> Giuseppe Lipari
> LIFL
> Universit=C3=A9 de Lille 1
> blogs: http://scacciamennule.blogspot.com  (Italian)
> <http://scacciamennule.blogspot.com>
>           http://okpanico,wordpress.com          (Italian)
>           http://algoland.wordpress.com           (English)
>



--=20
Grant Rettke
gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/
=E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates
((=CE=BB (x) (x x)) (=CE=BB (x) (x x)))
=E2=80=9CLife has become immeasurably better since I have been forced to st=
op
taking it seriously.=E2=80=9D --Thompson

--001a1134dd4c6e90b1050c66e6cc
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Unsure but perhaps these are involved, what are your setti=
ng for:<div><br></div><div>org-src-preserve-indentation<br></div><div><br><=
/div><div>and</div><div><br></div><div>org-edit-src-content-indentation<br>=
</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Su=
n, Jan 11, 2015 at 12:30 PM, Giuseppe Lipari <span dir=3D"ltr">&lt;<a href=
=3D"mailto:giulipari@gmail.com" target=3D"_blank">giulipari@gmail.com</a>&g=
t;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><d=
iv>Dear Eric,<br><br></div><div>thanks for your quick answer. However this =
does not solve the problem. <br></div>I use source code fontification for s=
ource blocks in org mode: <br><span class=3D""><br>#+begin_src emacs-lisp<b=
r>=C2=A0 (setq org-src-fontify-natively=C2=A0 t)<br>=C2=A0 (setq org-src-ta=
b-acts-natively t)<br>#+end_src<br><br><br></span></div><div>Normally, when=
 I program in C or java, I disable indent-tabs mode. So, I have this hook <=
br><span class=3D""><br>=C2=A0(add-hook &#39;java-mode-hook (lambda ()<br>=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 (setq c-basic-offset 4<br>=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tab-width 4<br>=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 indent-tabs-mode nil)))<br><br></sp=
an></div><div>somewhere in my init file. <br><br></div><div>If I understand=
 well what &quot;org-src-fontify-natively&quot; means, it should call the h=
ook when I edit a code block whose language is Java, and this should in tur=
n set the variable to nil. In fact, no tab is ever inserted anywhere in my =
org file, and the value od &quot;indent-tabs-mode&quot; at the buffer local=
 level is nil, exactly as in your case. I have no idea if it can be set to =
nil at the global level (the documentation seems to say that it is not poss=
ible).<br><br>Summarising<br><br>=C2=A0=C2=A0=C2=A0 no tab in the org file,=
 --&gt; a tab appears in the tex file <br><br></div><div>Thanks anyway.<spa=
n class=3D"HOEnZb"><font color=3D"#888888"><br><br>Giuseppe Lipari<br></fon=
t></span></div><div><br><br></div><div><br></div></div><div class=3D"gmail_=
extra"><div><div class=3D"h5"><br><div class=3D"gmail_quote">2015-01-11 19:=
01 GMT+01:00 Eric S Fraga <span dir=3D"ltr">&lt;<a href=3D"mailto:e.fraga@u=
cl.ac.uk" target=3D"_blank">e.fraga@ucl.ac.uk</a>&gt;</span>:<br><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex">On Sunday, 11 Jan 2015 at 17:31, Giuseppe Lipari wrote=
:<br>
<br>
[...]<br>
<span><br>
&gt; There is not tab in this snipper (I never use tabs in code, only space=
s).<br>
&gt; Unfortunately, when opening the tex file, I see that a tab has been<br=
>
&gt; introduced whenever 8 consecutive spaces are found, in particular at l=
ine 4.<br>
<br>
</span>Shot in the dark: are tabs inserted when code is auto-indented?=C2=
=A0 If so,<br>
maybe:<br>
<br>
,----[ C-h v indent-tabs-mode RET ]<br>
| indent-tabs-mode is a variable defined in `C source code&#39;.<br>
| Its value is nil<br>
| Original value was t<br>
| Local in buffer *unsent wide reply to Giuseppe Lipari*; global value is t=
he same.<br>
|<br>
|=C2=A0 =C2=A0Automatically becomes buffer-local when set.<br>
|=C2=A0 =C2=A0This variable is safe as a file local variable if its value<b=
r>
|=C2=A0 =C2=A0satisfies the predicate `booleanp&#39;.<br>
|<br>
| Documentation:<br>
| Indentation can insert tabs if this is non-nil.<br>
|<br>
| You can customize this variable.<br>
|<br>
`----<br>
<span><font color=3D"#888888"><br>
--<br>
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-703-gef52=
3b.dirty<br>
</font></span></blockquote></div><br><br clear=3D"all"><br></div></div><spa=
n class=3D"">-- <br><div><div dir=3D"ltr"><div>Giuseppe Lipari<br>LIFL<br>U=
niversit=C3=A9 de Lille 1<br>blogs: <a href=3D"http://scacciamennule.blogsp=
ot.com" target=3D"_blank">http://scacciamennule.blogspot.com</a>=C2=A0 (Ita=
lian)<br></div><div><a href=3D"http://scacciamennule.blogspot.com" target=
=3D"_blank"></a><div>=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"htt=
p://okpanico" target=3D"_blank">http://okpanico</a>,<a href=3D"http://wordp=
ress.com" target=3D"_blank">wordpress.com</a>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 (Italian)</div><div>=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0<a href=3D"http://algoland.wordpress.com" target=3D"_blank">http:=
//algoland.wordpress.com</a>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 (English)<br></div></div></div></div>
</span></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature">Grant Rettke<br><a href=3D"mailto:gcr@wisdomandwonder.=
com" target=3D"_blank">gcr@wisdomandwonder.com</a> | <a href=3D"http://www.=
wisdomandwonder.com/" target=3D"_blank">http://www.wisdomandwonder.com/</a>=
<br>=E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates<br>((=CE=BB (x) (=
x x)) (=CE=BB (x) (x x)))<br>=E2=80=9CLife has become immeasurably better s=
ince I have been forced to stop taking it seriously.=E2=80=9D --Thompson<br=
></div>
</div>

--001a1134dd4c6e90b1050c66e6cc--