Re: [O] Poll: new keybinding for org-insert-structure-template?

2017-12-11 Thread Nicolas Goaziou
Hello,

Rasmus  writes:

> Nicolas, are there any public interfaces to make ox export like
> interfaces?

No, there isn't. However, Org provides `org-mks'.

Regards,

-- 
Nicolas Goaziou



Re: [O] Poll: new keybinding for org-insert-structure-template?

2017-12-11 Thread Rasmus
Hi,

>> Let me know when you want me to do the change to strings.
>
> No time like the present! I don't think there's anything else remaining
> to be done.

One stumbling block is how to input key strings to
org-insert-structure-template.  Currently, it employs read-key which is
really fast.  The other easy alternative is completing-read with the keys.
However, there you’d have to click RET at the end.  The ideal interface
for inputting the keys is something like the ox expert export UI.  I
looked at the code and it seems a bit complex.

Nicolas, are there any public interfaces to make ox export like
interfaces?

Rasmus

-- 
m-mm-mmm- bacon!




Re: [O] Problem with J Source Code Blocks in Org Mode

2017-12-11 Thread Nicolas Goaziou
Hello,

Bill Harris  writes:

> I recently tried to set up J as described in http://orgmode.org/worg/
> org-contrib/babel/languages/ob-doc-J.html, starting by loading j-mode from
> stable melpa, but I get an org-babel error output when I try to execute a J
> source code block: "/bin/bash: jconsole: command not found".

I am not usuing ob-J but maybe a full backtrace would help. Make sure to
run Org uncompiled before.

Regards,

-- 
Nicolas Goaziou



Re: [O] Irrelevant src blocks can break noweb expansion

2017-12-11 Thread Nicolas Goaziou
Hello,

"Berry, Charles"  writes:

> I used to avoid this by `(setq org-babel-use-quick-and-dirty-noweb-expansion 
> t)'.
>
> This illustrates the issue:
>
> #+begin_src org
>
>   ,* abc
>
>   ,#+begin_src R :comment (message "running on empty")
>
>   ,#+end_src
>
>   ,#+begin_src R :noweb yes
>   1
>   ,#+end_src
>
>
> #+end_src
>
> The irrelevant, unnamed, empty src block its consulted via
> org-babel-get-src-block-info.

When? AFAICT, the second block doesn't contain any Noweb reference, so
there is nothing to consult in the first place. IOW, something is
missing in your recipe.

Also, `org-babel-use-quick-and-dirty-noweb-expansion' was intended to
skip properties check when collecting Noweb references from the buffer.
I.e., Org would only trust "name" keyword and ":noweb-ref" header
argument. Since there is no property in your example, I fail to see why
`org-babel-use-quick-and-dirty-noweb-expansion' would apply here.

Regards,

-- 
Nicolas Goaziou



Re: [O] Is it possible to pass variable to variables of src block?

2017-12-11 Thread Ihor Radchenko
Hi David,

One thing you can do is to make a code block, which will generate
another code block, running your script with different arguments.
Let me illustrate with a simple example:

#+name: printecho
#+BEGIN_SRC sh :var a=1
  echo $a;
#+END_SRC

#+name: genscript
#+BEGIN_SRC sh :var cmd="printecho" :results raw output  :wrap "src sh :noweb 
yes :results output"
  echo "cat << EOF"
  for x in "1" "2" "3" "4" "5" "6" "something"; do echo "<<$cmd(a=\"$x\")>>"; 
done
#+END_SRC

#+RESULTS: genscript
#+BEGIN_src sh :noweb yes :results output
  cat << EOF
  <>
  <>
  <>
  <>
  <>
  <>
  <>
#+END_src

#+RESULTS:
: 1
: 2
: 3
: 4
: 5
: 6
: something

Hope it helps.

P.S. Does anyone know why the following does not evaluate noweb
recursively?

#+BEGIN_SRC sh :noweb yes :results output 
  <>
#+END_SRC

Regards,
Ihor

Xi Shen  writes:

> Hi Michael,
>
> Yes, I think this is a way to my previous question. But what I really want
> to achieve is to loop through a list of server names and execute a script
> on them.
>
> Say I have 20 different database server. How can I do a loop with each
> server?
>
>
> Regards,
> David
>
>
> On Wed, Dec 6, 2017 at 5:34 PM Michael Welle  wrote:
>
>> Hello,
>>
>> Xi Shen  writes:
>>
>> > Hi,
>> >
>> > http://orgmode.org/manual/var.html
>> >
>> > This wiki explains how to use variable inside a src block. But I wonder
>> if
>> > it is possible to specify variable to the variables in the src
>> definition.
>> >
>> > E.g. for the sql src block, I want to execute a script on different
>> server.
>> > I want to define a variable for the ":dbhost" variable.
>> did you think about something like this?
>>
>>
>> (setq hmw/dbhost "db1")
>>
>> #+BEGIN_SRC sql :dbhost (symbol-value 'hmw/dbhost) :dbuser weather
>> :database environment :engine postgresql
>> select time, temperature from weather limit 20;
>> #+END_SRC
>>
>> Regards
>> hmw
>>
>>

-- 
Ihor Radchenko,
PhD Student
Singapore University of Technology and Design,
8 Somapah Road Singapore 487372
Email: yanta...@gmail.com, ihor_radche...@mymail.sutd.edu.sg
Tel: +6584017977


signature.asc
Description: PGP signature


Re: [O] Is it possible to pass variable to variables of src block?

2017-12-11 Thread Xi Shen
Hi Michael,

Yes, I think this is a way to my previous question. But what I really want
to achieve is to loop through a list of server names and execute a script
on them.

Say I have 20 different database server. How can I do a loop with each
server?


Regards,
David


On Wed, Dec 6, 2017 at 5:34 PM Michael Welle  wrote:

> Hello,
>
> Xi Shen  writes:
>
> > Hi,
> >
> > http://orgmode.org/manual/var.html
> >
> > This wiki explains how to use variable inside a src block. But I wonder
> if
> > it is possible to specify variable to the variables in the src
> definition.
> >
> > E.g. for the sql src block, I want to execute a script on different
> server.
> > I want to define a variable for the ":dbhost" variable.
> did you think about something like this?
>
>
> (setq hmw/dbhost "db1")
>
> #+BEGIN_SRC sql :dbhost (symbol-value 'hmw/dbhost) :dbuser weather
> :database environment :engine postgresql
> select time, temperature from weather limit 20;
> #+END_SRC
>
> Regards
> hmw
>
>


Re: [O] Bug: subtree archiving when Archive is not final headline yields bad visibility [8.2.10 (release_8.2.10 @ /usr/share/emacs/25.2+gg1+12/lisp/org/)]

2017-12-11 Thread Nicolas Goaziou
Allen Li  writes:

> Archiving DOES move point, it's just a question of where it moves
> point to.  It should not be moving point to the archived heading.
> Examples (^ is point):
>
>   * Foo
>   ** A
>   ** ^B
>   ** C
>   ** Archive :ARCHIVE:...
>
> Archiving to a separate file yields:
>
>   * Foo
>   ** A
>   ^** C
>   ** Archive :ARCHIVE:...
>
> Archiving to a subtree yields:
>
>   * Foo
>   ** A
>   ^** C
>   ** Archive :ARCHIVE:...
>
> BUT if the Archive heading isn’t last:
>
>   * Foo
>   ** Archive :ARCHIVE:...
>   ** A
>   ** ^B
>   ** C
>
> Archiving to a separate file yields:
>
>   * Foo
>   ** Archive :ARCHIVE:...
>   ** A
>   ^** C
>
> Archiving to a subtree yields:
>
>   * Foo
>   ** Archive :ARCHIVE:
>   *** B^...
>   ** A
>   ** C

I see. Fixed. Thank you.

Regards,



Re: [O] Bug: subtree archiving when Archive is not final headline yields bad visibility [8.2.10 (release_8.2.10 @ /usr/share/emacs/25.2+gg1+12/lisp/org/)]

2017-12-11 Thread Allen Li
On Mon, Dec 11, 2017 at 6:10 AM, Nicolas Goaziou  wrote:
> Hello,
>
> Allen Li  writes:
>
>> On Wed, Dec 6, 2017 at 12:19 PM, Allen Li  wrote:
>>> (Can reproduce with Org 9.1.3, submitting with emacs -Q)
>>>
>>> Using a file tmp.org:
>>>
>>>   * Foo
>>>   ** Archive :ARCHIVE:
>>>   *** Test
>>>   :PROPERTIES:
>>>   :ARCHIVE_TIME: 2017-12-06 Wed 12:13
>>>   :END:
>>>   ** Bar
>>>
>>> This appears like so with default visibility:
>>>
>>>   * Foo
>>>   ** Archive :ARCHIVE:...
>>>   ** Bar
>>>
>>> Archiving Bar with C-c C-x A yields:
>>>
>>>   * Foo
>>>   ** Archive :ARCHIVE:...
>>>   *** Bar...
>>>
>>> Expected visibility:
>>>
>>>   * Foo
>>>   ** Archive :ARCHIVE:...
>
> AFAICT, the action leaves point on the just archived sub-heading. As
> a consequence, it has to visible.
>
> Your expected visibility means the function should move point. Why would
> that be better than letting it on the headline you just operated on?

Archiving DOES move point, it's just a question of where it moves
point to.  It should not be moving point to the archived heading.
Examples (^ is point):

  * Foo
  ** A
  ** ^B
  ** C
  ** Archive :ARCHIVE:...

Archiving to a separate file yields:

  * Foo
  ** A
  ^** C
  ** Archive :ARCHIVE:...

Archiving to a subtree yields:

  * Foo
  ** A
  ^** C
  ** Archive :ARCHIVE:...

BUT if the Archive heading isn’t last:

  * Foo
  ** Archive :ARCHIVE:...
  ** A
  ** ^B
  ** C

Archiving to a separate file yields:

  * Foo
  ** Archive :ARCHIVE:...
  ** A
  ^** C

Archiving to a subtree yields:

  * Foo
  ** Archive :ARCHIVE:
  *** B^...
  ** A
  ** C

The implementation is painfully inconsistent.



Re: [O] Parsing org table from Linux command line

2017-12-11 Thread John Kitchin
I think you just put Listing 7 in a file called py_org_table.py on your
Python path, or you could just integrate it into the script.

ST writes:

> Thank you very much!
>
> Is py_org_table.py part of a bigger library? Where can I find it?
>
> Thank you!
>
>
> On Sun, 2017-12-10 at 18:12 -0800, John Kitchin wrote:
>> Check out Listing 7 in
>> http://pubs.acs.org/doi/pdf/10.1021/acscatal.5b00538.
>> 
>> It is a pretty minimal Python script to get data from a table. You could
>> then use it to print column 3 to stdout maybe so it could get piped to
>> mail, or build up some command you can call.
>> 
>> ST writes:
>> 
>> > Hello,
>> >
>> > I have an org table and its third column are emails. I would like to
>> > send an email from command line (with the "mail" cli tool) to all those
>> > addresses.
>> >
>> > 1. How do I extract them from the table and pass to CC of "mail"?
>> >
>> > 2. Is the same possible somehow if I have several tables with different
>> > #+TBLNAMEs: in the same file?
>> >
>> > Thank you in advance!
>> 
>> 


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



Re: [O] [PATCH]: Fix ob-haskell.el to work with custom ghci prompts

2017-12-11 Thread Nicolas Goaziou
Hello,

Doro Rose  writes:

> Nicolas Goaziou  writes:
>
>> Fair enough. Could you provide a proper commit message and send the
>> patch again?
>
> Here's the patch.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] Bug: subtree archiving when Archive is not final headline yields bad visibility [8.2.10 (release_8.2.10 @ /usr/share/emacs/25.2+gg1+12/lisp/org/)]

2017-12-11 Thread Nicolas Goaziou
Hello,

Allen Li  writes:

> On Wed, Dec 6, 2017 at 12:19 PM, Allen Li  wrote:
>> (Can reproduce with Org 9.1.3, submitting with emacs -Q)
>>
>> Using a file tmp.org:
>>
>>   * Foo
>>   ** Archive :ARCHIVE:
>>   *** Test
>>   :PROPERTIES:
>>   :ARCHIVE_TIME: 2017-12-06 Wed 12:13
>>   :END:
>>   ** Bar
>>
>> This appears like so with default visibility:
>>
>>   * Foo
>>   ** Archive :ARCHIVE:...
>>   ** Bar
>>
>> Archiving Bar with C-c C-x A yields:
>>
>>   * Foo
>>   ** Archive :ARCHIVE:...
>>   *** Bar...
>>
>> Expected visibility:
>>
>>   * Foo
>>   ** Archive :ARCHIVE:...

AFAICT, the action leaves point on the just archived sub-heading. As
a consequence, it has to visible.

Your expected visibility means the function should move point. Why would
that be better than letting it on the headline you just operated on?

>> AFAIK, there is no special location in the file for archived subtrees,
>> i.e., there is nothing wrong with
>>
>>   * Some projects
>>   ** Some item...
>>   ** Archive :ARCHIVE:...
>>   ** New entry...
>
> This bug means that the Archive headline's position is significant.

I fail to see how you draw such a conclusion.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Inline src block results no longer exported

2017-12-11 Thread Nicolas Goaziou
Hello,

"Berry, Charles"  writes:

> This commit
>
> ---
>   commit 5f5d82ed516b7b385a9258271becbfa247e94af3
>   Author: Nicolas Goaziou 
>   Date:   Tue Nov 21 22:25:17 2017 +0100
>
>   Remove second pass for macro expansion
> ---
>
> breaks the processing of inline src block results wrapped as {{{results(=my 
> result=)}}}.
>
> ECM:
>
> Copy the follow org block to a buffer and run `C-c C-e l L y y'
>
> #+begin_src org
>   See nothing: src_emacs-lisp{"Hello World"}
>
>   See something: src_emacs-lisp[:results raw]{ "Raw Results" }
> #+end_src
>
>
> The result will be
>
> #+begin_example 
> See nothing: 
>
> See something: Raw Results
> #+end_example
>
> missing the Hello World.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Parsing org table from Linux command line

2017-12-11 Thread ST
Thank you very much!

Is py_org_table.py part of a bigger library? Where can I find it?

Thank you!


On Sun, 2017-12-10 at 18:12 -0800, John Kitchin wrote:
> Check out Listing 7 in
> http://pubs.acs.org/doi/pdf/10.1021/acscatal.5b00538.
> 
> It is a pretty minimal Python script to get data from a table. You could
> then use it to print column 3 to stdout maybe so it could get piped to
> mail, or build up some command you can call.
> 
> ST writes:
> 
> > Hello,
> >
> > I have an org table and its third column are emails. I would like to
> > send an email from command line (with the "mail" cli tool) to all those
> > addresses.
> >
> > 1. How do I extract them from the table and pass to CC of "mail"?
> >
> > 2. Is the same possible somehow if I have several tables with different
> > #+TBLNAMEs: in the same file?
> >
> > Thank you in advance!
> 
> 




Re: [O] Problems with Org-mode & Minted

2017-12-11 Thread jerome moliere
Hi all,
thanks Alan , after unifying the syntax it works like a charm..
Problem solved!!!

Kind regards

J.MOLIERE - Mentor/J


2017-12-07 14:12 GMT+01:00 jerome moliere :

> Thanks Alan I wondered about this strange syntax mix ..
> I will investigate , following thi strack...
>
> Regards
>
> J.MOLIERE - Mentor/J
>
>
> 2017-12-07 11:18 GMT+01:00 Alan Schmitt :
>
>> Hello,
>>
>> On 2017-12-07 10:42, jerome moliere  writes:
>>
>> > org-latex-minted-options   '(("frame" "lines") ("linenos=true")
>> > ("fontsize=\scriptsize") )
>>
>> I think this is wrong, you should have two strings in each list. Have
>> you tried
>> '(("frame" "lines") ("linenos" "true") ("fontsize" "\\scriptsize")
>> ?
>>
>> Alan
>>
>> --
>> OpenPGP Key ID : 040D0A3B4ED2E5C7
>> Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-11: 405.14, 2016-11: 403.53
>>
>
>