emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: Possible Calc support for Org-Babel?
@ 2010-11-03 22:42 Eric S Fraga
  2010-11-04 13:24 ` Eric Schulte
  0 siblings, 1 reply; 28+ messages in thread
From: Eric S Fraga @ 2010-11-03 22:42 UTC (permalink / raw)
  To: Matthew Oesting, emacs-orgmode

Forgot to CC the list et al.

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

> Eric S Fraga <ucecesf@ucl.ac.uk> writes:

[...]

>> I now wonder if it would be worthwhile discussing the choices you have
>> made regarding stack versus algebraic evaluation.  I would rather have
>> the quote mean an algebraic expression, just from the simple reason that
>> these will be longer than stack operations and so the overhead of a
>> quote is smaller as a percentage of keystrokes...
>>
>
> Hmm, one point against prefixing the algebraic expressions is that they
> would be more likely to be used by themselves in an inline code block.

Yes, I guess so.  My initial thoughts were that we have plenty of
algebraic languages available already through babel (octave, R, python,
...) so why not support a stack based one more directly.   However, the
real benefit of calc is that it is *emacs* and not external!  Algebraic
is more natural to most people so making it easy for them to express
themselves makes sense.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.02trans (release_7.3.10.g7f79.dirty)

^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: Possible Calc support for Org-Babel?
@ 2011-03-01 20:48 orgmode
  0 siblings, 0 replies; 28+ messages in thread
From: orgmode @ 2011-03-01 20:48 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: orgmode

Hi,

addition of babel support for calc is nice.  However calc also has  
"embedded mode".  that means active calc documents can easily be  
embedded in org documents (and also latex, ...).  It is different from  
babel, but in some instances it may work better.

^ permalink raw reply	[flat|nested] 28+ messages in thread
* Possible Calc support for Org-Babel?
@ 2010-10-22 17:17 Matthew Oesting
  2010-10-26 18:37 ` Eric Schulte
  0 siblings, 1 reply; 28+ messages in thread
From: Matthew Oesting @ 2010-10-22 17:17 UTC (permalink / raw)
  To: emacs-orgmode

A few of us at my institution have started using CALC in our documents (not embedded, which is far too clumsy for most of us, but C-x * u and simple embedded phrases, often to the tune of several pages) to use Emacs text files rather like Maple and Mathematica files.  We're starting to use GIT and OrgMode together to format the work and save versions and forks; while there are many CAS packages that can be used to write out memos and reports, the power of Elisp/Emacs was simply too good to pass up.

It appears that Calc syntax can be used to assign formulas to spreadsheets, but the result is difficult to read, and unsuitable for a sequence of several dozen lines.  Similarly, using embedded Ruby-symbolic code in the text produces excellent results, but we lose the ability to take advantage of Calc, which is significantly stronger for our purposes.  Other symbolic packages require more time to learn and are difficult to implement across all of our various platforms, whereas Calc is a universal and extremely flexible tool for this work.

My questions are these:
  * Has there been implemented, or would it be at all difficult to implement, a 'calc' language functionality for Org-Babel allowing the following manner of text:

> #+begin_src calc :results output 
> Fish = 2
> Dog = 2 * Fish
> 
> sqrt( Dog ) =>
> sqrt( 4 ) =>
> #+end_src
> 
> #+results:
> : sqrt( Dog ) => 2
> : sqrt( 4 ) = 2

The goal of this exercise would simply be to cut out the text from the code block, feed it to a buffer, run the Emacs Calc mode on it, and then output the appropriate results where => occurs.

 * Has there been implemented, or would it be at all difficult to implement, a 'running tag' approach to the Calc mode, essentially a #+CALC directive allowing the following manner of text, preferably with auto-update:

> This is a discussion.
>
> #+CALC: Fish = 2
>
> Fish deserves significant commentary; however, we expect that there is some command
>  that would allow us to update the entire buffer's #+CALC sequence.  Thus:
> 
> #+CALC: Dog = 2 * Fish
> #+CALC: sqrt( Dog ) =>
> #+results:
> : sqrt( Dog ) => 2
>
> If you need a different result, tweak the 'Fish =' line, above, and request a re-sequencing,
>  either via C-c C-c or via some M-x command, resulting in behavior functionally similar to
> C-x * u.

The goal of this exercise would be, upon updating, to strip all lines beginning with #+CALC and feed them to a buffer, inserting the results of => statements where the respective line occurs.  The benefit of this method over the previous is that it allows for assignments (:=) enduring across entire files (though the same could be accomplished if one SRC_BEGIN block could somehow call another.)

In conclusion, it seems to me that I cannot possibly be the first person to have done research in OrgMode, and that these problems were likely solved long ago.  When searching the manual, however, I find nothing that produces a distinctly clear and encapsulated Calc embed in OrgMode.  Do these exist, and if not, would it require mere hours of time to implement them, or weeks?  Is there a tutorial on writing OrgMode extensions?

- M

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

end of thread, other threads:[~2011-03-07 10:11 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-03 22:42 Possible Calc support for Org-Babel? Eric S Fraga
2010-11-04 13:24 ` Eric Schulte
2010-11-04 14:13   ` Eric S Fraga
2010-11-04 14:42   ` Sébastien Vauban
2010-11-04 15:33     ` Eric Schulte
2010-11-04 16:02       ` Sébastien Vauban
2010-11-04 16:23         ` Eric Schulte
2011-01-27  0:39   ` Christopher Allan Webber
2011-02-23  4:35     ` Eric Schulte
2011-02-24 10:13       ` Eric S Fraga
2011-02-27 21:32         ` Eric Schulte
2011-02-28 18:16           ` Eric S Fraga
2011-03-01 17:34             ` Eric Schulte
2011-03-01 20:10               ` Eric S Fraga
2011-03-07  9:16               ` Eric S Fraga
  -- strict thread matches above, loose matches on Subject: below --
2011-03-01 20:48 orgmode
2010-10-22 17:17 Matthew Oesting
2010-10-26 18:37 ` Eric Schulte
2010-10-29  6:42   ` Eric Schulte
2010-10-29  7:13     ` Carsten Dominik
2010-10-29 11:14     ` Eric S Fraga
2010-10-29 14:43       ` Eric Schulte
2010-10-29 16:22         ` Eric Schulte
2010-10-29 19:53         ` Eric S Fraga
2010-10-29 20:26           ` Eric Schulte
     [not found]             ` <87hbg4pooh.fsf@ucl.ac.uk>
     [not found]               ` <871v7879x5.fsf@gmail.com>
2010-10-30 20:54                 ` Eric S Fraga
2010-11-03 20:10                   ` Eric Schulte
2010-10-29 11:27     ` Sébastien Vauban

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