emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug] Code snippets are not getting numbered
@ 2014-01-28  9:37 Jambunathan K
  2014-01-28 20:22 ` John Kitchin
  2014-01-28 21:11 ` Nicolas Goaziou
  0 siblings, 2 replies; 5+ messages in thread
From: Jambunathan K @ 2014-01-28  9:37 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Nicolas Goaziou


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---

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

* Re: [bug] Code snippets are not getting numbered
  2014-01-28  9:37 [bug] Code snippets are not getting numbered Jambunathan K
@ 2014-01-28 20:22 ` John Kitchin
  2014-01-28 21:11 ` Nicolas Goaziou
  1 sibling, 0 replies; 5+ messages in thread
From: John Kitchin @ 2014-01-28 20:22 UTC (permalink / raw)
  To: Jambunathan K; +Cc: Nicolas Goaziou, emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 2005 bytes --]

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 <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                  (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---
>
>
>

[-- Attachment #2: Type: text/html, Size: 2671 bytes --]

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

* Re: [bug] Code snippets are not getting numbered
  2014-01-28  9:37 [bug] Code snippets are not getting numbered Jambunathan K
  2014-01-28 20:22 ` John Kitchin
@ 2014-01-28 21:11 ` Nicolas Goaziou
  2014-01-28 21:24   ` Eric Schulte
  1 sibling, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2014-01-28 21:11 UTC (permalink / raw)
  To: Jambunathan K; +Cc: emacs-orgmode, Eric Schulte

Hello,

Jambunathan K <kjambunathan@gmail.com> writes:

> Code snippets are not getting numbered... Also take a look at
> `org-export-resolve-coderef'.
>
> The below example is from (info "(org) Literal examples")
>
> #+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.

Thank you for reporting it.

The problem is one week old (dde6af3a6230b37aabfb4f75c2dee89433958375).
When trying to fix something I broke another part.

IIUC, there are two "flags" types in `org-babel-exp-code'. One is
the :flags parameter and the other one are the switches of the source
block. Unfortunately, you can have only one at a time since they are
stored in an alist (the first one shadows the other one).

I think a correct solution would be to rename switches "switches" and
add them to `org-babel-exp-code-template'.

Eric, what do you think?


Regards,

-- 
Nicolas Goaziou

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

* Re: [bug] Code snippets are not getting numbered
  2014-01-28 21:11 ` Nicolas Goaziou
@ 2014-01-28 21:24   ` Eric Schulte
  2014-01-29  8:08     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Schulte @ 2014-01-28 21:24 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Jambunathan K

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Jambunathan K <kjambunathan@gmail.com> writes:
>
>> Code snippets are not getting numbered... Also take a look at
>> `org-export-resolve-coderef'.
>>
>> The below example is from (info "(org) Literal examples")
>>
>> #+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.
>
> Thank you for reporting it.
>
> The problem is one week old (dde6af3a6230b37aabfb4f75c2dee89433958375).
> When trying to fix something I broke another part.
>
> IIUC, there are two "flags" types in `org-babel-exp-code'. One is
> the :flags parameter and the other one are the switches of the source
> block. Unfortunately, you can have only one at a time since they are
> stored in an alist (the first one shadows the other one).
>
> I think a correct solution would be to rename switches "switches" and
> add them to `org-babel-exp-code-template'.
>
> Eric, what do you think?
>

That sounds reasonable to me.

>
>
> Regards,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

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

* Re: [bug] Code snippets are not getting numbered
  2014-01-28 21:24   ` Eric Schulte
@ 2014-01-29  8:08     ` Nicolas Goaziou
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Goaziou @ 2014-01-29  8:08 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode, Jambunathan K

Hello,

Eric Schulte <schulte.eric@gmail.com> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> IIUC, there are two "flags" types in `org-babel-exp-code'. One is
>> the :flags parameter and the other one are the switches of the source
>> block. Unfortunately, you can have only one at a time since they are
>> stored in an alist (the first one shadows the other one).
>>
>> I think a correct solution would be to rename switches "switches" and
>> add them to `org-babel-exp-code-template'.
>>
>> Eric, what do you think?
>>
>
> That sounds reasonable to me.

Done in maint.


Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2014-01-29  8:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-28  9:37 [bug] Code snippets are not getting numbered Jambunathan K
2014-01-28 20:22 ` John Kitchin
2014-01-28 21:11 ` Nicolas Goaziou
2014-01-28 21:24   ` Eric Schulte
2014-01-29  8:08     ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).