emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* switch parsing in babel
@ 2016-03-27 23:17 John Kitchin
  2016-03-28  9:04 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: John Kitchin @ 2016-03-27 23:17 UTC (permalink / raw)
  To: Org Mode Mailing List

I am trying to make a new source block that looks like this:

#+BEGIN_SRC obabel -icml -osmi
[CH4]
#+END_SRC

This gets parsed to:

(src-block
 (:language "obabel" :switches "-i" :parameters "cml -osmi" :begin 190 :end 240 :number-lines nil :preserve-indent t :retain-labels t :use-labels t :label-fmt nil :hiddenp nil :value "[CH4] \n" :post-blank 1 :post-affiliated 190 :parent nil))

Is that correct? I would have thought that 
1. The first switch should be -icml
2. -osmi would also be a switch.

If I go with -i -o, then they are both listed as switches.


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

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

* Re: switch parsing in babel
  2016-03-27 23:17 switch parsing in babel John Kitchin
@ 2016-03-28  9:04 ` Nicolas Goaziou
  2016-03-28 12:36   ` John Kitchin
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2016-03-28  9:04 UTC (permalink / raw)
  To: John Kitchin; +Cc: Org Mode Mailing List

Hello,

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> I am trying to make a new source block that looks like this:
>
> #+BEGIN_SRC obabel -icml -osmi
> [CH4]
> #+END_SRC
>
> This gets parsed to:
>
> (src-block
>  (:language "obabel" :switches "-i" :parameters "cml -osmi" :begin
> 190 :end 240 :number-lines nil :preserve-indent t :retain-labels
> t :use-labels t :label-fmt nil :hiddenp nil :value "[CH4]
> \n" :post-blank 1 :post-affiliated 190 :parent nil))
>
> Is that correct? I would have thought that 
> 1. The first switch should be -icml
> 2. -osmi would also be a switch.

This is incorrect, but not in the way you think.

There is no concatenation for switches in Org syntax, so it should be
parsed as

  :switches nil :parameters -icml -osmi

which looks wrong anyway.

Maybe you're simply mis-using switches here, which are reserved to Org?


Regards,

-- 
Nicolas Goaziou

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

* Re: switch parsing in babel
  2016-03-28  9:04 ` Nicolas Goaziou
@ 2016-03-28 12:36   ` John Kitchin
  0 siblings, 0 replies; 3+ messages in thread
From: John Kitchin @ 2016-03-28 12:36 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode Mailing List


Nicolas Goaziou writes:

> Hello,
>
> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
>> I am trying to make a new source block that looks like this:
>>
>> #+BEGIN_SRC obabel -icml -osmi
>> [CH4]
>> #+END_SRC
>>
>> This gets parsed to:
>>
>> (src-block
>>  (:language "obabel" :switches "-i" :parameters "cml -osmi" :begin
>> 190 :end 240 :number-lines nil :preserve-indent t :retain-labels
>> t :use-labels t :label-fmt nil :hiddenp nil :value "[CH4]
>> \n" :post-blank 1 :post-affiliated 190 :parent nil))
>>
>> Is that correct? I would have thought that
>> 1. The first switch should be -icml
>> 2. -osmi would also be a switch.
>
> This is incorrect, but not in the way you think.
>
> There is no concatenation for switches in Org syntax, so it should be
> parsed as
>
>   :switches nil :parameters -icml -osmi
>
> which looks wrong anyway.
>
> Maybe you're simply mis-using switches here, which are reserved to Org?

It could be. I get it now, I was looking at
http://orgmode.org/guide/Working-With-Source-Code.html

#+NAME: <name>
#+BEGIN_SRC <language> <switches> <header arguments>
<body>
#+END_SRC

and I just noticed that "<switches> can be used to control export of the
code block" which isn't what I was trying to do with it.

>
>
> Regards,


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

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

end of thread, other threads:[~2016-03-28 12:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-27 23:17 switch parsing in babel John Kitchin
2016-03-28  9:04 ` Nicolas Goaziou
2016-03-28 12:36   ` John Kitchin

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