From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Line numbers in tangled source Date: Sun, 05 Sep 2010 15:17:01 -0600 Message-ID: <87zkvvkhzk.fsf@gmail.com> References: <87y6bhczxj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=54085 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OsMau-0004oR-H0 for emacs-orgmode@gnu.org; Sun, 05 Sep 2010 17:17:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OsMaq-0002rv-3R for emacs-orgmode@gnu.org; Sun, 05 Sep 2010 17:17:42 -0400 Received: from mail-px0-f169.google.com ([209.85.212.169]:39593) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OsMap-0002qp-VJ for emacs-orgmode@gnu.org; Sun, 05 Sep 2010 17:17:40 -0400 Received: by mail-px0-f169.google.com with SMTP id 5so1606520pxi.0 for ; Sun, 05 Sep 2010 14:17:39 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: aditya siram Cc: emacs-orgmode@gnu.org Hi, This isn't the first request for customizable comments in tangled code. I've just implemented a first pass at this functionality, the variables org-babel-tangle-comment-format-beg and org-babel-tangle-comment-format-end now hold simple format string specifying how the comments surrounding code blocks should be constructed, see their documentation for more info. As an example, the following specification should yield the results you're after #+begin_src emacs-lisp :results silent (setq org-babel-tangle-comment-format-beg "{-# LINE %start-line \"%file\"= #-}" org-babel-tangle-comment-format-end "" org-babel-tangle-pad-newline) #+end_src Best -- Eric aditya siram writes: > Yes I am aware of the comments argument but it is not what I was > referring to. What I want is, if I had the following in a file called > "Haskell.org" : > * Root > Root comment > #+begin_src haskell :tangle Main.hs > =C2=A0 test =3D length > =C2=A0 main =3D print $ test [1,2,3] > #+end_src > > I would like the following output in the tangled file Main.hs: > > {-# LINE 4 "Haskell.org" #-} > test =3D length > main =3D print $ test [1,2,3] > > The line that starts with {-# LINE ... #-} is a pragma that tells the > compiler that this line corresponds to line 4 in Haskell.org and if > there is an error it will point to that file and not to Main.hs. > > Can I take it that this functionality doesn't yet exist? > > -deech > > > On Sat, Sep 4, 2010 at 8:21 AM, Eric Schulte wro= te: >> >> Hi, >> >> You can use the :comments header argument to include comments around >> tangled code blocks indicating where the code block lives in the >> original Org file. >> >> See [1] for information on the :comment header argument, and see [2] for >> information on using header arguments in general. >> >> Best -- Eric >> >> aditya siram writes: >> >> > Hi all, >> > How do I get the org file line numbers in the tangled source? This way= error >> > messages point to the org file. >> > >> > thanks ... >> > -deech >> >> Footnotes: >> [1] =C2=A0http://orgmode.org/manual/comments.html#comments >> >> [2] =C2=A0http://orgmode.org/manual/Using-header-arguments.html#Using-he= ader-arguments >>