* [Babel] Preserving tabs in code blocks
@ 2011-08-26 1:13 Bernt Hansen
2011-08-26 4:11 ` Nick Dokos
0 siblings, 1 reply; 3+ messages in thread
From: Bernt Hansen @ 2011-08-26 1:13 UTC (permalink / raw
To: emacs-orgmode
Hi all,
I want to include the contents of a file which requires TABS between
fields in a #+begin_src ... #+end_src block.
When I use C-c ' to edit the block the TABS are all converted back to
spaces. I want to be able to tangle the file and preserve the TABS
which are required as input to some tool chain.
Is there some mode I can use to preserve the TABS?
For example:
#+begin_src fundamental :tangle testtabs.txt
These words
are separated
by tabs.
#+end_src
I need to be able to create the testtabs.txt file with the TAB
characters intact otherwise it fails as input to the tool chain (which I
have no control over).
Is there any way to do this?
For now I'm keeping the input in a separate file, but I would much
prefer to have it in a babel source block in my notes for future
reference.
Thanks,
Bernt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Babel] Preserving tabs in code blocks
2011-08-26 1:13 [Babel] Preserving tabs in code blocks Bernt Hansen
@ 2011-08-26 4:11 ` Nick Dokos
2011-08-26 10:14 ` Bernt Hansen
0 siblings, 1 reply; 3+ messages in thread
From: Nick Dokos @ 2011-08-26 4:11 UTC (permalink / raw
To: Bernt Hansen; +Cc: nicholas.dokos, emacs-orgmode
Bernt Hansen <bernt@norang.ca> wrote:
> Hi all,
>
> I want to include the contents of a file which requires TABS between
> fields in a #+begin_src ... #+end_src block.
>
> When I use C-c ' to edit the block the TABS are all converted back to
> spaces. I want to be able to tangle the file and preserve the TABS
> which are required as input to some tool chain.
>
> Is there some mode I can use to preserve the TABS?
>
> For example:
>
> #+begin_src fundamental :tangle testtabs.txt
> These words
> are separated
> by tabs.
> #+end_src
>
> I need to be able to create the testtabs.txt file with the TAB
> characters intact otherwise it fails as input to the tool chain (which I
> have no control over).
>
> Is there any way to do this?
>
> For now I'm keeping the input in a separate file, but I would much
> prefer to have it in a babel source block in my notes for future
> reference.
>
Try setting org-src-preserve-indentation to t. If you change the default
value of indent-tabs-mode to nil (as I do), then you might have problems
in any case: inserted tabs will be changed to spaces. But if you have it
left at the default t, then I think this works.
Nick
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Babel] Preserving tabs in code blocks
2011-08-26 4:11 ` Nick Dokos
@ 2011-08-26 10:14 ` Bernt Hansen
0 siblings, 0 replies; 3+ messages in thread
From: Bernt Hansen @ 2011-08-26 10:14 UTC (permalink / raw
To: nicholas.dokos; +Cc: emacs-orgmode
Nick Dokos <nicholas.dokos@hp.com> writes:
> Bernt Hansen <bernt@norang.ca> wrote:
>
>> I want to include the contents of a file which requires TABS between
>> fields in a #+begin_src ... #+end_src block.
>>
>> When I use C-c ' to edit the block the TABS are all converted back to
>> spaces. I want to be able to tangle the file and preserve the TABS
>> which are required as input to some tool chain.
>>
>> Is there some mode I can use to preserve the TABS?
> Try setting org-src-preserve-indentation to t. If you change the default
> value of indent-tabs-mode to nil (as I do), then you might have problems
> in any case: inserted tabs will be changed to spaces. But if you have it
> left at the default t, then I think this works.
Thanks Nick!
That works great :)
Regards,
Bernt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-08-26 10:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-26 1:13 [Babel] Preserving tabs in code blocks Bernt Hansen
2011-08-26 4:11 ` Nick Dokos
2011-08-26 10:14 ` Bernt Hansen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.