Re: [Orgmode] [babel] Suggestions: GRASS GIS und Lilypond

2011-02-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/15/2011 07:46 PM, Eric Schulte wrote:
 I am happy to answer questions and provide suggestions for anyone who is
 interested in developing support for these (or any other) additional
 languages.  I would recommend looking at existing languages which are
 similar to the new language for guidance/examples.
 
 In the case of GRASS, it sounds as though GRASS is a sub[super]-set of
 R?  

No - GRASS can be described as a collection of commands which are
executed in the shell after some environmental variables are set. So
GRASS is rather a super set of a bash shell.
So an implementation of GRASS could easily build on how sh code blocks
are hab=ndled in org.

Interactive GRASS sessions are effectively sh sessions with adapted
$PATH variable and a few environmental variables, to make the GRASS
commands accessible. So really the easiest would be to use the existing
sh support, set the environmental variables, set the $PATH and execute
the commands.
The environmental variables could be defined in :var - so actually that
should not be a problem.

Syntax highlighting could be based on sh with added commands in the
added $PATH - should not be to difficult (theoretically...).

 Would it be possible to simply use the existing R support in babel
 only specify a non-R command to be run to start interactive sessions?

Well - R, like python which is becoming the official scripting
language for GRASS, has a set of commands to interface with GRASS - so
using R (or python) would not be a useful approach.

There is an R package (spGRASS6) which is doing exactly what I mentioned
above (setting the $PATH and the environmental variables) to be able to
execute grass commands from within R - (with the syntax

execGRASS( COMMAND, ... )

So one could look at that command (initGRASS() I think it is called) to
see what is necessary - or just execute grass:

grass -text GISBASE/LOCATION_NAME/MAPSET

##
rkrug@ecolmod:~/deb$ grass --help
Usage:
  grass64 [-h | -help | --help] [-v | --version] [-c]
  [-text | -gui | -tcltk | -oldtcltk | -wxpython | -wx]
  [[[GISDBASE/]LOCATION_NAME/]MAPSET]

Flags:
  -h or -help or --help  print this help message
  -v or --versionshow version information and exit
  -c create given mapset if it doesn't exist
  -text  use text based interface
   and set as default
  -gui   use graphical user interface (wxpython
by default)
   and set as default
  -tcltk use Tcl/Tk based graphical user interface
   and set as default
  -oldtcltk  use old Tcl/Tk based graphical user
interface
   and set as default
  -wxpython or -wx   use wxPython based graphical user interface
   and set as default

Parameters:
  GISDBASE   initial database (path to GIS data)
  LOCATION_NAME  initial location
  MAPSET initial mapset

  GISDBASE/LOCATION_NAME/MAPSET  fully qualified initial mapset directory

Environment variables relevant for startup:
  GRASS_GUI  select GUI (text, gui, tcltk, oldtcltk,
wxpython)
  GRASS_TCLSHset tclsh shell name to override 'tclsh'
  GRASS_WISH set wish shell name to override 'wish'
  GRASS_HTML_BROWSER set html web browser for help pages
  GRASS_ADDON_PATH   set additional path(s) to local GRASS
modules
  GRASS_BATCH_JOBshell script to be processed as batch job
  GRASS_PYTHON   set python shell name to override 'python'
rkrug@ecolmod:~/deb$
##


So it should be doable relatively easily I guess.

So the environmental variables needed would be:

 GISDBASEinitial database (path to GIS data)
 LOCATION_NAME   initial location
 MAPSET  initial mapset

So that GRASS can build

 GISDBASE/LOCATION_NAME/MAPSET  fully qualified initial mapset directory

Thinking of it, a GRASS code block

#+begin_src grass
 ...
#+end_src

would be a sh code block, in which as the first command grass -text is
executed, i.e.

#+begin_src grass
  grass -text
  ...
#+end_src

For tangling: GRASS scripts are executed usually from within GRASS, so
they are normal sh scripts (same shebang and all)

So implementation should be rather straight forward, I think?

Just a side note: as GRASS installs in addition to the command grass
also a command grass64 for version 6.4 etc, it would be nice to have
the command grass modifiable.


Cheers,

Rainer

 
 Best -- Eric
 
 Thorsten  gruenderteam.ber...@googlemail.com writes:
 
 Hello Babel developers, 
 just two suggestions 

Re: [Orgmode] [babel] Suggestions: GRASS GIS und Lilypond

2011-02-15 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/15/2011 02:02 AM, Thorsten wrote:
 Hello Babel developers, 
 just two suggestions for new languages: 
 1. GRASS GIS
 As far as I know there is no grass-mode in emacs, but some expert people are
 successful running grass processes together with R processes in ESS.
 Since GRASS and R are natural allies, it would be great to use the GRASS
 engine in an org-file to retrieve spatial data and then analyse the data
 with R in the same file - would make Org a kind of emacs-grassmode
 replacement.  

I second that - but what would be really needed to make this work
nicely, is syntax highlighting for grass commands.

And in addition, GRASS scripts are shell scripts - so one should be able
to use a combination of :session and sh code blocks to run GRASS
commands without problems (haven't tried it yet, but nice idea).

The only question would be on how can I start a shell, in which I start
GRASS in which I run the R shell? Well - what I did was to start GRASS
in xterm, in GRASS start emacs with  and when I started R in emacs, it
was running in GRASS.

Is this what you mean, or am I missing here something?

Rainer

 2. Lilypond
 A nice to have for all the music lovers in the org community. 
 Regards
 Thorsten
 
 
 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:+33 - (0)9 53 10 27 44
Cell:   +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1aQzAACgkQoYgNqgF2egr0mQCfXqXrPJ8So4ImFsDJr2VRWkSw
i9sAnRO099FuJ8ymXJNfF6HDPBKbDkH7
=Mb70
-END PGP SIGNATURE-

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] Suggestions: GRASS GIS und Lilypond

2011-02-15 Thread Christian Moe

Earlier thread on Lilypond:
http://comments.gmane.org/gmane.emacs.orgmode/31324

CM

On 2/15/11 2:02 AM, Thorsten wrote:

Hello Babel developers,
just two suggestions for new languages:
1. GRASS GIS
As far as I know there is no grass-mode in emacs, but some expert people are
successful running grass processes together with R processes in ESS.
Since GRASS and R are natural allies, it would be great to use the GRASS
engine in an org-file to retrieve spatial data and then analyse the data
with R in the same file - would make Org a kind of emacs-grassmode
replacement.
2. Lilypond
A nice to have for all the music lovers in the org community.
Regards
Thorsten


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode




___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] Suggestions: GRASS GIS und Lilypond

2011-02-15 Thread Bastien
Christian Moe m...@christianmoe.com writes:

 Earlier thread on Lilypond:
 http://comments.gmane.org/gmane.emacs.orgmode/31324

Yes.  I had the opportunity to discuss this with Stefan at FOSDEM...
it's something that may happen at sometimes :)

-- 
 Bastien

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] Suggestions: GRASS GIS und Lilypond

2011-02-15 Thread Eric Schulte
I am happy to answer questions and provide suggestions for anyone who is
interested in developing support for these (or any other) additional
languages.  I would recommend looking at existing languages which are
similar to the new language for guidance/examples.

In the case of GRASS, it sounds as though GRASS is a sub[super]-set of
R?  Would it be possible to simply use the existing R support in babel
only specify a non-R command to be run to start interactive sessions?

Best -- Eric

Thorsten  gruenderteam.ber...@googlemail.com writes:

 Hello Babel developers, 
 just two suggestions for new languages: 
 1. GRASS GIS
 As far as I know there is no grass-mode in emacs, but some expert people are
 successful running grass processes together with R processes in ESS.
 Since GRASS and R are natural allies, it would be great to use the GRASS
 engine in an org-file to retrieve spatial data and then analyse the data
 with R in the same file - would make Org a kind of emacs-grassmode
 replacement.  
 2. Lilypond
 A nice to have for all the music lovers in the org community. 
 Regards
 Thorsten


 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [babel] Suggestions: GRASS GIS und Lilypond

2011-02-14 Thread Thorsten
Hello Babel developers, 
just two suggestions for new languages: 
1. GRASS GIS
As far as I know there is no grass-mode in emacs, but some expert people are
successful running grass processes together with R processes in ESS.
Since GRASS and R are natural allies, it would be great to use the GRASS
engine in an org-file to retrieve spatial data and then analyse the data
with R in the same file - would make Org a kind of emacs-grassmode
replacement.  
2. Lilypond
A nice to have for all the music lovers in the org community. 
Regards
Thorsten


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] Suggestions: GRASS GIS und Lilypond

2011-02-14 Thread John Hendy
On Mon, Feb 14, 2011 at 7:02 PM, Thorsten 
gruenderteam.ber...@googlemail.com wrote:

 Hello Babel developers,
 just two suggestions for new languages:
 2. Lilypond
 A nice to have for all the music lovers in the org community.


I've used Lilypond and think it's amazing. But... what advantage is having
it in org? Just curious... integration in foldable headlines and src blocks?
For my uses, I can't think of a purpose unless, I guess, I was doing
in-document scores or bars like in a wedding program or something. What was
your idea -- I'm interested.

John


 Regards
 Thorsten


 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode