emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* New tutorial on using Emacs lisp for Org spreadsheet formulas
@ 2012-01-31 17:33 Bastien
  2012-01-31 18:33 ` Achim Gratz
  2012-02-01 15:39 ` Eric S Fraga
  0 siblings, 2 replies; 15+ messages in thread
From: Bastien @ 2012-01-31 17:33 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

I wrote a new tutorial on using Emacs lisp for Org spreadsheet formulas:
http://orgmode.org/worg/org-tutorials/org-spreadsheet-lisp-formulas.html

Enjoy,

-- 
 Bastien

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-01-31 17:33 New tutorial on using Emacs lisp for Org spreadsheet formulas Bastien
@ 2012-01-31 18:33 ` Achim Gratz
  2012-01-31 19:31   ` Nicolas Goaziou
  2012-01-31 22:29   ` Carsten Dominik
  2012-02-01 15:39 ` Eric S Fraga
  1 sibling, 2 replies; 15+ messages in thread
From: Achim Gratz @ 2012-01-31 18:33 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@altern.org> writes:

> http://orgmode.org/worg/org-tutorials/org-spreadsheet-lisp-formulas.html

Great.

Now, I've long wished that instead of cramming these increasingly long
formulas into that single #+TBLFM line one could have a :TBLFM: drawer
and put it there on multiple lines and perhaps even with comments.  How
awesome would that be?  :-)


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-01-31 18:33 ` Achim Gratz
@ 2012-01-31 19:31   ` Nicolas Goaziou
  2012-01-31 20:01     ` Achim Gratz
  2012-02-01  6:10     ` Jude DaShiell
  2012-01-31 22:29   ` Carsten Dominik
  1 sibling, 2 replies; 15+ messages in thread
From: Nicolas Goaziou @ 2012-01-31 19:31 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Hello,

Achim Gratz <Stromeko@nexgo.de> writes:

> Now, I've long wished that instead of cramming these increasingly long
> formulas into that single #+TBLFM line one could have a :TBLFM: drawer
> and put it there on multiple lines and perhaps even with comments.  How
> awesome would that be?  :-)

Multiple #+tblfm: lines would certainly be useful, as there already is
multiple #+header: lines.

Though, a table and a drawer are different elements. Affiliated keywords
shouldn't be separated from the element they belong.


Regards,

-- 
Nicolas Goaziou

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-01-31 19:31   ` Nicolas Goaziou
@ 2012-01-31 20:01     ` Achim Gratz
  2012-01-31 20:55       ` Nicolas Goaziou
  2012-02-01  6:10     ` Jude DaShiell
  1 sibling, 1 reply; 15+ messages in thread
From: Achim Gratz @ 2012-01-31 20:01 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:
> Multiple #+tblfm: lines would certainly be useful, as there already is
> multiple #+header: lines.

I still think that the syntax for these is unnecessarily clumsy.

> Though, a table and a drawer are different elements. Affiliated keywords
> shouldn't be separated from the element they belong.

Would introducing a different syntax for multiline "keyword" elements
be a possibility?  Like:

:+TBLFM:
 ; There be dragons!
:END:

#+BEGIN_SRC emacs_lisp
:+HEADERS:
  :var data1=1
  :var data2=2
:END:
  (message "data1:%S, data2:%S" data1 data2)
#END_SRC

It should look & feel like a drawer for the user, IMHO.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-01-31 20:01     ` Achim Gratz
@ 2012-01-31 20:55       ` Nicolas Goaziou
  2012-02-01  6:27         ` Achim Gratz
  0 siblings, 1 reply; 15+ messages in thread
From: Nicolas Goaziou @ 2012-01-31 20:55 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

I don't see what is clumsy with affiliated keywords.

> #+BEGIN_SRC emacs_lisp
> :+HEADERS:
>   :var data1=1
>   :var data2=2
> :END:
>   (message "data1:%S, data2:%S" data1 data2)
> #END_SRC

Src-blocks are elements. As such, they can't contain drawers. Though,
drawers can contain src-blocks.


Regards,

-- 
Nicolas Goaziou

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-01-31 18:33 ` Achim Gratz
  2012-01-31 19:31   ` Nicolas Goaziou
@ 2012-01-31 22:29   ` Carsten Dominik
  2012-02-01  6:37     ` Achim Gratz
  2012-02-01  7:14     ` Bastien
  1 sibling, 2 replies; 15+ messages in thread
From: Carsten Dominik @ 2012-01-31 22:29 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode


On 31.1.2012, at 19:33, Achim Gratz wrote:

> Bastien <bzg@altern.org> writes:
> 
>> http://orgmode.org/worg/org-tutorials/org-spreadsheet-lisp-formulas.html
> 
> Great.
> 
> Now, I've long wished that instead of cramming these increasingly long
> formulas into that single #+TBLFM line one could have a :TBLFM: drawer
> and put it there on multiple lines and perhaps even with comments.  How
> awesome would that be?  :-)

Bastien already mentions that you can use C-c '  to edit the formulas.
What is less well known is that if you press TAB in one of those formulas
in the formula editor, the list form is pretty-printed - this goes a long
way for readability and editability.

- Carsten

> 
> 
> Regards,
> Achim.
> -- 
> +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
> 
> Factory and User Sound Singles for Waldorf Blofeld:
> http://Synth.Stromeko.net/Downloads.html#WaldorfSounds
> 
> 

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-01-31 19:31   ` Nicolas Goaziou
  2012-01-31 20:01     ` Achim Gratz
@ 2012-02-01  6:10     ` Jude DaShiell
  1 sibling, 0 replies; 15+ messages in thread
From: Jude DaShiell @ 2012-02-01  6:10 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Achim Gratz, emacs-orgmode

If multiple #+TBLFM: lines do ever get into legal org-mode syntax I 
think it will be a good idea to put an integer number inside the 
#+TBLFM: label so that org-mode can know in what order to use each of 
those lines.

On Tue, 31 Jan 2012, Nicolas Goaziou wrote:

> Hello,
> 
> Achim Gratz <Stromeko@nexgo.de> writes:
> 
> > Now, I've long wished that instead of cramming these increasingly long
> > formulas into that single #+TBLFM line one could have a :TBLFM: drawer
> > and put it there on multiple lines and perhaps even with comments.  How
> > awesome would that be?  :-)
> 
> Multiple #+tblfm: lines would certainly be useful, as there already is
> multiple #+header: lines.
> 
> Though, a table and a drawer are different elements. Affiliated keywords
> shouldn't be separated from the element they belong.
> 
> 
> Regards,
> 
> 

----------------------------------------------------------------
Jude <jdashiel-at-shellworld-dot-net>
<http://www.shellworld.net/~jdashiel/nj.html>

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-01-31 20:55       ` Nicolas Goaziou
@ 2012-02-01  6:27         ` Achim Gratz
  2012-02-01 12:39           ` Nicolas Goaziou
  0 siblings, 1 reply; 15+ messages in thread
From: Achim Gratz @ 2012-02-01  6:27 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:
> I don't see what is clumsy with affiliated keywords.

Well, you write the arguments before starting the source block, getting
everything wardbacks (and I don't think that's easier to parse, but you
would know better(*)).  Then there is the verbosity of the headers
themselves, but that's an argument based on aesthetics.  Last but not
least I can never remember if any of the "#+" stuff is supposed to end
with a ":" and whether it wants another ":" in front of the arguments or
not.

(*) Reminds me I'll have to try what happens if I write header arguments
that are detached from the source block.  Devious, I know, but the
manual does not really specify anything.

>> #+BEGIN_SRC emacs_lisp
>> :+HEADERS:
>>   :var data1=1
>>   :var data2=2
>> :END:
>>   (message "data1:%S, data2:%S" data1 data2)
>> #END_SRC
>
> Src-blocks are elements. As such, they can't contain drawers.

If you look carefully, that source block above does not contain a
drawer.  It has a (hypothetical) associated multiline header argument
that happens to look and feel like a drawer.

> Though, drawers can contain src-blocks.

Is there any specification that they must fully contain them?

Anyway, that was just an idea and if nobody likes it, that's fine with
me, too.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-01-31 22:29   ` Carsten Dominik
@ 2012-02-01  6:37     ` Achim Gratz
  2012-02-01  6:56       ` Carsten Dominik
  2012-02-01  7:03       ` Bastien
  2012-02-01  7:14     ` Bastien
  1 sibling, 2 replies; 15+ messages in thread
From: Achim Gratz @ 2012-02-01  6:37 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:
> Bastien already mentions that you can use C-c '  to edit the formulas.
> What is less well known is that if you press TAB in one of those formulas
> in the formula editor, the list form is pretty-printed - this goes a long
> way for readability and editability.

Indeed I did not know that, thanks for mentioning.  But I'm just as
concerned about the look of that line when browsing the document and the
pretty-printing for edit doesn't help with that.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf Blofeld V1.15B11:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-02-01  6:37     ` Achim Gratz
@ 2012-02-01  6:56       ` Carsten Dominik
  2012-02-01  7:03       ` Bastien
  1 sibling, 0 replies; 15+ messages in thread
From: Carsten Dominik @ 2012-02-01  6:56 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode


On 1.2.2012, at 07:37, Achim Gratz wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>> Bastien already mentions that you can use C-c '  to edit the formulas.
>> What is less well known is that if you press TAB in one of those formulas
>> in the formula editor, the list form is pretty-printed - this goes a long
>> way for readability and editability.
> 
> Indeed I did not know that, thanks for mentioning.  But I'm just as
> concerned about the look of that line when browsing the document and the
> pretty-printing for edit doesn't help with that.

The line is really not meant for looking nice in the buffer.  maybe we should have an option for making (much of it) invisible.
I don't really mind, because I always work with truncate-line set to t, so the line never bothers me.

- Carsten

> 
> 
> Regards,
> Achim.
> -- 
> +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
> 
> SD adaptation for Waldorf Blofeld V1.15B11:
> http://Synth.Stromeko.net/Downloads.html#WaldorfSDada
> 
> 

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-02-01  6:37     ` Achim Gratz
  2012-02-01  6:56       ` Carsten Dominik
@ 2012-02-01  7:03       ` Bastien
  2012-02-01 17:29         ` Achim Gratz
  1 sibling, 1 reply; 15+ messages in thread
From: Bastien @ 2012-02-01  7:03 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

> But I'm just as
> concerned about the look of that line when browsing the document and the
> pretty-printing for edit doesn't help with that.

What about

#+begin_tblfm
...
...
#+end_tblfm

?

-- 
 Bastien

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-01-31 22:29   ` Carsten Dominik
  2012-02-01  6:37     ` Achim Gratz
@ 2012-02-01  7:14     ` Bastien
  1 sibling, 0 replies; 15+ messages in thread
From: Bastien @ 2012-02-01  7:14 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Achim Gratz, emacs-orgmode

Hi Carsten,

Carsten Dominik <carsten.dominik@gmail.com> writes:

> Bastien already mentions that you can use C-c '  to edit the formulas.
> What is less well known is that if you press TAB in one of those formulas
> in the formula editor, the list form is pretty-printed - this goes a long
> way for readability and editability.

I forgot to mention this because... I just discovered it :)

I added a note in this turorial about TAB in the formulas editor.

That's what I like about writing tutorials: that's the best way 
to teach yourself something new!

Thanks,

-- 
 Bastien

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-02-01  6:27         ` Achim Gratz
@ 2012-02-01 12:39           ` Nicolas Goaziou
  0 siblings, 0 replies; 15+ messages in thread
From: Nicolas Goaziou @ 2012-02-01 12:39 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Hello,

Achim Gratz <Stromeko@nexgo.de> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>> I don't see what is clumsy with affiliated keywords.
>
> Well, you write the arguments before starting the source block, getting
> everything wardbacks (and I don't think that's easier to parse, but you
> would know better(*)).

I think you're mixing src blocks and Babel. A src block contains,
fontifies and allows to edit source code. Babel arguments (or caption,
or name) are meta-data that applies to the whole src block element, not
to its contents.

> Last but not least I can never remember if any of the "#+" stuff is
> supposed to end with a ":"

Affiliated keywords all do. If one doesn't, it's a bug.

> and whether it wants another ":" in front of the arguments or not.

That's another topic, and I agree that, at one point or another, we'll
have to unify the way parameters are written. IMO, Babel usage is a good
standard.

> (*) Reminds me I'll have to try what happens if I write header
> arguments that are detached from the source block.  Devious, I know,
> but the manual does not really specify anything.

But Org elements does. Affiliated keywords must be attached to their
relative element.

> If you look carefully, that source block above does not contain a
> drawer.  It has a (hypothetical) associated multiline header argument
> that happens to look and feel like a drawer.

Then it's a duck.

>> Though, drawers can contain src-blocks.
>
> Is there any specification that they must fully contain them?

You may want to read comments in org-element.el. I also posted some
explanations when I announced the library.

> Anyway, that was just an idea and if nobody likes it, that's fine with
> me, too.

I just wanted to let you know that the idea of putting "quasi-drawers"
within a src-block is against the model described by the current parser.


Regards,

-- 
Nicolas Goaziou

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-01-31 17:33 New tutorial on using Emacs lisp for Org spreadsheet formulas Bastien
  2012-01-31 18:33 ` Achim Gratz
@ 2012-02-01 15:39 ` Eric S Fraga
  1 sibling, 0 replies; 15+ messages in thread
From: Eric S Fraga @ 2012-02-01 15:39 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Bastien <bzg@altern.org> writes:

> Hi all,
>
> I wrote a new tutorial on using Emacs lisp for Org spreadsheet formulas:
> http://orgmode.org/worg/org-tutorials/org-spreadsheet-lisp-formulas.html
>
> Enjoy,

Excellent tutorial!  Very helpful.  Thanks.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.285.g646b3)

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

* Re: New tutorial on using Emacs lisp for Org spreadsheet formulas
  2012-02-01  7:03       ` Bastien
@ 2012-02-01 17:29         ` Achim Gratz
  0 siblings, 0 replies; 15+ messages in thread
From: Achim Gratz @ 2012-02-01 17:29 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@altern.org> writes:
> #+begin_tblfm
> ...
> ...
> #+end_tblfm

That has other problems I think.  The idea is that the formulas are out
of sight until you need them and so that block would need to be special
w.r.t. visibility.  Although if the #+TBLFM: content can be hidden by
default, as Carsten hinted at, then everything else could easily stay as
it is.  Maybe even jump directly to the formula edit buffer with TAB if
the user wants this to happen.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves

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

end of thread, other threads:[~2012-02-01 17:29 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-31 17:33 New tutorial on using Emacs lisp for Org spreadsheet formulas Bastien
2012-01-31 18:33 ` Achim Gratz
2012-01-31 19:31   ` Nicolas Goaziou
2012-01-31 20:01     ` Achim Gratz
2012-01-31 20:55       ` Nicolas Goaziou
2012-02-01  6:27         ` Achim Gratz
2012-02-01 12:39           ` Nicolas Goaziou
2012-02-01  6:10     ` Jude DaShiell
2012-01-31 22:29   ` Carsten Dominik
2012-02-01  6:37     ` Achim Gratz
2012-02-01  6:56       ` Carsten Dominik
2012-02-01  7:03       ` Bastien
2012-02-01 17:29         ` Achim Gratz
2012-02-01  7:14     ` Bastien
2012-02-01 15:39 ` Eric S Fraga

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