From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: generating org headings from a source block Date: Tue, 10 Nov 2015 11:31:03 -0500 Message-ID: References: <87wptqg7k5.fsf@alphaville.usersys.redhat.com> <87si4dg79b.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c3c6be5bcf270524323c0c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwBp2-00074l-SB for emacs-orgmode@gnu.org; Tue, 10 Nov 2015 11:31:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwBp1-0004jN-Up for emacs-orgmode@gnu.org; Tue, 10 Nov 2015 11:31:04 -0500 Received: from mail-ig0-x230.google.com ([2607:f8b0:4001:c05::230]:36704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwBp1-0004jJ-Oz for emacs-orgmode@gnu.org; Tue, 10 Nov 2015 11:31:03 -0500 Received: by igcph11 with SMTP id ph11so53594107igc.1 for ; Tue, 10 Nov 2015 08:31:03 -0800 (PST) In-Reply-To: <87si4dg79b.fsf@alphaville.usersys.redhat.com> 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 Cc: Org Mode --001a11c3c6be5bcf270524323c0c Content-Type: text/plain; charset=UTF-8 On Tue, Nov 10, 2015 at 11:16 AM, Nick Dokos wrote: > > > Pass the level as a parameter? > > > > Can I pass the level of the current heading as a parameter, e.g.: > > > > where obviously CURRENT-ORG-LEVEL is some function I don't know how to > access? > > > > You can at the very least set the level manually: > > #+BEGIN_SRC elisp :results output raw :var level=3 > ... > > by just eyeballing where the source block is in your file. > I think that's easy and does not require any programming. > You just have to remember to change the level when you cut > and paste the code block to other places. > > There is org-current-level though if you want to go that way. > > :var level=(1+ (org-current-level)) works great. Thank you Nick! --001a11c3c6be5bcf270524323c0c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Tue, Nov 10, 2015 at 11:16 AM, Nick Dokos <ndokos@gmail.com><= /span> wrote:

>=C2=A0 =C2=A0 =C2=A0Pass the level as a parameter?
>
> Can I pass the level of the current heading as a parameter, e.g.:
>=C2=A0
> where obviously CURRENT-ORG-LEVEL is some function I don&= #39;t know how to access?
>

You can at the very least set the level manually:

#+BEGIN_SRC elisp :results output raw :var level=3D3
...

by just eyeballing where the source block is in your file.
I think that's easy and does not require any programming.
You just have to remember to change the level when you cut
and paste the code block to other places.

There is org-current-level though if you want to go that way.

:var level=3D(1+ (org-current-level))
works great.=C2=A0 Thank you Nick!
--001a11c3c6be5bcf270524323c0c--