emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Babel blocks not indented
@ 2013-05-07 17:11 Julien Cubizolles
  2013-05-07 18:19 ` Eric Schulte
  0 siblings, 1 reply; 8+ messages in thread
From: Julien Cubizolles @ 2013-05-07 17:11 UTC (permalink / raw)
  To: emacs-orgmode

I'm new to babel and I'm experiencing a strange problem. A
src_block created with "<s TAB" is not indented as the heading it's
in. Here is an example:

--8<---------------cut here---------------start------------->8---
**** Export fichier texte
#+BEGIN_SRC python
  import numpy
  numpy.savetxt("foo.csv", a, delimiter=",")
#+END_SRC
--8<---------------cut here---------------end--------------->8---

The python code should be indented below the heading title "Export
fichier texte".

Julien.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Babel blocks not indented
  2013-05-07 17:11 Babel blocks not indented Julien Cubizolles
@ 2013-05-07 18:19 ` Eric Schulte
  2013-05-07 21:48   ` Julien Cubizolles
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2013-05-07 18:19 UTC (permalink / raw)
  To: Julien Cubizolles; +Cc: emacs-orgmode

Julien Cubizolles <j.cubizolles@free.fr> writes:

> I'm new to babel and I'm experiencing a strange problem. A
> src_block created with "<s TAB" is not indented as the heading it's
> in. Here is an example:
>

Try "TAB <s TAB" instead.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Babel blocks not indented
  2013-05-07 18:19 ` Eric Schulte
@ 2013-05-07 21:48   ` Julien Cubizolles
  2013-05-10  3:32     ` J. David Boyd
  0 siblings, 1 reply; 8+ messages in thread
From: Julien Cubizolles @ 2013-05-07 21:48 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

Eric Schulte <schulte.eric@gmail.com> writes:

> Julien Cubizolles <j.cubizolles@free.fr> writes:
>
>> I'm new to babel and I'm experiencing a strange problem. A
>> src_block created with "<s TAB" is not indented as the heading it's
>> in. Here is an example:
>>
>
> Try "TAB <s TAB" instead.

That's what I was doing but it seems the problem lies with
org-indent-mode and is also present with regular text. Apparently,
disabling and re-enabling seems to fix it. I'll investigate further.

Julien.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Babel blocks not indented
  2013-05-07 21:48   ` Julien Cubizolles
@ 2013-05-10  3:32     ` J. David Boyd
  2013-05-10 21:07       ` Leo Alekseyev
  2013-05-13  9:53       ` Andreas Röhler
  0 siblings, 2 replies; 8+ messages in thread
From: J. David Boyd @ 2013-05-10  3:32 UTC (permalink / raw)
  To: emacs-orgmode

Julien Cubizolles <j.cubizolles@free.fr> writes:

> Eric Schulte <schulte.eric@gmail.com> writes:
>
>> Julien Cubizolles <j.cubizolles@free.fr> writes:
>>
>>> I'm new to babel and I'm experiencing a strange problem. A
>>> src_block created with "<s TAB" is not indented as the heading it's
>>> in. Here is an example:
>>>
>>
>> Try "TAB <s TAB" instead.
>
> That's what I was doing but it seems the problem lies with
> org-indent-mode and is also present with regular text. Apparently,
> disabling and re-enabling seems to fix it. I'll investigate further.
>
> Julien.

I change my mode to whatever my src is in when I want indenting to work
properly, then change it back when I want to see it as an org file again.

Dave

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Babel blocks not indented
  2013-05-10  3:32     ` J. David Boyd
@ 2013-05-10 21:07       ` Leo Alekseyev
  2013-05-10 22:32         ` Nick Dokos
  2013-05-13  9:53       ` Andreas Röhler
  1 sibling, 1 reply; 8+ messages in thread
From: Leo Alekseyev @ 2013-05-10 21:07 UTC (permalink / raw)
  To: J. David Boyd; +Cc: Emacs orgmode

[-- Attachment #1: Type: text/plain, Size: 1491 bytes --]

On Thu, May 9, 2013 at 8:32 PM, J. David Boyd <david@adboyd.com> wrote:

> Julien Cubizolles <j.cubizolles@free.fr> writes:
>
> > Eric Schulte <schulte.eric@gmail.com> writes:
> >
> >> Julien Cubizolles <j.cubizolles@free.fr> writes:
> >>
> >>> I'm new to babel and I'm experiencing a strange problem. A
> >>> src_block created with "<s TAB" is not indented as the heading it's
> >>> in. Here is an example:
> >>>
> >>
> >> Try "TAB <s TAB" instead.
> >
> > That's what I was doing but it seems the problem lies with
> > org-indent-mode and is also present with regular text. Apparently,
> > disabling and re-enabling seems to fix it. I'll investigate further.
> >
> > Julien.
>
> I change my mode to whatever my src is in when I want indenting to work
> properly, then change it back when I want to see it as an org file again.
>
> Dave
>
>
>
I've brought this up before, but I think there's value in SRC blocks /not/
being indented, and in fact, I would love it if there were a way to make
the contents of the SRC blocks /not/ be indented (as opposed to the default
2 space offset).   Whitespace often matters, particularly when working with
Python, and every now and then I find myself having to manually delete the
extra spacing when pasting code into the Python interpreter.  Other times I
want to paste code snippets from SRC blocks into source files -- again,
indentation gets in the way.  I agree that it's aesthetically appealing,
but my workflow would be easier without it.

--Leo

[-- Attachment #2: Type: text/html, Size: 2275 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Babel blocks not indented
  2013-05-10 21:07       ` Leo Alekseyev
@ 2013-05-10 22:32         ` Nick Dokos
  2013-05-13  9:31           ` Leo Alekseyev
  0 siblings, 1 reply; 8+ messages in thread
From: Nick Dokos @ 2013-05-10 22:32 UTC (permalink / raw)
  To: emacs-orgmode

Leo Alekseyev <dnquark@gmail.com> writes:

> I've brought this up before, but I think there's value in SRC blocks
> /not/ being indented, and in fact, I would love it if there were a way
> to make the contents of the SRC blocks / not/ be indented (as opposed
> to the default 2 space offset).   Whitespace often matters,
> particularly when working with Python, and every now and then I find
> myself having to manually delete the extra spacing when pasting code
> into the Python interpreter.  Other times I want to paste code
> snippets from SRC blocks into source files -- again, indentation gets
> in the way.  I agree that it's aesthetically appealing, but my
> workflow would be easier without it.
>

> --Leo
>

Does this help?

,----
| org-edit-src-content-indentation is a variable defined in `org-src.el'.
| Its value is 2
| 
| Documentation:
| Indentation for the content of a source code block.
| This should be the number of spaces added to the indentation of the #+begin
| line in order to compute the indentation of the block content after
| editing it with M-x org-edit-src-code.  Has no effect if
| `org-src-preserve-indentation' is non-nil.
`----

-- 
Nick

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Babel blocks not indented
  2013-05-10 22:32         ` Nick Dokos
@ 2013-05-13  9:31           ` Leo Alekseyev
  0 siblings, 0 replies; 8+ messages in thread
From: Leo Alekseyev @ 2013-05-13  9:31 UTC (permalink / raw)
  To: Nick Dokos; +Cc: Emacs orgmode

[-- Attachment #1: Type: text/plain, Size: 1413 bytes --]

On Fri, May 10, 2013 at 3:32 PM, Nick Dokos <ndokos@gmail.com> wrote:

> Leo Alekseyev <dnquark@gmail.com> writes:
>
> > I've brought this up before, but I think there's value in SRC blocks
> > /not/ being indented, and in fact, I would love it if there were a way
> > to make the contents of the SRC blocks / not/ be indented (as opposed
> > to the default 2 space offset).   Whitespace often matters,
> > particularly when working with Python, and every now and then I find
> > myself having to manually delete the extra spacing when pasting code
> > into the Python interpreter.  Other times I want to paste code
> > snippets from SRC blocks into source files -- again, indentation gets
> > in the way.  I agree that it's aesthetically appealing, but my
> > workflow would be easier without it.
> >
>
> > --Leo
> >
>
> Does this help?
>
> ,----
> | org-edit-src-content-indentation is a variable defined in `org-src.el'.
> | Its value is 2
> |
> | Documentation:
> | Indentation for the content of a source code block.
> | This should be the number of spaces added to the indentation of the
> #+begin
> | line in order to compute the indentation of the block content after
> | editing it with M-x org-edit-src-code.  Has no effect if
> | `org-src-preserve-indentation' is non-nil.
> `----
>
> --
> Nick
>
>
> Yes! I had no idea this existed!  I could've sworn I've asked about this
before and came up empty :/

[-- Attachment #2: Type: text/html, Size: 2036 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Babel blocks not indented
  2013-05-10  3:32     ` J. David Boyd
  2013-05-10 21:07       ` Leo Alekseyev
@ 2013-05-13  9:53       ` Andreas Röhler
  1 sibling, 0 replies; 8+ messages in thread
From: Andreas Röhler @ 2013-05-13  9:53 UTC (permalink / raw)
  To: emacs-orgmode

[ ... ]
> I change my mode to whatever my src is in when I want indenting to work
> properly, then change it back when I want to see it as an org file again.
>
> Dave
>
>
>

Probably it would pay to have a minor mode for that, running with idle-timer and switching the mode according to SRC context.

Andreas

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-05-13  9:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07 17:11 Babel blocks not indented Julien Cubizolles
2013-05-07 18:19 ` Eric Schulte
2013-05-07 21:48   ` Julien Cubizolles
2013-05-10  3:32     ` J. David Boyd
2013-05-10 21:07       ` Leo Alekseyev
2013-05-10 22:32         ` Nick Dokos
2013-05-13  9:31           ` Leo Alekseyev
2013-05-13  9:53       ` Andreas Röhler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).