From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giuseppe Lipari Subject: Re: Tabs in export of code Date: Sun, 11 Jan 2015 19:30:59 +0100 Message-ID: References: <87lhl96vsq.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d0443066e5edc58050c6497b8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YANHx-0008Kd-VW for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 13:31:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YANHw-0005Tb-9Q for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 13:31:01 -0500 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:39134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YANHv-0005TX-VQ for emacs-orgmode@gnu.org; Sun, 11 Jan 2015 13:31:00 -0500 Received: by mail-wi0-f173.google.com with SMTP id r20so10682698wiv.0 for ; Sun, 11 Jan 2015 10:30:59 -0800 (PST) In-Reply-To: <87lhl96vsq.fsf@ucl.ac.uk> 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 , emacs-orgmode@gnu.org --f46d0443066e5edc58050c6497b8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 call 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 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 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 is > 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 > --=20 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) --f46d0443066e5edc58050c6497b8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dear Eric,

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

#+begin_src emacs= -lisp
=C2=A0 (setq org-src-fontify-natively=C2=A0 t)
=C2=A0 (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 <= 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 i= n my init file.

If I understand well what "org-src-= fontify-natively" means, it should call the hook when I edit a code bl= ock whose language is Java, and this should in turn set the variable to nil= . In fact, no tab is ever inserted anywhere in my org file, and the value o= d "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=

=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.frag= a@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
Univ= ersit=C3=A9 de Lille 1
blogs: http://scacciamennule.blogspot.com=C2=A0 (Italia= n)
=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://a= lgoland.wordpress.com=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (English)
--f46d0443066e5edc58050c6497b8--