all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* indentation across multiple source blocks
@ 2012-12-17 23:38 Tony Day
  2012-12-18 11:55 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Day @ 2012-12-17 23:38 UTC (permalink / raw
  To: emacs-orgmode


Is there an easy way to preserve indentation for a source block taking
into account previous blocks?  For (a silly) example:


* foo
:PROPERTIES:
:tangle:   yes
:END:
#+begin_src emacs-lisp
  (defun foo ()
#+end_src

#+begin_src emacs-lisp
    (bar)
#+end_src

#+begin_src emacs-lisp
  )
#+end_src

Any help much appreciated.

Tony

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

* Re: indentation across multiple source blocks
  2012-12-17 23:38 indentation across multiple source blocks Tony Day
@ 2012-12-18 11:55 ` Bastien
  2012-12-19  1:08   ` Tony Day
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2012-12-18 11:55 UTC (permalink / raw
  To: Tony Day; +Cc: emacs-orgmode

Hi Tony,

Tony Day <tonyday567@gmail.com> writes:

> Is there an easy way to preserve indentation for a source block taking
> into account previous blocks?  

No.  Besides, I don't really see a good case where it would make sense
to split functions across code blocks... surely a lack of imagination :)

-- 
 Bastien

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

* Re: indentation across multiple source blocks
  2012-12-18 11:55 ` Bastien
@ 2012-12-19  1:08   ` Tony Day
  2012-12-23  8:50     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Day @ 2012-12-19  1:08 UTC (permalink / raw
  To: Bastien; +Cc: emacs-orgmode

On 18 Dec 2012, at 22:55, Bastien <bzg@altern.org> wrote:

> Hi Tony,
> 

Hi Bastien,

Thanks for the flurry of activity :)

> Tony Day <tonyday567@gmail.com> writes:
> 
>> Is there an easy way to preserve indentation for a source block taking
>> into account previous blocks?  
> 
> No.  Besides, I don't really see a good case where it would make sense
> to split functions across code blocks... surely a lack of imagination :)

More like a terrible example.  Here's a more complicated one out in the wild (from https://github.com/renard/o-blog) - templating html creation.

https://gist.github.com/4333546

I imagine patches would be welcome :)

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

* Re: indentation across multiple source blocks
  2012-12-19  1:08   ` Tony Day
@ 2012-12-23  8:50     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2012-12-23  8:50 UTC (permalink / raw
  To: Tony Day; +Cc: emacs-orgmode

Hi Tony,

Tony Day <zygomega@gmail.com> writes:

> More like a terrible example.  Here's a more complicated one out in the
> wild (from https://github.com/renard/o-blog) - templating html creation.
>
> https://gist.github.com/4333546
>
> I imagine patches would be welcome :)

Well... spare you the sweat, because I'm not even sure we'd like such a
patch :)

Indentation is a visual clue about the structure of the code -- if you
lose the structure (like in the HTML scattered snippets of the link
above), the visual clue will does not help anymore...  imagine if you
are deep in the HTML AST and have to indent by 20 whitespaces?  That
would not help at all -- instead, you want the snippet to be read as if
it was on the top of the AST.

Anyway, perhaps that's just me...

-- 
 Bastien

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

end of thread, other threads:[~2012-12-23  8:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-17 23:38 indentation across multiple source blocks Tony Day
2012-12-18 11:55 ` Bastien
2012-12-19  1:08   ` Tony Day
2012-12-23  8:50     ` Bastien

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.