From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: [bug] Code snippets are not getting numbered Date: Tue, 28 Jan 2014 15:22:14 -0500 Message-ID: References: <87iot48n1h.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bdc9ebc774a7004f10d948b Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8FAn-0004pc-T4 for emacs-orgmode@gnu.org; Tue, 28 Jan 2014 15:22:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8FAm-0002pB-EJ for emacs-orgmode@gnu.org; Tue, 28 Jan 2014 15:22:17 -0500 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:54840) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8FAm-0002p3-20 for emacs-orgmode@gnu.org; Tue, 28 Jan 2014 15:22:16 -0500 Received: by mail-pa0-f47.google.com with SMTP id kp14so823944pab.6 for ; Tue, 28 Jan 2014 12:22:14 -0800 (PST) In-Reply-To: <87iot48n1h.fsf@gmail.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 To: Jambunathan K Cc: Nicolas Goaziou , "emacs-orgmode@gnu.org" --047d7bdc9ebc774a7004f10d948b Content-Type: text/plain; charset=ISO-8859-1 Sorry if this has been sent more than once. I was trying to reply from gnus, and it isn't clear that happened. The code block in that example is also missing a closing parenthesis. this post reminded me of this cool feature of source blocks, so I tried it out. The code block itself does not seem to run, even after fixing the closing parenthesis. #+BEGIN_SRC emacs-lisp -r (save-excursion (ref:sc) (goto-char (point-min))) (ref:jump) #+END_SRC In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]] jumps to point-min. I get: save-excursion: Symbol's function definition is void: ref:sc unless I put a ; (comment) in front of (ref:sc) and (ref:jump). Then the block runs, but still does not export correctly. When I export this to a pdf file, the ref: is removed from the references, but (sc) and (jump) remain in the code block, and as Jambunathan noted, the links in the text are not replaced by line numbers. I hope that helps track down the problem! my org-version is 8.2.5g, but I also see the problem with 7.9.3f. Let me know if other information would be helpful. thanks, Thanks. John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu On Tue, Jan 28, 2014 at 4:37 AM, Jambunathan K wrote: > > Nicolas > > Code snippets are not getting numbered... Also take a look at > `org-export-resolve-coderef'. > > The below example is from (info "(org) Literal examples") > > --8<---------------cut here---------------start------------->8--- > #+BEGIN_SRC emacs-lisp -n -r > (save-excursion (ref:sc) > (goto-char (point-min)) (ref:jump) > #+END_SRC > > In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]] > jumps to point-min. > --8<---------------cut here---------------end--------------->8--- > > > --047d7bdc9ebc774a7004f10d948b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Sorry if this has been sent more than once. I was try= ing to reply from gnus, and it isn't clear that happened.

The co= de block in that example is also missing a closing parenthesis.

thi= s post reminded me of this cool feature of source blocks, so I tried
it out. The code block itself does not seem to run, even after fixing
th= e closing parenthesis.

#+BEGIN_SRC emacs-lisp -r
(save-excursion= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (ref:sc)
=A0 (goto-c= har (point-min)))=A0=A0=A0=A0=A0=A0 (ref:jump)
#+END_SRC

In line [[(sc)]] we remember the current position.=A0 [[(j= ump)][Line
(jump)]] jumps to point-min.



I get:

sav= e-excursion: Symbol's function definition is void: ref:sc

unless= I put a ; (comment) in front of (ref:sc) and (ref:jump). Then the
block runs, but still does not export correctly.

When I export this = to a pdf file, the ref: is removed from the
references, but (sc) and (ju= mp) remain in the code block, and as
Jambunathan noted, the links in the= text are not replaced by line numbers.

I hope that helps track down the problem!

my org-version i= s 8.2.5g, but I also see the problem with 7.9.3f. Let me know if other info= rmation would be helpful. thanks,

Thanks.

John

-----------------------------------
J= ohn Kitchin
Associate Professor
Doherty Hall A207F
Department of C= hemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213 412-268-7803
http://kitchingroup.cheme.cmu.edu



On Tue, Jan 28, 2014 at 4:37 AM, Jambuna= than K <kjambunathan@gmail.com> wrote:

Nicolas

Code snippets are not getting numbered... Also take a look at
`org-export-resolve-coderef'.

The below example is from (info "(org) Literal examples")

--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC emacs-lisp -n -r
(save-excursion =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(ref:sc)
=A0 =A0(goto-char (point-min)) =A0 =A0 =A0 (ref:jump)
#+END_SRC

In line [[(sc)]] we remember the current position. =A0[[(jump)][Line (jump)= ]]
jumps to point-min.
--8<---------------cut here---------------end--------------->8---



--047d7bdc9ebc774a7004f10d948b--