From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: Re: Tabs in export of code Date: Sun, 11 Jan 2015 15:16:15 -0600 Message-ID: References: <87lhl96vsq.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1134dd4c6e90b1050c66e6cc Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) 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 ) 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 ) 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 ; Sun, 11 Jan 2015 13:16:15 -0800 (PST) In-Reply-To: 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: Giuseppe Lipari Cc: "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 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 : > >> 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://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
Unsure but perhaps these are involved, what are your setti= ng for:

org-src-preserve-indentation

<= /div>
and

org-edit-src-content-indentation
=

On Su= n, Jan 11, 2015 at 12:30 PM, Giuseppe Lipari <giulipari@gmail.com&g= t; wrote:
Dear Eric,

thanks for your quick answer. However this = does not solve the problem.
I use source code fontification for s= ource blocks in org mode:

#+begin_src emacs-lisp=C2=A0 (setq org-src-fontify-natively=C2=A0 t)
=C2=A0 (setq org-src-ta= b-acts-natively t)
#+end_src


Normally, when= I program in C or java, I disable indent-tabs mode. So, I have this hook <= br>
=C2=A0(add-hook 'java-mode-hook (lambda ()
= =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
=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
=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)))

somewhere in my init file.

If I understand= well what "org-src-fontify-natively" 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 "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 poss= ible).

Summarising

=C2=A0=C2=A0=C2=A0 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 space= s).
> Unfortunately, when opening the tex file, I see that a tab has been > introduced whenever 8 consecutive spaces are found, in particular at l= ine 4.

Shot in the dark: are tabs inserted when code is auto-indented?=C2= =A0 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 is t= he same.
|
|=C2=A0 =C2=A0Automatically becomes buffer-local when set.
|=C2=A0 =C2=A0This variable is safe as a file local variable if its value |=C2=A0 =C2=A0satisfies 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-gef52= 3b.dirty



--
Giuseppe Lipari
LIFL
U= niversit=C3=A9 de Lille 1
blogs: http://scacciamennule.blogspot.com=C2=A0 (Ita= lian)
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0http://okpanico,wordpress.com=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (Italian)
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0http:= //algoland.wordpress.com=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (English)



--
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 s= ince I have been forced to stop taking it seriously.=E2=80=9D --Thompson
--001a1134dd4c6e90b1050c66e6cc--