Re: [O] GSoC 2012 -- Elisp backend for Ragel

2012-03-25 Thread Rustom Mody
Resending this because it seems to not have reached
---

I asked Adrian Thurston the author of ragel if he would support help this
project.
His reply to me is here:

Hi Rustom,

 I can certainly help with guidance. I'm about to relocate across much of
 canada and so I won't be able to crack open code very easily.

 Aurélien: my apologies I haven't responded. I certainly support your
 effort, just have had some big career/life changes going on.

 Regards,
 Adrian


As for Nicolas, he wrote:

FYI, there is already an elisp Org parser being worked on in development
 branch of Org mode. It isn't finished yet, but still advanced enough so
 a generic exporter could be built upon it.

 Is there any interest in ignoring it and restart all the work from
 scratch?


Yes I agree, no point redoing work unnecessarily.  Maybe the optimal
solution would be for Aurélien to work with Nicolas and Adrian to minimize
useless rework?

Aurélien you now need to say what are your preferences in this matter.

Rusi


Re: [O] Assigning results to variables

2012-03-25 Thread Erich Neuwirth
Thanks,
that is exactly what I need.
Perhaps this trick could explicitly mentioned in the documentation.






Re: [O] [RFC] warn time for appointments

2012-03-25 Thread Ivan Kanis
Peter Münster pmli...@free.fr wrote:

 On Fri, Mar 23 2012, Ivan Kanis wrote:

 I got no reply to my RFC and to my tentative patches. Does that mean
 everybody is happy with the default 12 minutes warning time?

 No, I'm not happy with 12 minutes. But there is
 https://github.com/p-m/org-notify where you can have arbitrary warning
 times (seconds, weeks, whatever...).
 Does it fit your needs?

Thanks for the link, I will try it out! In the meantime I am using a
hack that I posted on the list.
-- 
Ivan Kanis
http://ivan.kanis.fr

Men of lofty genius when they are doing the least work are the most
active.
-- Leonardo da Vinci



Re: [O] [RFC] warn time for appointments

2012-03-25 Thread Bastien
Hi Ivan,

Ivan Kanis ivan.ka...@googlemail.com writes:

 Peter Münster pmli...@free.fr wrote:

 On Fri, Mar 23 2012, Ivan Kanis wrote:

 I got no reply to my RFC and to my tentative patches. Does that mean
 everybody is happy with the default 12 minutes warning time?

 No, I'm not happy with 12 minutes. But there is
 https://github.com/p-m/org-notify where you can have arbitrary warning
 times (seconds, weeks, whatever...).
 Does it fit your needs?

 Thanks for the link, I will try it out! In the meantime I am using a
 hack that I posted on the list.

Note that you can use it from latest master HEAD in the git repo.

-- 
 Bastien



[O] bug#8748: emacs 23.3 for windows, org-mode, tables

2012-03-25 Thread Bastien
 Alexander Sidorov alx.sido...@gmail.com writes:

 Org-mode in emacs for Windows doesn't allow to create prooperly
 tables. This is the result of creation a table 5x2:

 |   |   |   |   |   | |---+---+---+---+---| |   |   |   |   |   |

 (all rows in one row). It happens always. I guess that used wrong
 end-line symbol.

Closing this bug.

-- 
 Bastien





Re: [O] GSoC 2012 -- Elisp backend for Ragel

2012-03-25 Thread Nicolas Goaziou
Hello,

Aurélien Aptel aurelien.ap...@gmail.com writes:

 On Sun, Mar 25, 2012 at 6:17 AM, Rustom Mody rustompm...@gmail.com wrote:
 FYI, there is already an elisp Org parser being worked on in development
 branch of Org mode. It isn't finished yet, but still advanced enough so
 a generic exporter could be built upon it.

 Is there any interest in ignoring it and restart all the work from
 scratch?

 Yes I agree, no point redoing work unnecessarily.  Maybe the optimal
 solution would be for Aurélien to work with Nicolas and Adrian to minimize
 useless rework?

 Regardless of the org-mode parser, I think I should work on the elisp
 backend for ragel which is something that can benefit any elisp
 project.

Certainly.

 As for the new org-mode parser, I could not find it on the repo. Could
 you point me to the relevant files?

See org-element.el in contrib/ directory.  You need development version.

 Is it still hand written? 

Yes.

 If so, I think it's ultimately a bad idea and it should be rewritten
 using ragel.

It may be. But it allows for flexibility. Org's syntax is evolving, and
I consider org-element.el as a parser, but also as a guidance in that
process. Since there is no formal description for Org syntax yet, an
org-element.el is more useful than a full-blown parser generator for
now.

I don't know ragel (save for a short excursion in its website), but I'm
pretty sure that even if it generates elisp code without dependency, any
evolution to Org syntax will require to use it again. At that time, it
may be difficult to find someone able and willing to undertake that
updating task in a reasonable delay (since we're talking about a core
feature). On the other hand, there are quite a few elisp hackers in
Emacs's world.

Now, if ragel can improve org-element.el while preserving its
flexibility (and a compatible output, since I assume you won't also
rewrite the generic export engine), I'm all ears.


Regards,

-- 
Nicolas Goaziou



Re: [O] Need Help: [patch] A experimental toy which is used to preview latex fragements

2012-03-25 Thread FengShu

 Ok - just a misplaced paren - the code (I just show the dvipng case,
 but the imagemagick case will need it too) should look like this:
...
  ((eq processing-type 'dvipng)
   (unless executables-checked
 (org-check-external-command
  latex needed to convert LaTeX fragments to images)
 (org-check-external-command
  dvipng needed to convert LaTeX fragments to images)
 (setq executables-checked t))
   (unless (file-exists-p movefile)
 (org-create-formula-image-with-dvipng
txt movefile opt forbuffer)))
  ...

 with two independent sexps: one to check for executables and one to check
 for files. The misplaced paren caused the file check to be inside the
 executable check, so it never produced any files after the first one.

 Nick

I change the patch ,and it seem work well, thanks very much.

Another questions:
1. I use latex color micro to change the pdf and png's  *fg* and *bg*,
   I want to know the compatibility between the color micro and other latex 
micro
2. I use (car org-latex-to-pdf-process) to convert latex. and my
   question is: is this path reliable? 


The below is v3 patch: 

From 13ce8af1ca7b04a7e69ff1262e5b89131b67b7cd Mon Sep 17 00:00:00 2001
From: FengShu tuma...@gmail.com
Date: Fri, 23 Mar 2012 16:05:37 +0800
Subject: [PATCH] This is a experimental toy ,which use '(car
 org-latex-to-pdf-process) and imagemagick to convert latex
 fragements into pngfiles,and then insert them into the
 editing buffer,you can use it to  preview latex  formula
 and so on. the converting path is latex-pdf-png,which
 is different from the org default path: latex-dvi-png

---
 lisp/org-exp.el  |   16 --
 lisp/org-html.el |1 +
 lisp/org.el  |  157 +-
 3 files changed, 154 insertions(+), 20 deletions(-)

diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 1ce..0317539 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -537,12 +537,15 @@ This option can also be set with the +OPTIONS line, e.g. 
\LaTeX:mathjax\.
 
 Allowed values are:
 
-nilDon't do anything.
-verbatim   Keep everything in verbatim
-dvipng Process the LaTeX fragments to images.
-   This will also include processing of non-math environments.
-t  Do MathJax preprocessing if there is at least on math snippet,
-   and arrange for MathJax.js to be loaded.
+nil Don't do anything.
+verbatimKeep everything in verbatim
+dvipng  Process the LaTeX fragments to images.
+This will also include processing of non-math environments.
+imagemagick Convert the LaTeX fragments to pdf with program:
+'(car org-latex-to-pdf-process), And then use
+imagemagick convert pdf to png
+t   Do MathJax preprocessing if there is at least on math snippet,
+and arrange for MathJax.js to be loaded.
 
 The default is nil, because this option needs the `dvipng' program which
 is not available on all systems.
@@ -552,6 +555,7 @@ is not available on all systems.
  (const :tag Do not process math in any way nil)
  (const :tag Obsolete, use dvipng setting t)
  (const :tag Use dvipng to make images dvipng)
+ (const :tag Use imagemagick to make images imagemagick)
  (const :tag Use MathJax to display math mathjax)
  (const :tag Leave math verbatim verbatim)))
 
diff --git a/lisp/org-html.el b/lisp/org-html.el
index 2de2ea9..15a6c3e 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -685,6 +685,7 @@ The default is an extended format of the ISO 8601 
specification.
   ((eq (plist-get parameters :LaTeX-fragments) 'verbatim) 'verbatim)
   ((eq (plist-get parameters :LaTeX-fragments) 'mathjax ) 'mathjax)
   ((eq (plist-get parameters :LaTeX-fragments) t) 'mathjax)
+  ((eq (plist-get parameters :LaTeX-fragments) 'imagemagick  ) 
'imagemagick)
   ((eq (plist-get parameters :LaTeX-fragments) 'dvipng  ) 'dvipng)
   (t nil
   (goto-char (point-min))
diff --git a/lisp/org.el b/lisp/org.el
index 159bb7f..3805531 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3389,6 +3389,23 @@ When using MathToWeb as the converter, set this to
   :type '(choice
  (const :tag None nil)
  (string :tag \nShell command)))
+(defcustom org-create-formula-image-program 'dvipng
+  When a org file you are editing include some latex fragments,
+you want to preview them,you can convert them into png files and 
+then insert into the org buffers
+
+dvipng  Process the LaTeX fragments to dvi file, then convert
+dvi files  to png files using dvipng. 
+This will also include processing of non-math environments.
+imagemagick Convert the LaTeX fragments to pdf with program:
+'(car 

Re: [O] GSoC 2012 -- Elisp backend for Ragel

2012-03-25 Thread Martyn Jago
Hi, and welcome Aurélien,

Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,

 Aurélien Aptel aurelien.ap...@gmail.com writes:

 On Sun, Mar 25, 2012 at 6:17 AM, Rustom Mody rustompm...@gmail.com wrote:
 FYI, there is already an elisp Org parser being worked on in development
 branch of Org mode. It isn't finished yet, but still advanced enough so
 a generic exporter could be built upon it.

 Is there any interest in ignoring it and restart all the work from
 scratch?

 Yes I agree, no point redoing work unnecessarily.  Maybe the optimal
 solution would be for Aurélien to work with Nicolas and Adrian to minimize
 useless rework?

 Regardless of the org-mode parser, I think I should work on the elisp
 backend for ragel which is something that can benefit any elisp
 project.

 Certainly.

 As for the new org-mode parser, I could not find it on the repo. Could
 you point me to the relevant files?

 See org-element.el in contrib/ directory.  You need development version.

 Is it still hand written? 

 Yes.

 If so, I think it's ultimately a bad idea and it should be rewritten
 using ragel.

 It may be. But it allows for flexibility. Org's syntax is evolving, and
 I consider org-element.el as a parser, but also as a guidance in that
 process. Since there is no formal description for Org syntax yet, an
 org-element.el is more useful than a full-blown parser generator for
 now.

 I don't know ragel (save for a short excursion in its website), but I'm
 pretty sure that even if it generates elisp code without dependency, any
 evolution to Org syntax will require to use it again. At that time, it
 may be difficult to find someone able and willing to undertake that
 updating task in a reasonable delay (since we're talking about a core
 feature). On the other hand, there are quite a few elisp hackers in
 Emacs's world.

 Now, if ragel can improve org-element.el while preserving its
 flexibility (and a compatible output, since I assume you won't also
 rewrite the generic export engine), I'm all ears.

I am a big fan of formalizing as much state design as possible into
formal state-machines, and have been for some time.

For the design process I currently use the excellent plantuml library
from within Org-mode (Aurélien, see lisp/ob-plantuml.el for the
Org-babel interface), although have previously used a bespoke
Ruby/Graphviz library of my design, and previous to that Ragel.

For that reason I think it would be great to see an `Org-Babel'
implementation of Ragel. I think it could be a very useful tool.

However, I don't use code auto-generation by Ragel and the like for the
following reasons...

 1) It complicates the build process
 2) It adds yet more SOUP (software of unknown provenance) to the build
 process which may then need mitigating against (this is relevant to me,
 although possibly not to Org-mode). 
 3) FSM implementation into code is inherently very simple anyway

What I do instead is validate the FSM code against the formal state
representation as an integration test (which is fairly easy to arrange).

So my point is, I personally don't see the use of FSM code generators as
a panacea to perfect super-fast code. To me their usefulness is in the
visual representation of the state interaction (during development, and
subsequent code documentation), and the resulting code quality.

Just my 10c

Best, Martyn



 Regards,




[O] babel for maxima

2012-03-25 Thread Neuwirth Erich
I have a suggestion for the maxima mode in org-babel.
I am using Emacs on a Mac which means that some hint work differently.
The standard distribution of Maxima for the mac does not have a command 
'maxima' anywhere on the path.

The way to start character mode maxima from a shell is using
/Applications/Maxima.App/Contents/Resources/maxima.sh


Maxima itself brings an emacs mode with the standard distribution, and
in maxima mode for Emacs he maxima command can be configured by using
(setq maxima-command /Applications/Maxima.app/Contents/Resources/maxima.sh)
in .emacs

So it makes sense that maxima mode in org does

(require 'maxima)
and then uses maxima-command when it defines the function


(defun org-babel-execute:maxima

I hope this is a reasonable suggestion.




[O] Question about html output

2012-03-25 Thread Erich Neuwirth
The html file produce by org-mode export contains a link to validate XHTML.
Safari at least on Macs does not send a referer field in the http header,
therefore this link does not work.
Is there an option to turn the creation of this link off by default?
And is there a way to tweak Safari to send the referer information?





Re: [O] Question about html output

2012-03-25 Thread Bernt Hansen
Erich Neuwirth erich.neuwi...@univie.ac.at writes:

 The html file produce by org-mode export contains a link to validate XHTML.
 Safari at least on Macs does not send a referer field in the http header,
 therefore this link does not work.
 Is there an option to turn the creation of this link off by default?
 And is there a way to tweak Safari to send the referer information?

(setq org-export-html-validation-link nil)

Regards,
Bernt



[O] [OT] Issue with exported html on webserver

2012-03-25 Thread suvayu ali
Hi,

I labelled this OT since I am having the problem with only one
web server. Since I am not well versed with html, I was hoping the good
people of this list can help.

Now to my issue. When I export any org file to html and open it in my
browser, everything works well. But when I put it on my institute's
public_html/ directory, I see a blank page. I asked for help at the IT
help desk, they tracked down the problem to the very first tag in the
html file.

  ?xml version=1.0 encoding=iso-8859-1?

This generates the following error in the Apache logs:

PHP Parse error:  syntax error, unexpected T_STRING in
/user/sali/public_html/bug.html on line 1

Removing the line renders the page properly.

For an example, look in the following directory.

http://www.nikhef.nl/~sali/

+ bug.html renders correctly (the first line has been removed)
+ fails-bug.html shows a blank page (this is as org exports it)

This is rather perplexing, since I have successfully used html exported
by org before on other webservers (e.g. the public_html directory in my
previous university). Can someone help me find out what is the issue
here?

Thanks a bunch.

-- 
Suvayu

Open source is the future. It sets us free.



[O] postamble removal

2012-03-25 Thread prad
this removes the author through a template:
#+OPTIONS: :nil author:nil

is there a variable to remove the entire postamble?
is there a way i can add things to the postamble such as a horizontal line?

-- 
in friendship,
prad




Re: [O] [OT] Issue with exported html on webserver

2012-03-25 Thread Christian Moe
Hi

See if this explains it:

http://www.000webhost.com/forum/web-design-html/25365-xhtml-not-recognised-parse-error-syntax-error-unexpected-t_string-line-1-a.html

Yours,
Christian

suvayu ali fatkasuvayu+li...@gmail.com wrote:

Hi,

I labelled this OT since I am having the problem with only one
web server. Since I am not well versed with html, I was hoping the good
people of this list can help.

Now to my issue. When I export any org file to html and open it in my
browser, everything works well. But when I put it on my institute's
public_html/ directory, I see a blank page. I asked for help at the IT
help desk, they tracked down the problem to the very first tag in the
html file.

  ?xml version=1.0 encoding=iso-8859-1?

This generates the following error in the Apache logs:

PHP Parse error:  syntax error, unexpected T_STRING in
/user/sali/public_html/bug.html on line 1

Removing the line renders the page properly.

For an example, look in the following directory.

http://www.nikhef.nl/~sali/

+ bug.html renders correctly (the first line has been removed)
+ fails-bug.html shows a blank page (this is as org exports it)

This is rather perplexing, since I have successfully used html exported
by org before on other webservers (e.g. the public_html directory in my
previous university). Can someone help me find out what is the issue
here?

Thanks a bunch.

--
Suvayu

Open source is the future. It sets us free.

---

Sent from mobile.
Please excuse my brevity.



Re: [O] [OT] Issue with exported html on webserver

2012-03-25 Thread Nick Dokos
suvayu ali fatkasuvayu+li...@gmail.com wrote:

   ?xml version=1.0 encoding=iso-8859-1?
 
 This generates the following error in the Apache logs:
 
 PHP Parse error:  syntax error, unexpected T_STRING in
 /user/sali/public_html/bug.html on line 1
 
 Removing the line renders the page properly.
 
 For an example, look in the following directory.
 
 http://www.nikhef.nl/~sali/
 
 + bug.html renders correctly (the first line has been removed)
 + fails-bug.html shows a blank page (this is as org exports it)
 
 This is rather perplexing, since I have successfully used html exported
 by org before on other webservers (e.g. the public_html directory in my
 previous university). Can someone help me find out what is the issue
 here?
 

The server seems misconfigured to me: why is PHP entering into the
picture at all?

Nick



Re: [O] [OT] Issue with exported html on webserver

2012-03-25 Thread suvayu ali
Hi Christian,

On Sun, Mar 25, 2012 at 23:21, Christian Moe m...@christianmoe.com wrote:
 Hi

 See if this explains it:

 http://www.000webhost.com/forum/web-design-html/25365-xhtml-not-recognised-parse-error-syntax-error-unexpected-t_string-line-1-a.html


That resolved it! I will take this up with our IT department. Thanks a
lot. :)

 Yours,
 Christian

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] [OT] Issue with exported html on webserver

2012-03-25 Thread suvayu ali
Hi Nick,

On Sun, Mar 25, 2012 at 23:25, Nick Dokos nicholas.do...@hp.com wrote:

 The server seems misconfigured to me: why is PHP entering into the
 picture at all?

Christian's response resolved the issue. The page he pointed to, says
this happens when the short_open_tag server configuration is not
turned off. I will take this up with our IT department.

Thanks a lot.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] [OT] Issue with exported html on webserver

2012-03-25 Thread Nick Dokos
suvayu ali fatkasuvayu+li...@gmail.com wrote:

 Hi Nick,
 
 On Sun, Mar 25, 2012 at 23:25, Nick Dokos nicholas.do...@hp.com wrote:
 
  The server seems misconfigured to me: why is PHP entering into the
  picture at all?
 
 Christian's response resolved the issue. The page he pointed to, says
 this happens when the short_open_tag server configuration is not
 turned off. I will take this up with our IT department.
 

Yes, I went to the link that Christian posted. I was particularly
confused/intrigued/flabbergasted by the admin's response:

#+BEGIN_QUOTE
on 000webhost, all web pages are interpreted as php pages and
short_open_tag is off and that is the reason the propose
solution works on 000webhost.
#+END_QUOTE

Why on earth would anybody set it up so that all web pages are
interpreted as php pages? Seems crazy to me, but I'm probably
naive.

Nick





[O] Tikz--LaTeX/HTML

2012-03-25 Thread Steve Hafner
I'm trying to get a LaTeX scr block with Tikz code either to go native
into LaTeX or to be converted into a PNG file and included in HTML, as
described in 
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html.
That document refers to a thread on this list in which two example
were given: 
http://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg01297.html
and http://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg01302.html.
Both examples behave in a similar way for me on Org-7.8.06, but not in
the way I expected. If I export to PDF then I just get
[[file:test.png]] in the PDF where I expected the image to be
visible, and if I export to HTML then nothing is visible in the HTML
file. Either way I export, the file test.png is indeed generated.

So I wonder if these examples are valid with respect to 7.8.06 or
maybe my expectations are off. I would not think that the PNG file
should be generated for the PDF export, but would expect the image to
be visible when viewing either document. Reading the manual, it seems
that maybe the behavior has changed in the last year with respect to
these examples.

So I've tried to figure it out with the manual. If I don't worry about
the HTML export, I'm able to set up the document so that the Tikz code
is included into LaTeX in the correct way; not too difficult.  On the
other hand, if I don't worry about the LaTeX export, I can get the PNG
file to generate but can't get it automatically included into the
HTML. If I could get this second part figured out, then the plan would
be to have an elisp conditional testing on backend (if this is still
a valid symbol to test on) that would determine whether on not to
include :file etc. in the header for the src block. Any thoughts?

--Steve



[O] Problem with BEGIN_SRC export-as-html

2012-03-25 Thread lowstz
Hi,

I have a problem with BEGIN_SRC export as html,

I use the BEGIN_SRC code block my code like this:

#+BEGIN_SRC C
#include stdio.h

int main(void)
{
printf(Hello, World!\n);
}
#+END_SRC

It work well in emacs, but when I run export as html
the part of BEGIN_SRC / END_SRC generate pre class=example, it same
with the BEGIN_EXAMPLE / END_EXAMPLE

Not have this problem, but after re-installing Fedora and Emacs.
This is the effect before reinstall the Fedora and Emacs:
https://lowstz.org/wiki/java.html

Emacs Version: GNU Emacs 23.3.1
Org-mode Version: 7.8.06 (I have tried git version, but still the same
problem)

-- 
Best regards,
Lowstz Chen

http://lowstz.org/blog
Twitter: @lowstz


Re: [O] Problem with BEGIN_SRC export-as-html

2012-03-25 Thread Nick Dokos
lowstz low...@gmail.com wrote:


 #+BEGIN_SRC C
 #include stdio.h
 
 int main(void) 
 {
 printf(Hello, World!\n);
 }
 #+END_SRC
 
 It work well in emacs, but when I run export as html
 the part of BEGIN_SRC / END_SRC generate pre class=example, it same with 
 the BEGIN_EXAMPLE /
 END_EXAMPLE
 

I cannot reproduce this. I get (both with my normal startup and with a minimal
.emacs):

,
| pre class=src src-Cspan style=color: #b0c4de;#include/span span 
style=color: #ffa07a;lt;stdio.hgt;/span
| 
| span style=color: #98fb98;int/span span style=color: 
#b2dfee;main/span(span style=color: #98fb98;void/span)#160;
| {
| printf(span style=color: #ffa07a;Hello, World!/span\n);
| }
| /pre
`

Have you activated C as a babel language? Maybe some some initialization
is interfering: try with emacs -q and a minimal .emacs (search the list
archives for examples), although the fact that (iiuc) things worked
before you reinstalled emacs and fedora, seems to point to some more
basic misconfiguration (maybe you are picking up pieces of the org mode
distributed with the platform emacs?). Just guessing here.

GNU Emacs 24.0.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.4) of 
2012-01-24
Org-mode version 7.8.06 (release_7.8.06.110.g2756.dirty)

(my org-mode version includes half a dozen local modifications).

Nick