From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Source blocks for tiny snippets Date: Sat, 22 Oct 2011 10:08:36 -0600 Message-ID: <87zkgtypob.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHe7o-0002ZH-F0 for emacs-orgmode@gnu.org; Sat, 22 Oct 2011 12:08:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RHe7n-0001Z2-6Q for emacs-orgmode@gnu.org; Sat, 22 Oct 2011 12:08:44 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:33952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHe7n-0001Yy-36 for emacs-orgmode@gnu.org; Sat, 22 Oct 2011 12:08:43 -0400 Received: by iagf6 with SMTP id f6so7399501iag.0 for ; Sat, 22 Oct 2011 09:08:42 -0700 (PDT) In-Reply-To: (suvayu ali's message of "Sat, 22 Oct 2011 03:10:26 +0200") 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: suvayu ali Cc: org-mode mailing list suvayu ali writes: > Hi everyone, > > I was wondering what people do when they need to put a few (1 or 2) > lines of code snippets in org files? I like the syntax highlighting one > gets in an org buffer and in HTML export with code blocks. Is there some > work around other than have code blocks for every line I want to > include? > > As an example consider this paragraph: > > Edit job options for number of events and other configurations > : $ $EDITOR $GAUSSOPTS/.py > The number of events in a job can be customised with the option > : LHCbApp().EvtMax = nEvts > To run the generator only, set the property below. > : Gauss().Phases = ["Generator"] > To turn on full monitoring and dump an ntuple to a root file, include > the opts files as below. It can be customised further to suit the needs. > : importOptions('$GAUSSOPTS/.opts') > > In the above example you have a mix of bash and python snippets. > Currently there is no more concise way to specify code blocks other than the normal code block format. Although it doesn't currently exist maybe an option could be added to hide the #+BEGIN/END_SRC lines so that they don't appear in the buffer. That combined with a helper for specifying code blocks (I use yasnippets for this) should serve. Best -- Eric -- Eric Schulte http://cs.unm.edu/~eschulte/