[O] http proxy problem.

2013-06-06 Thread DAVID QI
Dear org-mode maintaner,

To: emacs-orgmode@gnu.org
Subject: 7.8.09; http proxy problem. 
From: David Qi david...@vtech.com
--text follows this line--

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.



could you change org-mode/.gitmodules to

1 [submodule testing/jump]
2 path = testing/jump
3 url = https://github.com/eschulte/jump.el.git

Since there are peoples behind http proxy.

Thanks.



Emacs  : GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.6.4)
 of 2013-03-19 on eric
Package: 7.8.09

current state:
==
(setq
 org-export-blocks '((src org-babel-exp-src-block nil) (export-comment 
org-export-blocks-format-comment t) (ditaa org-export-blocks-format-ditaa 
nil)
 (dot org-export-blocks-format-dot nil))
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
org-babel-execute-safely-maybe)
 org-src-fontify-natively t
 org-clock-persist 'history
 org-export-preprocess-before-selecting-backend-code-hook 
'(org-beamer-select-beamer-code)
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-imenu-depth 7
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-confirm-babel-evaluate nil
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-babel-pre-tangle-hook '(save-buffer)
 org-occur-hook '(org-first-headline-recenter)
 org-emphasis-alist '((* hi-red b /b) (/ hi-yellow i 
/i) (_ hi-green span style=\text-decoration:underline;\ 
/span)
  (= org-code code /code verbatim) (~ 
org-verbatim code /code verbatim)
  (+ (:strike-through t) del /del))
 org-export-interblocks '((src org-babel-exp-non-block-elements))
 org-log-done 'time
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-hide-leading-stars t
 org-capture-templates '((t Todo entry (file+headline 
~/notes/org-mode/gtd.org Tasks) * TODO %?\n  %i\n  %a)
 (j Journal entry (file+datetree 
~/notes/org-mode/journal.org) * %?\nEntered on %U\n  %i\n  %a)
 (s Source_Code_Analysis entry (file+headline 
~/notes/org-mode/code.org test1)
  * %(print *qt-sca-current-target*) \nEntered on 
%U\n  %i\n  %a :immediate-finish t)
 (c Source_Code_Link plain (file+headline 
~/notes/org-mode/code.org test1) %a %U :immediate-finish t)
 (w Default template entry (file+headline 
~/notes/org-mode/tmp.org Notes) * %^{Title}\n\n  Source: %u, %c\n\n 
%i
  :empty-lines 1)
 )
 org-babel-tangle-lang-exts '((lisp . lisp) (C++ . cpp) (perl . 
pl) (python . py) (emacs-lisp . el))
 org-babel-load-languages '((python . t) (emacs-lisp . t) (dot . t) (perl 
. t) (sh . t) (C . t) (lisp . t))
 org-confirm-shell-link-function 'yes-or-no-p
 )


Best Regards,

David Qi
TEL: 852(HK)-2680-1305


[O] org-export-generic.el and emphasize

2013-06-06 Thread celano

Hy,

I'm using org-export-generic.el to export my orgfile into wikipedia-like 
file.


I tried exporting a text with emphasize, but it doesn't work.
The man page speaks about sections, lists and such other things, but 
nothing about emphasizing and bold text.

http://orgmode.org/worg/org-contrib/org-export-generic.html

Do you have any idea ?

Thank you
Celano



Re: [O] [PATCH (new version)][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.

2013-06-06 Thread Sebastien Vauban
Hello,

Nicolas Goaziou wrote:
 It changes behavior for your setup in that you can define a LANGUAGE
 that isn't a known abbreviation.

 While I think your patch is overall an improvement, I'm not convinced by
 this particular point. Indeed #+LANGUAGE: expects a language code as
 value, not just any string. This is important since latex backend is not
 the only one to use that keyword.

 For example, imagine a user in need for german smart quotes. How do you
 explain to him than #+language: german will not work, but #+language: de
 will?

 I think special Babel needs can be handled elsewhere.

That makes me think of another point: how do I say that the HTML exported
document is in American English?  By having a #+LANGUAGE: en-us specification.

But that's not a valid language for Babel when exporting to LaTeX.

So, I think we'd need some sort of alist with allowed values, and their
equivalent for LaTeX and for HTML (and for other uses?), don't we?

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Automatically adding local variables to tangled file

2013-06-06 Thread Sebastien Vauban
Hi Darlan,

Darlan Cavalcante Moreira wrote:
 On the other hand, a local variable in the tangled files to set the buffer
 to read-only could be very useful to avoid the mistake of editing the
 tangled files directly.

Waow! That makes a lot of sense, IMHO, if easily overridable with C-x C-q.
Because, people may want to edit the generated file and untangle it once
they've debugged their problem.

But I'd find that a good _default_ state, for trying to avoid errors.

Best regards,
  Seb

-- 
Sebastien Vauban




[O] org-cut-subtree, bug?

2013-06-06 Thread Andreas Röhler

Hi,

I'm misusing org-mode for a review of (slightly transformed) diffs as below.
When done, want to delete the current section.

Unfortunatly a call of M-x `org-cut-subtree' not just deletes the current 
section, but also
deletes the header-start of section beneath.

A bug? Better ways to do this?

TIA,

Andreas

;;

* mlib_ImageAffineTransform_Fp.3mlib.vorher 2013-06-05 21:13:34.285757559 
+0200
+++ mlib_ImageAffineTransform_Fp.3mlib.nachher  2013-06-05 21:13:40.824756887 
+0200

-   mtx   Transformation matrix. mtx[0] holds a; mtx[1] holds b; mtx[2]
- holds tx; mtx[3] holds c; mtx[4] holds d; mtx[5] holds ty.
+   mtx   Transformation  matrix.   mtx[0]  holds  a;  mtx[1]  holds b;
+ mtx[2] holds tx; mtx[3] holds c; mtx[4] holds d; mtx[5] holds
+ ty.

filterType of resampling filter. It can be one of the following:

* mlib_ImageAffineTransform.3mlib.vorher2013-06-05 21:36:17.119617652 
+0200
+++ mlib_ImageAffineTransform.3mlib.nachher 2013-06-05 21:36:19.487617409 
+0200
@@ -52,8 +52,9 @@
src   Pointer to source image.

-   mtx   Transformation matrix. mtx[0] holds a; mtx[1] holds b; mtx[2]
- holds tx; mtx[3] holds c; mtx[4] holds d; mtx[5] holds ty.
+   mtx   Transformation matrix.   mtx[0]  holds  a;  mtx[1]  holds  b;
+ mtx[2] holds tx; mtx[3] holds c; mtx[4] holds d; mtx[5] holds
+ ty.

filterType of resampling filter. It can be one of the following:



Re: [O] org-cut-subtree, bug?

2013-06-06 Thread Carsten Dominik

On 6 jun. 2013, at 09:58, Andreas Röhler andreas.roeh...@easy-emacs.de wrote:

 Hi,
 
 I'm misusing org-mode for a review of (slightly transformed) diffs as below.
 When done, want to delete the current section.
 
 Unfortunatly a call of M-x `org-cut-subtree' not just deletes the current 
 section, but also
 deletes the header-start of section beneath.


Hi Andreas,

I am not sure I understand the problem.  What do you mean by header-start of 
section?

- Carsten


 
 A bug? Better ways to do this?
 
 TIA,
 
 Andreas
 
 ;;
 
 * mlib_ImageAffineTransform_Fp.3mlib.vorher   2013-06-05 21:13:34.285757559 
 +0200
 +++ mlib_ImageAffineTransform_Fp.3mlib.nachher2013-06-05 
 21:13:40.824756887 +0200
 
 -   mtx   Transformation matrix. mtx[0] holds a; mtx[1] holds b; 
 mtx[2]
 - holds tx; mtx[3] holds c; mtx[4] holds d; mtx[5] holds ty.
 +   mtx   Transformation  matrix.   mtx[0]  holds  a;  mtx[1]  holds 
 b;
 + mtx[2] holds tx; mtx[3] holds c; mtx[4] holds d; mtx[5] 
 holds
 + ty.
 
filterType of resampling filter. It can be one of the following:
 
 * mlib_ImageAffineTransform.3mlib.vorher  2013-06-05 21:36:17.119617652 
 +0200
 +++ mlib_ImageAffineTransform.3mlib.nachher   2013-06-05 21:36:19.487617409 
 +0200
 @@ -52,8 +52,9 @@
src   Pointer to source image.
 
 -   mtx   Transformation matrix. mtx[0] holds a; mtx[1] holds b; 
 mtx[2]
 - holds tx; mtx[3] holds c; mtx[4] holds d; mtx[5] holds ty.
 +   mtx   Transformation matrix.   mtx[0]  holds  a;  mtx[1]  holds  
 b;
 + mtx[2] holds tx; mtx[3] holds c; mtx[4] holds d; mtx[5] 
 holds
 + ty.
 
filterType of resampling filter. It can be one of the following:
 




[O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Michael Bach
The LaTeX exporter does not honor the setting of
org-list-allow-alphabetical.  It exports ordered alphabetical list as
standard enumerate environment with numbered items.

org-mode 8.0.3

I placed the setq before loading ox-latex.  I read in the docstring that
org-list-allow-alphabetical should be set before org.el is loaded.  I
installed org-plus-contrib from ELPA and thus do not manually load org.el.

I found a post on this ml [1] on a related issue where the OP states that
doing the setq before loading the exporter solved his issue.

[1] https://lists.gnu.org/archive/html/emacs-orgmode/2013-04/msg01843.html


Re: [O] org-cut-subtree, bug?

2013-06-06 Thread Andreas Röhler

Am 06.06.2013 10:11, schrieb Carsten Dominik:


On 6 jun. 2013, at 09:58, Andreas Röhler andreas.roeh...@easy-emacs.de wrote:


Hi,

I'm misusing org-mode for a review of (slightly transformed) diffs as below.
When done, want to delete the current section.

Unfortunatly a call of M-x `org-cut-subtree' not just deletes the current 
section, but also
deletes the header-start of section beneath.



Hi Andreas,

I am not sure I understand the problem.  What do you mean by header-start of 
section?

- Carsten




The star, `*', introducing the header below. Which get's killed.

Thanks,

Andreas




[O] Blank lines in date-trees

2013-06-06 Thread Vincent Beffara

Hi, 

Very (very!) minor question: when capturing into a date-tree, is it
possible to have a blank line inserted before created day-headings?

Thx, /v

-- 
Vincent Beffara




Re: [O] [New Exporter] org-export-latex-after-initial-vars-hook

2013-06-06 Thread Michael Bach
Nicolas Goaziou address@hidden writes:

 Søren Mikkelsen address@hidden writes:

* But I have a problem with the exporter:*
**
* I have modified by org-exporter to export latex-files with the xelatex*
* compiler. The implementation uses the*
* org-export-latex-after-initial-vars-hook-hook to reconfigure the*
* default process, however, this hook seems to be deleted and I'm not*
* able to find equivalent hook.*

 Isn't it sufficient to customize `org-latex-pdf-process' so it uses

 xelatex?

I assume Søren is using a similar snippet [1] as I do which is very
convenient (credit goes to Bruno Tavernier). This approach lets you
specify a #+LATEX_CMD (think of xelatex, -shell-escape, etc.) on a per
file basis and allows LaTeX package 'injection'.

Is there a hook that is run before actual LaTeX export of a given
org-mode buffer in the new exporter engine?

[1] http://lists.gnu.org/archive/html/emacs-orgmode/2010-10/msg00218.html


Re: [O] org-cut-subtree, bug?

2013-06-06 Thread Carsten Dominik

On 6 jun. 2013, at 10:30, Andreas Röhler andreas.roeh...@easy-emacs.de wrote:

 Am 06.06.2013 10:11, schrieb Carsten Dominik:
 
 On 6 jun. 2013, at 09:58, Andreas Röhler andreas.roeh...@easy-emacs.de 
 wrote:
 
 Hi,
 
 I'm misusing org-mode for a review of (slightly transformed) diffs as below.
 When done, want to delete the current section.
 
 Unfortunatly a call of M-x `org-cut-subtree' not just deletes the current 
 section, but also
 deletes the header-start of section beneath.
 
 
 Hi Andreas,
 
 I am not sure I understand the problem.  What do you mean by header-start of 
 section?
 
 - Carsten
 
 
 
 The star, `*', introducing the header below. Which get's killed.


I am not able to reproduce this.

- Carsten

 
 Thanks,
 
 Andreas
 




Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Carsten Dominik

On 6 jun. 2013, at 10:20, Michael Bach pha...@gmail.com wrote:

 The LaTeX exporter does not honor the setting of org-list-allow-alphabetical. 
  

I think it never did.  Such a list is just an ordered list for export, the 
bullet type is just visual sugar in the Org buffer.
To force a special bulllet type, you should use other means (literal LaTeX).  
For example:

---
* test

1. skfkshafkj
2. fkjshfksj

#+LaTeX: {\renewcommand{\theenumi}{\alph{enumi}}

1. kajsfkjhf
2. fjsfksjhf

#+LaTeX: }

1. sss
2. ljhsdfkjh
---

I hope this helps.

- Carsten


 It exports ordered alphabetical list as standard enumerate environment with 
 numbered items.
 
 org-mode 8.0.3
 
 I placed the setq before loading ox-latex.  I read in the docstring that 
 org-list-allow-alphabetical should be set before org.el is loaded.  I 
 installed org-plus-contrib from ELPA and thus do not manually load org.el.
 
 I found a post on this ml [1] on a related issue where the OP states that 
 doing the setq before loading the exporter solved his issue.
 
 [1] https://lists.gnu.org/archive/html/emacs-orgmode/2013-04/msg01843.html
 



Re: [O] org-cut-subtree, bug?

2013-06-06 Thread Carsten Dominik

On 6 jun. 2013, at 10:56, Andreas Röhler andreas.roeh...@easy-emacs.de wrote:

 Am 06.06.2013 10:44, schrieb Carsten Dominik:
 
 On 6 jun. 2013, at 10:30, Andreas Röhler andreas.roeh...@easy-emacs.de 
 wrote:
 
 Am 06.06.2013 10:11, schrieb Carsten Dominik:
 
 On 6 jun. 2013, at 09:58, Andreas Röhler andreas.roeh...@easy-emacs.de 
 wrote:
 
 Hi,
 
 I'm misusing org-mode for a review of (slightly transformed) diffs as 
 below.
 When done, want to delete the current section.
 
 Unfortunatly a call of M-x `org-cut-subtree' not just deletes the current 
 section, but also
 deletes the header-start of section beneath.
 
 
 Hi Andreas,
 
 I am not sure I understand the problem.  What do you mean by header-start 
 of section?
 
 - Carsten
 
 
 
 The star, `*', introducing the header below. Which get's killed.
 
 
 I am not able to reproduce this.
 
 - Carsten
 
 
 Thanks,
 
 Andreas
 
 
 
 
 Okay, registered a kbd-macro which restores the star.  Fine for me.

I would still be interested if anyone else sees this problem.

- Carsten

 
 Thanks again,
 
 Andreas
 
 




Re: [O] org-cut-subtree, bug?

2013-06-06 Thread Andreas Röhler

Am 06.06.2013 10:44, schrieb Carsten Dominik:


On 6 jun. 2013, at 10:30, Andreas Röhler andreas.roeh...@easy-emacs.de wrote:


Am 06.06.2013 10:11, schrieb Carsten Dominik:


On 6 jun. 2013, at 09:58, Andreas Röhler andreas.roeh...@easy-emacs.de wrote:


Hi,

I'm misusing org-mode for a review of (slightly transformed) diffs as below.
When done, want to delete the current section.

Unfortunatly a call of M-x `org-cut-subtree' not just deletes the current 
section, but also
deletes the header-start of section beneath.



Hi Andreas,

I am not sure I understand the problem.  What do you mean by header-start of 
section?

- Carsten




The star, `*', introducing the header below. Which get's killed.



I am not able to reproduce this.

- Carsten



Thanks,

Andreas






Okay, registered a kbd-macro which restores the star.  Fine for me.

Thanks again,

Andreas





Re: [O] [New Exporter] org-export-latex-after-initial-vars-hook

2013-06-06 Thread Michael Bach
To minimize risk of eye cancer (previous version was sent from gmail
web interface at work without plain text setting) here it goes again:

Nicolas Goaziou address@hidden writes:

 Søren Mikkelsen address@hidden writes:

 But I have a problem with the exporter:

 I have modified by org-exporter to export latex-files with the xelatex
 compiler. The implementation uses the
 org-export-latex-after-initial-vars-hook-hook to reconfigure the
 default process, however, this hook seems to be deleted and I'm not
 able to find equivalent hook.

 Isn't it sufficient to customize `org-latex-pdf-process' so it uses
 xelatex?

I assume Søren is using a similar snippet [1] as I do which is very
convenient (credit goes to Bruno Tavernier). This approach lets you
specify a #+LATEX_CMD (think of xelatex, -shell-escape, etc.) on a per
file basis and allows LaTeX package 'injection'.

Is there a hook that is run before actual LaTeX export of a given
org-mode buffer in the new exporter engine?

[1] http://lists.gnu.org/archive/html/emacs-orgmode/2010-10/msg00218.html



Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Michael Bach
Carsten Dominik carsten.dominik at gmail.com writes:

 On 6 jun. 2013, at 10:20, Michael Bach phaebz at gmail.com wrote:
 The LaTeX exporter does not honor the setting of org-list-allow-
alphabetical.  
 
 I think it never did.  Such a list is just an ordered list for export, the 
bullet type is just visual sugar in the Org buffer.
 To force a special bulllet type, you should use other means (literal 
LaTeX).  For example:
 
 ---
 
 * test
 
 1. skfkshafkj
 2. fkjshfksj
 
 #+LaTeX: {\renewcommand{\theenumi}{\alph{enumi}}
 
 1. kajsfkjhf
 2. fjsfksjhf
 
 #+LaTeX: }
 
 1. sss
 2. ljhsdfkjh
 ---
 

Oh, I never saw it handled by the exporter, just a wrong assumption.  Just 
out of curiosity, do you think this could be implemented 'easily'?

Thanks for clarification and example.

Michael





Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Carsten Dominik

On 6 jun. 2013, at 11:11, Michael Bach pha...@gmail.com wrote:

 Carsten Dominik carsten.dominik at gmail.com writes:
 
 On 6 jun. 2013, at 10:20, Michael Bach phaebz at gmail.com wrote:
 The LaTeX exporter does not honor the setting of org-list-allow-
 alphabetical.  
 
 I think it never did.  Such a list is just an ordered list for export, the 
 bullet type is just visual sugar in the Org buffer.
 To force a special bulllet type, you should use other means (literal 
 LaTeX).  For example:
 
 ---
 
 * test
 
 1. skfkshafkj
 2. fkjshfksj
 
 #+LaTeX: {\renewcommand{\theenumi}{\alph{enumi}}
 
 1. kajsfkjhf
 2. fjsfksjhf
 
 #+LaTeX: }
 
 1. sss
 2. ljhsdfkjh
 ---
 
 
 Oh, I never saw it handled by the exporter, just a wrong assumption.  Just 
 out of curiosity, do you think this could be implemented 'easily'?


I guess it could be - but I am not sure if it should.  Conventions about the 
type of bullet to be used in a document belong to the typesetting side, and I 
rather establish a global setting for a document than follow my momentary 
decisions when I write the Org-mode version of it.  On a similar vein, we do 
have lists starting with - and * and +, but we still let LaTeX and HTML choose 
what to use as a bullet.  To me this feels like the right behavior.

- Carsten

 
 Thanks for clarification and example.
 
 Michael
 
 
 




Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Marcin Borkowski
Dnia 2013-06-06, o godz. 09:11:11
Michael Bach pha...@gmail.com napisał(a):

 Carsten Dominik carsten.dominik at gmail.com writes:
 
  On 6 jun. 2013, at 10:20, Michael Bach phaebz at gmail.com
  wrote: The LaTeX exporter does not honor the setting of
  org-list-allow-
 alphabetical.  
  
  I think it never did.  Such a list is just an ordered list for
  export, the 
 bullet type is just visual sugar in the Org buffer.
  To force a special bulllet type, you should use other means
  (literal 
 LaTeX).  For example:
  
  ---
  
  * test
  
  1. skfkshafkj
  2. fkjshfksj
  
  #+LaTeX: {\renewcommand{\theenumi}{\alph{enumi}}
  
  1. kajsfkjhf
  2. fjsfksjhf
  
  #+LaTeX: }
  
  1. sss
  2. ljhsdfkjh
  ---
  
 
 Oh, I never saw it handled by the exporter, just a wrong assumption.
 Just out of curiosity, do you think this could be implemented
 'easily'?

If you mean easily on the LaTeX side, then yes, check out the
enumitem package.  Example:

\documentclass{article}

\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label={Item number \arabic*:}]
\item First.
\item Second.
\end{enumerate}

\end{document}

But definitely check out the docs for that package, it is really good,
and supports much more than this.

 Thanks for clarification and example.
 
 Michael

Hth,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



Re: [O] org-cut-subtree, bug?

2013-06-06 Thread Andreas Röhler

Am 06.06.2013 10:56, schrieb Carsten Dominik:





The star, `*', introducing the header below. Which get's killed.



I am not able to reproduce this.

- Carsten



Thanks,

Andreas






Okay, registered a kbd-macro which restores the star.  Fine for me.


I would still be interested if anyone else sees this problem.

- Carsten



Thanks again,

Andreas







Provided stars making a header --by replacing the diffs header--, but did not 
indent the following section. Might be related to this.

Andreas



Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Michael Bach
Carsten Dominik carsten.dominik at gmail.com writes:

  Oh, I never saw it handled by the exporter, just a wrong assumption.  Just 
  out of curiosity, do you think this could be implemented 'easily'?
 
 I guess it could be - but I am not sure if it should.  Conventions about the 
type of bullet to be used in a document
 belong to the typesetting side, and I rather establish a global setting for 
a document than follow my
 momentary decisions when I write the Org-mode version of it.  On a similar 
vein, we do have lists starting
 with - and * and +, but we still let LaTeX and HTML choose what to use as a 
bullet.  To me this feels like the right behavior.

Good point.  The separation of typesetting and content is of course more 
reasonable than my lazyness.






Re: [O] [PATCH (new version)][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.

2013-06-06 Thread Rasmus
Sebastien Vauban sva-n...@mygooglest.com
writes:

 That makes me think of another point: how do I say that the HTML exported
 document is in American English?  By having a #+LANGUAGE: en-us specification.

 But that's not a valid language for Babel when exporting to LaTeX.

 So, I think we'd need some sort of alist with allowed values, and their
 equivalent for LaTeX and for HTML (and for other uses?), don't we?

That list is `org-latex-babel-language-alist'.  It has en-us and
translate it to =american=.

–Rasmus

-- 
Send from my Emacs




Re: [O] [PATCH (new version)][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.

2013-06-06 Thread Rasmus
Nicolas Goaziou n.goaz...@gmail.com writes:

 It changes behavior for your setup in that you can define a LANGUAGE
 that isn't a known abbreviation.

 While I think your patch is overall an improvement, I'm not convinced by
 this particular point. Indeed #+LANGUAGE: expects a language code as
 value, not just any string. This is important since latex backend is not
 the only one to use that keyword.

We can discard this, of course.  

 For example, imagine a user in need for german smart quotes. How do you
 explain to him than #+language: german will not work, but #+language: de
 will?

A combination of `org-latex-babel-language-alist' and 'look at the
output' and feeble explanations of translations :)

How do we explain that to use his favorite babel, perhaps his own
germanme, is not available extending org-latex-babel-language-alist?
Of course, in this case it's just a matter of using a LATEX_HEADER, so
it's not worth arguing about, and I'm happy to remove it.

 I think special Babel needs can be handled elsewhere.

Was this related to the above?

 You need to punctuate your sentence.

OK.

 +   (remove AUTO

 You can use `delete' instead of `remove': no need to copy the list.

Thanks.

 There cannot be any \n in the value, so you can use [ \t]+ instead.
 Also, you don't need the `replace-regexp-in-string' part:
   (org-split-string (match-string 1 header) ,[ \t]*)

I didn't know it was a repexp, thanks!

 The problem with this implementation is that it will not put LANGUAGE at
 the same place AUTO was. IOW, there's no difference between:

   #+LATEX_HEADER: \usepackage[AUTO,danish]{babel}

 and,

   #+LATEX_HEADER: \usepackage[danish,AUTO]{babel}

 although it matters in LaTeX.

Sure that's wasn't part of the 'deal', but I can see how it would
matter, and it makes more sense in this way.

I'll see if I can fix these bugs.  Thanks for the feedback.

–Rasmus

-- 
Powered by magic pixies!




Re: [O] [html] non-lists showing up as lists

2013-06-06 Thread Michael Strey

Bastien b...@gnu.org writes:

 4. Define that lists alway have to have a newline in front of them.

 I presume Michael means blank line.  I like this.

 Mhhh... I don't.

Yes, I meant blank lines and after rethinking I don't like it either.

My reason for not liking them is the LaTeX exporter.  The current
exporter respects the difference between the following two examples.

#+begin_src org-mode
Here is a line of text directly followed by a list
- item
- item
#+end_src

#+begin_src org-mode
Here is a line of text followed by a blank line followed by a list

- item
- item
#+end_src

The blank line makes a difference in LaTeX's PDF output.


Michael
-- 
mailto:mst...@strey.biz
http://www.strey.biz



[O] [PATCH] Make src block location available to execution backends

2013-06-06 Thread Vitalie Spinu

Hi again, 

I wrapped it in a patch. All tests are fine. Will be very happy if
someone could have a glance. I have my FSF papers signed.

Thanks, 

Vitalie

From 90dc398856c121c0a1cac36d6726e49d9fa31570 Mon Sep 17 00:00:00 2001
From: Vitalie Spinu spinu...@gmail.com
Date: Thu, 6 Jun 2013 12:04:02 +0200
Subject: [PATCH] make src block location available to execution backends

* lisp/ob-core.el (org-babel-where-is-src-block-head): return
  point-marker instead of point.

  (org-babel-current-exec-src-block-head): new global variable which is
  bound during `org-babel-execute-src-block-maybe'

  (org-babel-get-src-block-info): return a list of 7 elements, last
  being the header location

Evaluation backends might need to use the exact location of the block in
original org file. For example when inserting the correct source
references for visual debugging. With this patch the information on
current block is available in `org-babel-current-exec-src-block-head'.
---
 lisp/ob-core.el | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 8d26c4e..93c5d5e 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -251,14 +251,14 @@ references; a process which could likely result in the execution
 of other code blocks.
 
 Returns a list
- (language body header-arguments-alist switches name indent).
+ (language body header-arguments-alist switches name indent block-head).
   (let ((case-fold-search t) head info name indent)
 ;; full code block
 (if (setq head (org-babel-where-is-src-block-head))
 	(save-excursion
 	  (goto-char head)
 	  (setq info (org-babel-parse-src-block-match))
-	  (setq indent (car (last info)))
+	  (setq indent (nth 5 info))
 	  (setq info (butlast info))
 	  (while (and (forward-line -1)
 		  (looking-at org-babel-multi-line-header-regexp))
@@ -274,7 +274,7 @@ Returns a list
 ;; resolve variable references and add summary parameters
 (when (and info (not light))
   (setf (nth 2 info) (org-babel-process-params (nth 2 info
-(when info (append info (list name indent)
+(when info (append info (list name indent head)
 
 (defvar org-current-export-file) ; dynamically bound
 (defmacro org-babel-check-confirm-evaluate (info rest body)
@@ -535,6 +535,8 @@ can not be resolved.)
 
 ;;; functions
 (defvar call-process-region)
+(defvar org-babel-current-exec-src-block-head nil
+  Marker to the currently processed src block.)
 
 ;;;###autoload
 (defun org-babel-execute-src-block (optional arg info params)
@@ -562,6 +564,7 @@ block.
   (let* ((params (if params
 			 (org-babel-process-params merged-params)
 		   (nth 2 info)))
+	 (org-babel-current-exec-src-block-head (nth 6 info))
 	 (cachep (and (not arg) (cdr (assoc :cache params))
 			   (string= yes (cdr (assoc :cache params)
 	 (new-hash (when cachep (org-babel-sha1-hash info)))
@@ -592,7 +595,7 @@ block.
 		  (or (org-bound-and-true-p
 		   org-babel-call-process-region-original)
 		  (symbol-function 'call-process-region)))
-		 (indent (car (last info)))
+		 (indent (nth 5 info))
 		 result cmd)
 	(unwind-protect
 		(let ((call-process-region
@@ -1592,7 +1595,7 @@ If the point is not on a source block then return nil.
 ( top initial) ( initial bottom)
 (progn (goto-char top) (beginning-of-line 1)
 	   (looking-at org-babel-src-block-regexp))
-(point))
+(point-marker))
 
 ;;;###autoload
 (defun org-babel-goto-src-block-head ()
-- 
1.8.1.2







  Vitalie Spinu spinu...@gmail.com
  on Wed, 05 Jun 2013 15:49:08 +0200 wrote:

 VS Hi, 

 VS ESS has a visual debugger that depends on the availability of source
 VS references. It would be very nice if the debugger could step directly
 VS through org buffers.

 VS ESS was detecting org-src-edit buffers and redirecting references to
 VS original org file for already quite a while. That because of the
 VS availability of org-edit-src-beg-marker in src-edit
 VS buffers. Unfortunately similar functionality is not available in babel.

 VS I attach a patch that would allow ess-eval-buffer from ob-R.el to access
 VS the location of the currently executed block through a temporary stored
 VS marker in org-babel-current-exec-src-block-head.

 VS Vitalie


 VSModified   lisp/ob-core.el
 VS diff --git a/lisp/ob-core.el b/lisp/ob-core.el
 VS index 8d26c4e..653975a 100644
 VS --- a/lisp/ob-core.el
 VS +++ b/lisp/ob-core.el
 VS @@ -251,7 +251,7 @@ references; a process which could likely result in the 
execution
 VS  of other code blocks.
 
 VS  Returns a list
 VS - (language body header-arguments-alist switches name indent).
 VS + (language body header-arguments-alist switches name indent block-head).
 VS(let ((case-fold-search t) head info name indent)
 VS  ;; full code block
 VS  (if (setq head (org-babel-where-is-src-block-head))
 VS @@ -274,7 +274,7 @@ Returns a list
 VS  ;; resolve variable references 

Re: [O] [New Exporter] org-export-latex-after-initial-vars-hook

2013-06-06 Thread Michael Bach
 Is there a hook that is run before actual LaTeX export of a given
 org-mode buffer in the new exporter engine?
 

For reference:
I got it to work by adapting the snippet from Bruno Tavernier[1]:
#+begin_src emacs-lisp
(defun my-auto-tex-cmd (backend)
When exporting from .org with latex,
automatically run latex, pdflatex, or xelatex as appropriate,
using latexmk.
(let ((texcmd))
  (setq texcmd latexmk -pdf %f)
  (if (string-match LATEX_CMD: pdflatex (buffer-string))
  (setq texcmd latexmk -pdflatex=pdflatex -pdf %f))
  (if (string-match LATEX_CMD: pdflatex-shell-escape (buffer-string))
  (setq texcmd latexmk -pdflatex=pdflatex --shell-escape -pdf %f))
  (if (string-match LATEX_CMD: xelatex (buffer-string))
  (setq texcmd latexmk -pdflatex=xelatex -pdf %f))
  (setq org-latex-pdf-process (list texcmd
  (add-hook 'org-export-before-parsing-hook 'my-auto-tex-cmd)
#+end_src

One thing that tripped me up initially was the requirement for the function to 
accept exactly one argument (unused in this case).

[1] http://lists.gnu.org/archive/html/emacs-orgmode/2010-10/msg00218.html





[O] unexpected \usetheme{default}

2013-06-06 Thread Feng Shu

Hi:

when I export to a org file to article pdf with latex , I find that 
\usetheme{default}
is inserted into the tex file.  How to avoid this?


thanks

 

-- 



Re: [O] unexpected \usetheme{default}

2013-06-06 Thread Sebastien Vauban
Feng Shu wrote:
 when I export to a org file to article pdf with latex , I find that
 \usetheme{default} is inserted into the tex file. How to avoid this?

It seems you're exporting to Beamer (C-c C-e l P/O)?

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] unexpected \usetheme{default}

2013-06-06 Thread Feng Shu
Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 Feng Shu wrote:
 when I export to a org file to article pdf with latex , I find that
 \usetheme{default} is inserted into the tex file. How to avoid this?

 It seems you're exporting to Beamer (C-c C-e l P/O)?

You are right, thanks!


 Best regards,
   Seb

-- 



Re: [O] Oorg-export-generic.el and emphasize

2013-06-06 Thread Wes Hardaker
celano cel...@laposte.net writes:

 I tried exporting a text with emphasize, but it doesn't work.
 The man page speaks about sections, lists and such other things, but
 nothing about emphasizing and bold text.
 http://orgmode.org/worg/org-contrib/org-export-generic.html

You're right that it doesn't do this.

The generic exporter really needs to be rewritten to make use of the new
parser, now that it exists...  I've been meaning to look into doing just
that but haven't yet found the time.
-- 
Wes Hardaker 
My Pictures:  http://capturedonearth.com/
My Thoughts:  http://pontifications.hardakers.net/



Re: [O] refine org-babel-tangle-jump-to-org?

2013-06-06 Thread Eric Schulte
 the tangled file looks as follow, including the empty lines at
 beginning and end:

 ,
 | 
 | ## [[file:~/tmp/jumpBack.org::*newASM%20(./newASM.R)][newASM\ 
 \(\./newASM\.R\):1]]
 | 
 | 
 logList(##)
 |   
 logList(##)
 |   logList()
 |   logList( Simulation object ASM created.)
 |   logList()
 |   logList( It has been undergone basic initialisation and will)
 |   logList( be initialised for usage when simulated by running)
 |   logList()
 |   logList(  sim(ASM))
 |   logList()
 |   logList( or manually, without simulating, by running)
 |   logList(  ASM - initialize(ASM))
 |   logList()
 |   
 logList(##)
 |   logList()
 |   logList( paste( GISDBASE : , parms(ASM)$baseDir) )
 |   logList( paste( LOCATION : , parms(ASM)$grassLocation) )
 |   logList( paste( MAPSET   : , parms(ASM)$grassMapset) )
 |   logList()
 |   
 logList(##)
 |   
 logList(##)
 |   logEnd()
 |   return(ASM)
 | }
 | 
 | ## newASM\ \(\./newASM\.R\):1 ends here
 | 
 `

 This one works, although the cursor is consistently two characters to the 
 left then
 where it should be.


This is off because the first line of your example is not indented
correctly when tangled.  Specifically, it is indented by two spaces in
the source file and by four spaces in the code block.  Setting the
`org-src-preserve-indentation' variable to t should fix this.


 If I change

 ,
 | #+PROPERTY: padline yes
 `

 to

 ,
 | #+PROPERTY: padline no
 `

 the padlines are gone, ant the jumping back is completely off (from
 first r in return() it jumps to the third # in the last logList()).


For now I think both padlines and link comments are required for the
jumping functionality to work.  I've updated the documentation to
reflect this.

,
| @subheading Jumping between code and Org
| 
| When tangling code from an Org-mode buffer to a source code file, you'll
| frequently find yourself viewing the file of tangled source code (e.g., many
| debuggers point to lines of the source code file).  It is useful to be able
| to navigate from the tangled source to the Org-mode buffer from which the
| code originated.
| 
| The @code{org-babel-tangle-jump-to-org} function provides this jumping from
| code to Org-mode functionality.  Two header arguments are required for
| jumping to work, first the @xref{padline} option must be set to true (the
| default setting), second the @xref{comments} header argument must be set to
| @code{links}, which will insert comments into the source code buffer which
| point back to the original Org-mode file.
`

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] Other question concerning org-babel-tangle-jump-to-org

2013-06-06 Thread Eric Schulte
Rainer M Krug rai...@krugs.de writes:

 Would it be possible, that the function does not open a new window when
 executed, but uses the same window the tangled file is in? I am using
 org for literate programming in R (ESS): 
 - R console left window 
 - when there is an error, I jump to the R file in the right window and
 call there org-babel-tangle-jump-to-org and the org file is opened in
 the left window. It would be easier for debugging, if it would open in
 the right window, where the R file is already open.

 Would that be possible?


I just updated the `org-babel-tangle-jump-to-org' function so that it
now uses the same jumping mechanism used to edit source code blocks, so
your source code settings (e.g., same window or different window) should
now apply to source-org jumping.

Cheers,


 Thanks,

 Rainer

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] Auto-unfold subtrees with matches in query-replace (et al.?)

2013-06-06 Thread Michael Bach
Hi Bastien,

On Tue, May 14, 2013 at 10:34 AM, Bastien b...@gnu.org wrote:

 Would be a nice feature to have -- don't hesitate to report it with
 M-x report-emacs-bug RET


Done. Thanks for explanation.

Michael



Re: [O] [PATCH] Make src block location available to execution backends

2013-06-06 Thread Eric Schulte
Vitalie Spinu spinu...@gmail.com writes:

 Hi again, 

 I wrapped it in a patch. All tests are fine. Will be very happy if
 someone could have a glance. I have my FSF papers signed.


I've just applied this patch.  I think this is an excellent idea, and I
appreciate the clean implementation and packaging into a git-patch.

Cheers!


 Thanks,

 Vitalie


 From 90dc398856c121c0a1cac36d6726e49d9fa31570 Mon Sep 17 00:00:00 2001
 From: Vitalie Spinu spinu...@gmail.com
 Date: Thu, 6 Jun 2013 12:04:02 +0200
 Subject: [PATCH] make src block location available to execution backends

 * lisp/ob-core.el (org-babel-where-is-src-block-head): return
   point-marker instead of point.

   (org-babel-current-exec-src-block-head): new global variable which is
   bound during `org-babel-execute-src-block-maybe'

   (org-babel-get-src-block-info): return a list of 7 elements, last
   being the header location

 Evaluation backends might need to use the exact location of the block in
 original org file. For example when inserting the correct source
 references for visual debugging. With this patch the information on
 current block is available in `org-babel-current-exec-src-block-head'.
 ---
  lisp/ob-core.el | 13 -
  1 file changed, 8 insertions(+), 5 deletions(-)

 diff --git a/lisp/ob-core.el b/lisp/ob-core.el
 index 8d26c4e..93c5d5e 100644
 --- a/lisp/ob-core.el
 +++ b/lisp/ob-core.el
 @@ -251,14 +251,14 @@ references; a process which could likely result in the 
 execution
  of other code blocks.
  
  Returns a list
 - (language body header-arguments-alist switches name indent).
 + (language body header-arguments-alist switches name indent block-head).
(let ((case-fold-search t) head info name indent)
  ;; full code block
  (if (setq head (org-babel-where-is-src-block-head))
   (save-excursion
 (goto-char head)
 (setq info (org-babel-parse-src-block-match))
 -   (setq indent (car (last info)))
 +   (setq indent (nth 5 info))
 (setq info (butlast info))
 (while (and (forward-line -1)
 (looking-at org-babel-multi-line-header-regexp))
 @@ -274,7 +274,7 @@ Returns a list
  ;; resolve variable references and add summary parameters
  (when (and info (not light))
(setf (nth 2 info) (org-babel-process-params (nth 2 info
 -(when info (append info (list name indent)
 +(when info (append info (list name indent head)
  
  (defvar org-current-export-file) ; dynamically bound
  (defmacro org-babel-check-confirm-evaluate (info rest body)
 @@ -535,6 +535,8 @@ can not be resolved.)
  
  ;;; functions
  (defvar call-process-region)
 +(defvar org-babel-current-exec-src-block-head nil
 +  Marker to the currently processed src block.)
  
  ;;;###autoload
  (defun org-babel-execute-src-block (optional arg info params)
 @@ -562,6 +564,7 @@ block.
(let* ((params (if params
(org-babel-process-params merged-params)
  (nth 2 info)))
 +  (org-babel-current-exec-src-block-head (nth 6 info))
(cachep (and (not arg) (cdr (assoc :cache params))
  (string= yes (cdr (assoc :cache params)
(new-hash (when cachep (org-babel-sha1-hash info)))
 @@ -592,7 +595,7 @@ block.
 (or (org-bound-and-true-p
  org-babel-call-process-region-original)
 (symbol-function 'call-process-region)))
 -  (indent (car (last info)))
 +  (indent (nth 5 info))
result cmd)
   (unwind-protect
   (let ((call-process-region
 @@ -1592,7 +1595,7 @@ If the point is not on a source block then return nil.
  ( top initial) ( initial bottom)
  (progn (goto-char top) (beginning-of-line 1)
  (looking-at org-babel-src-block-regexp))
 -(point))
 +(point-marker))
  
  ;;;###autoload
  (defun org-babel-goto-src-block-head ()

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] Automatically adding local variables to tangled file

2013-06-06 Thread Eric Schulte
 It's a good idea to have useful information in the tangled file that can
 help these functions. But since org-mode can already tangle with comments
 containing useful information, isn't this enough to detect that the file
 is a tangled file?


I personally prefer the solution shown below of adding a file-local
variable using the post-tangle hook.  As mentioned previously this makes
the detection of tangled code much faster, simpler and less error prone
than grepping the file for comments.


 On the other hand, a local variable in the tangled files to set the buffer
 to read-only could be very useful to avoid the mistake of editing the
 tangled files directly.


We already set the permission of tangled files to be executable when
they include a shebang line.  Perhaps we could add an option (or change
the default) to set the permissions of tangled files to be read only.

Perhaps this could be done using the post-tangle hook with something
like the following.

;; -*- emacs-lisp -*-
(defun org-babel-mark-tangled-as-read-only ()
  Mark the current file read only.
If it is executable keep it executable.
  (if (= #o755 (file-modes (buffer-file-name)))
  (set-file-modes (buffer-file-name) #o555)
  (set-file-modes (buffer-file-name) #o444)))

(add-hook 'org-babel-post-tangle-hook 'org-babel-mark-tangled-as-read-only)

 
 Therefore my question:
 
 Would it be possible and reasonable, to add a local variable to each
 tangled file which identifies the file as an file tangled from an org
 mode file?
 
 He added the following to his config file to test the approach:
 
 ,
 |  (defvar org-babel-tangled-file nil
 |  If non-nill, current file was tangled with org-babel-tangle)
 |(put 'org-babel-tangled-file 'safe-local-variable 'booleanp)
 |
 |(defun org-babel-mark-file-as-tangled ()
 |  (add-file-local-variable 'org-babel-tangled-file t)
 |  (basic-save-buffer))
 | 
 |(add-hook 'org-babel-post-tangle-hook 'org-babel-mark-file-as-tangled)
 `
 

I think the above code should be considered an implementation rather
than simply a test.  This is exactly what the post-tangle hook is
intended to support.  Is there a motivating reason for this behavior to
be built in?

 
 and he also already added automatic redirection to the org mode file
 via org-babel-tangle-jump-to-org to ESS on SVN.
 
 To keep backwards compatibility, a variable
 org-babel-tangle-add-tangled-file-variable could be introduced, which
 can have the following values:
 
 - nil :: (default) do not add anything
 - t :: org-babel-tangled-file is added as t to the tangled files
 - name :: org-babel-tangled-file is set to the org file name
 - path :: org-babel-tangled-file is set to the path of the org file
 - all :: org-babel-tangled-file is set to the full name including path
of the org file
 
 I can even imagine many more possibilities for the use of local file
 variables to store meta data in the tangled file (VCS info comes to
 mind, which would enable one to even go back to older revisions based on
 the tangled code rather easily).
 

I agree that local-file variables show much promise, although I think
(at least for now) the best way to set such variables is through the
post-tangle-hook as Vitalie has already done.

Best,

 
 Cheers,
 
 Rainer
 
 -- 
 Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
 UCT), Dipl. Phys. (Germany)
 
 Centre of Excellence for Invasion Biology
 Stellenbosch University
 South Africa
 
 Tel :   +33 - (0)9 53 10 27 44
 Cell:   +33 - (0)6 85 62 59 98
 Fax :   +33 - (0)9 58 10 27 44
 
 Fax (D):+49 - (0)3 21 21 25 22 44
 
 email:  rai...@krugs.de
 
 Skype:  RMkrug

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] Suppressing interpeter output in code blocks

2013-06-06 Thread Eric Schulte
Michael Steeves stee...@raingods.net writes:

 Apologies if this is documented somehere, but I haven't been having much
 luck in trying to find the answer to this.

 If I have an org doc with some python code in it

 #+begin_src python :session testing :results output
 a = 1
 b = 2
 c = a + b
 print Hello, world.
 #+end_src

 when I evaluate the block, the output is

 #+RESULTS:
 : Python 2.7.5 (default, May 19 2013, 13:26:46)
 : [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))]
 on darwin
 : Type help, copyright, credits or license for more information.
 :   Hello, world.

 Is there any way to suppress all the extra text, and just get the
 Hello, world. string as my output?


#+begin_src python :session testing
a = 1
b = 2
c = a + b
Hello, world.
#+end_src

#+RESULTS:
: Hello, world.

Best,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] [PATCH] ob-fortran.el, add matrix as input

2013-06-06 Thread Eric Schulte
Achim Gratz strom...@nexgo.de writes:

 Eric Schulte writes:
 Applied, Thanks!

 Litvinov Sergey slitvi...@gmail.com writes:

 I would like to propose a tiny patch which adds matrix as an input for
 ob-fortran.el. See changes in testing/examples/ob-fortran-test.org for
 the examples.

 I've not had time to test with anything, but this patch seems to make
 the same faulty assumption about tables always being a list of lists
 that I fixed just a few days ago someplace else.  When dealing with
 tables you have to expect hlines in place of a list with the row values
 otherwise you will not correctly recognize them.


Agreed, I've just updated the matrix check in ob-fortran to be more
strict so that tables with hlines will not be treated as matrices.

A more sophisticated solution to correctly interpret hlines in a manner
acceptable to Fortran would require more Fortran knowledge than I
posses.

Best,



 Regards,
 Achim.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] [PATCH] ob-C: Add list support.

2013-06-06 Thread Eric Schulte
Hi Rüdiger,

Thanks for sharing this patch.  I looks great, however as it is 10
lines long to apply it we'll need you to sign the FSF papers.  Please
see the following page for more information.

  http://orgmode.org/worg/org-contribute.html

Thanks,

Rüdiger Sonderfeld ruedi...@c-plusplus.de writes:

 * lisp/ob-C.el (org-babel-C-var-to-C): Add list support
 (org-babel-C-val-to-C-list-type, org-babel-C-val-to-C-type,
 org-babel-C-format-val): New functions.
 (org-babel-C-ensure-main-wrap, org-babel-execute:C,
 org-babel-execute:C++, rg-babel-execute:cpp, org-babel-C++-compiler,
 org-babel-C-compiler): Improve docstring.
 * testing/examples/ob-C-test.org (string_var): Add required std::
 (Array): Add missing ID.
 (Matrix): Add tests for list support.
 * testing/lisp/test-ob-C.el (ob-C/table): Test succeeds.
 (ob-C/list-var, ob-C/vector-var, ob-C/list-list-var): Add tests for
 list support.

 Signed-off-by: Rüdiger Sonderfeld ruedi...@c-plusplus.de
 ---
  lisp/ob-C.el   | 98 
 +++---
  testing/examples/ob-C-test.org | 28 +++-
  testing/lisp/test-ob-C.el  | 20 -
  3 files changed, 118 insertions(+), 28 deletions(-)

 diff --git a/lisp/ob-C.el b/lisp/ob-C.el
 index b1e8a06..e9eec93 100644
 --- a/lisp/ob-C.el
 +++ b/lisp/ob-C.el
 @@ -44,24 +44,24 @@ (defvar org-babel-default-header-args:C '())
  
  (defvar org-babel-C-compiler gcc
Command used to compile a C source code file into an
 -  executable.)
 +executable.)
  
  (defvar org-babel-C++-compiler g++
Command used to compile a C++ source code file into an
 -  executable.)
 +executable.)
  
  (defvar org-babel-c-variant nil
Internal variable used to hold which type of C (e.g. C or C++)
  is currently being evaluated.)
  
  (defun org-babel-execute:cpp (body params)
 -  Execute BODY according to PARAMS.  This function calls
 -`org-babel-execute:C++'.
 +  Execute BODY according to PARAMS.
 +This function calls `org-babel-execute:C++'.
(org-babel-execute:C++ body params))
  
  (defun org-babel-execute:C++ (body params)
 -  Execute a block of C++ code with org-babel.  This function is
 -called by `org-babel-execute-src-block'.
 +  Execute a block of C++ code with org-babel.
 +This function is called by `org-babel-execute-src-block'.
(let ((org-babel-c-variant 'cpp)) (org-babel-C-execute body params)))
  
  (defun org-babel-expand-body:C++ (body params)
 @@ -70,8 +70,8 @@ (defun org-babel-expand-body:C++ (body params)
(let ((org-babel-c-variant 'cpp)) (org-babel-C-expand body params)))
  
  (defun org-babel-execute:C (body params)
 -  Execute a block of C code with org-babel.  This function is
 -called by `org-babel-execute-src-block'.
 +  Execute a block of C code with org-babel.
 +This function is called by `org-babel-execute-src-block'.
(let ((org-babel-c-variant 'c)) (org-babel-C-execute body params)))
  
  (defun org-babel-expand-body:c (body params)
 @@ -146,10 +146,10 @@ (defun org-babel-C-expand (body params)
 body) \n) \n)))
  
  (defun org-babel-C-ensure-main-wrap (body)
 -  Wrap body in a \main\ function call if none exists.
 +  Wrap BODY in a \main\ function call if none exists.
(if (string-match ^[ \t]*[intvod]+[ \t\n\r]*main[ \t]*(.*) body)
body
 -(format int main() {\n%s\nreturn(0);\n}\n body)))
 +(format int main() {\n%s\nreturn 0;\n}\n body)))
  
  (defun org-babel-prep-session:C (session params)
This function does nothing as C is a compiled language with no
 @@ -163,6 +163,59 @@ (defun org-babel-load-session:C (session body params)
  
  ;; helper functions
  
 +(defun org-babel-C-format-val (type val)
 +  Handle the FORMAT part of TYPE with the data from VAL.
 +  (let ((format-data (cadr type)))
 +(if (stringp format-data)
 + (cons  (format format-data val))
 +  (funcall format-data val
 +
 +(defun org-babel-C-val-to-C-type (val)
 +  Determine the type of VAL.
 +Return a list (TYPE-NAME FORMAT).  TYPE-NAME should be the name of the type.
 +FORMAT can be either a format string or a function which is called with VAL.
 +  (cond
 +   ((integerp val) '(int %d))
 +   ((floatp val) '(double %f))
 +   ((or (listp val) (vectorp val))
 +(lexical-let ((type (org-babel-C-val-to-C-list-type val)))
 +  (list (car type)
 + (lambda (val)
 +   (cons
 +(format [%d]%s
 +(length val)
 +(car (org-babel-C-format-val type (elt val 0
 +(concat { 
 +(mapconcat (lambda (v)
 + (cdr (org-babel-C-format-val type v)))
 +   val
 +   , )
 + }))
 +   (t ;; treat unknown types as string
 +'(char (lambda (val)
 +(let ((s (format %s val))) ;; convert to string for unknown 
 types
 +  (cons (format [%d] (1+ (length s)))
 +(concat \ s \
 +
 +(defun 

Re: [O] [html] non-lists showing up as lists

2013-06-06 Thread Bernt Hansen
Samuel Wales samolog...@gmail.com writes:

 I don't recall whether I said I had a filling problem.

 Filling is a red herring for my use case.

 My point is that regardless of filling, it would be a good idea to be
 stricter about what a list is, for the reasons I listed.  In my use
 case.

 Samuel

Hi Samuel,

I use org indent mode all the time so most of my lists start in column
0.  Requiring an indent will break my existing org data (which goes back
years now) so I don't want indented lists to be a requirement if it is
not absolutely necessary.

Just my two cents.

Regards,
Bernt



Re: [O] link abbreviation with multiple params, e. g. for geo locations

2013-06-06 Thread Eric Schulte
Michael Brand michael.ch.br...@gmail.com writes:

 Hi all

 On Tue, May 7, 2013 at 12:29 AM, Christian Moe m...@christianmoe.com wrote:
 I'm afraid knowing that doesn't help much. The problem is, you don't know
 what point the inline call is at, so you cannot point org-entry-get to
 the right entry. If you try

 : (org-entry-get (point) geo)

 it will look for a geo property in the outline entry the source block is
 in, not in the entry the call comes from.

 I don't know any easy way to pass a parameter to a source block from an
 outline entry property via an inline call in that entry. Others may know
 better.

 After some trials it seemed to me that it is enough to just add a loc
 (point-marker) to a let of org-babel-ref-resolve. Now when the Lisp
 variable loc (Location Of Call) is used as the first argument of
 org-entry-get it reads the property from that entry where the code
 block has been called. With this, Babel perfectly covers every
 requirement of my use case described earlier in this thread.

 Please review and comment my attached patch containing doc and ERT.


Please forgive my lateness to this thread.  Is the only requirement that
the point from which a code block was called be accessible to the
emacs-lisp code executed within that code block?

If so then there should be no need for additional development.  The
following already works thanks to some very recently applied changes.
See the attached example which demonstrates how to access the point of
the original call from a code block.

Cheers,

#+Options: ^:{}

* Org babel function for Google Maps browser

Here I simplify the previous Google maps function to simply
demonstrate the recovery of entry properties.

#+NAME: gmb
#+HEADER: :var geo_var=(or (org-entry-get org-babel-current-exec-src-block-head geo) 4.56,7.89)
#+BEGIN_SRC emacs-lisp :results silent
  (format geo_var is %s geo_var)
#+END_SRC

* example of a geo location, realistic to try out
  :PROPERTIES:
  :geo:  4.56,7.89
  :END:

- call_gmb() =geo_var is 4.56,7.89=
  - interactively (type C-c on call_gmb) visualize the current geo
location on Google Maps with a marker and as map in the
browser

* another geo location
  :PROPERTIES:
  :geo:  4.44,5.55
  :END:

- call_gmb() =geo_var is 4.44,5.55=
  - visualize another geo location as terrain

-- 
Eric Schulte
http://cs.unm.edu/~eschulte


[O] Help, I need to paste raw image from clipboard into emacs/orgmode

2013-06-06 Thread Klaus-Dieter Bauer

 Dear All,
 Please Help,
 I need to paste raw image from clipboard into emacs/orgmode, I am a
 microsoft onenote user and I got used to take a lot of snapshots and embed
 it into my notes, I think if I could know how to embed images directly into
 emacs/orgmode from clipboard, I will switch to emacs very easily.

 I searched the internet but unfortunately I didn't find the answer,
 Thanks a lot.
 Dodo


Hello!

While the original poster probably long since has implemented one of the
previously suggested solutions (or given up) I thought I'd share a more
general solution I found [1].

ImageMagick's `convert' can use clipboard: as input file (don't know if it
works as output file).

convert clipboard: FILENAME-WITH-EXTENSION

I tested it with the cygwin and native windows versions and both worked.

king regards, Klaus


PS1: On Windows `convert.exe' might be shadowed by another executable,
especially C:\Windows\System32\convert.exe. In that case the PATH variable
should be adjusted such that ImageMagick comes before C:\Windows\system32.
To check what shadows the executable, you can run where convert in the
Windows-commandline.
PS2: On Windows only basic image-displaying-support is included
out-of-the-box. To get full support, the easiest way is to install the full
GnuWin32 tools (which include the necessary image libraries) with the
web-installer.

--

[1] User magick in
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1t=7524p=22859
.


Re: [O] [PATCH] ob-C: Add list support.

2013-06-06 Thread Eric Schulte
Rüdiger Sonderfeld ruedi...@c-plusplus.de writes:

 Hi Eric,

 On Thursday 06 June 2013 10:21:26 Eric Schulte wrote:
 Thanks for sharing this patch.  I looks great, however as it is 10
 lines long to apply it we'll need you to sign the FSF papers.  Please
 see the following page for more information.

 I have signed the papers already.


Okay great,

Would you mind re-sending your patch as formatted with git format-patch
so that I can easily apply it?  The version in your previous email
throws errors when applied with git am.

Carsten,

Could you add Rüdiger to the list of contributors on worg?

Thanks,


 Regards
 Rüdiger

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] [html] non-lists showing up as lists

2013-06-06 Thread Samuel Wales
Hi Bernt,

Optional.

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY can get it.



Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Josiah Schwab
 On 6 jun. 2013, at 10:20, Michael Bach phaebz at gmail.com wrote:
 The LaTeX exporter does not honor the setting of 
 org-list-allow-alphabetical.  

A week or so ago I asked a similar question about the HTML export and lists.
http://lists.gnu.org/archive/html/emacs-orgmode/2013-05/msg01324.html
So I just wanted to toss in my 2¢.

On Jun 6, 2013, at 2:17 AM, Carsten Dominik wrote:
 Conventions about the type of bullet to be used in a document belong to the 
 typesetting side, and I rather establish a global setting for a document than 
 follow my momentary decisions when I write the Org-mode version of it.  On a 
 similar vein, we do have lists starting with - and * and +, but we still let 
 LaTeX and HTML choose what to use as a bullet.  To me this feels like the 
 right behavior.

I think this argument makes sense;  and to be honest, that's probably how I 
want the exporter to behave most of the time.

However, there is particular use case where I find this frustrating, which is 
writing problem sets.  There I like to reference other parts of the problems by 
name.  For example, 

a) Do something.
b) Use your answer in part a) to do something else.

Then, if I want to export it to multiple formats (say, html and pdf), there is 
no general way to tell orgmode: my alphabetical bullet choice was meaningful, 
please try to preserve it.  One ends up inserting little workarounds for each 
export format.  Which is not a big deal, but when everything else works so 
seamlessly it's these little things that stand out :)

Best,
Josiah


[O] [PATCH] ob-C: Add list support.

2013-06-06 Thread Rüdiger Sonderfeld
* lisp/ob-C.el (org-babel-C-var-to-C): Add list support
(org-babel-C-val-to-C-list-type, org-babel-C-val-to-C-type,
org-babel-C-format-val): New functions.
(org-babel-C-ensure-main-wrap, org-babel-execute:C,
org-babel-execute:C++, rg-babel-execute:cpp, org-babel-C++-compiler,
org-babel-C-compiler): Improve docstring.
* testing/examples/ob-C-test.org (string_var): Add required std::
(Array): Add missing ID.
(Matrix): Add tests for list support.
* testing/lisp/test-ob-C.el (ob-C/table): Test succeeds.
(ob-C/list-var, ob-C/vector-var, ob-C/list-list-var): Add tests for
list support.

Signed-off-by: Rüdiger Sonderfeld ruedi...@c-plusplus.de
---
 lisp/ob-C.el   | 98 +++---
 testing/examples/ob-C-test.org | 28 +++-
 testing/lisp/test-ob-C.el  | 20 -
 3 files changed, 118 insertions(+), 28 deletions(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index b1e8a06..e9eec93 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -44,24 +44,24 @@ (defvar org-babel-default-header-args:C '())
 
 (defvar org-babel-C-compiler gcc
   Command used to compile a C source code file into an
-  executable.)
+executable.)
 
 (defvar org-babel-C++-compiler g++
   Command used to compile a C++ source code file into an
-  executable.)
+executable.)
 
 (defvar org-babel-c-variant nil
   Internal variable used to hold which type of C (e.g. C or C++)
 is currently being evaluated.)
 
 (defun org-babel-execute:cpp (body params)
-  Execute BODY according to PARAMS.  This function calls
-`org-babel-execute:C++'.
+  Execute BODY according to PARAMS.
+This function calls `org-babel-execute:C++'.
   (org-babel-execute:C++ body params))
 
 (defun org-babel-execute:C++ (body params)
-  Execute a block of C++ code with org-babel.  This function is
-called by `org-babel-execute-src-block'.
+  Execute a block of C++ code with org-babel.
+This function is called by `org-babel-execute-src-block'.
   (let ((org-babel-c-variant 'cpp)) (org-babel-C-execute body params)))
 
 (defun org-babel-expand-body:C++ (body params)
@@ -70,8 +70,8 @@ (defun org-babel-expand-body:C++ (body params)
   (let ((org-babel-c-variant 'cpp)) (org-babel-C-expand body params)))
 
 (defun org-babel-execute:C (body params)
-  Execute a block of C code with org-babel.  This function is
-called by `org-babel-execute-src-block'.
+  Execute a block of C code with org-babel.
+This function is called by `org-babel-execute-src-block'.
   (let ((org-babel-c-variant 'c)) (org-babel-C-execute body params)))
 
 (defun org-babel-expand-body:c (body params)
@@ -146,10 +146,10 @@ (defun org-babel-C-expand (body params)
  body) \n) \n)))
 
 (defun org-babel-C-ensure-main-wrap (body)
-  Wrap body in a \main\ function call if none exists.
+  Wrap BODY in a \main\ function call if none exists.
   (if (string-match ^[ \t]*[intvod]+[ \t\n\r]*main[ \t]*(.*) body)
   body
-(format int main() {\n%s\nreturn(0);\n}\n body)))
+(format int main() {\n%s\nreturn 0;\n}\n body)))
 
 (defun org-babel-prep-session:C (session params)
   This function does nothing as C is a compiled language with no
@@ -163,6 +163,59 @@ (defun org-babel-load-session:C (session body params)
 
 ;; helper functions
 
+(defun org-babel-C-format-val (type val)
+  Handle the FORMAT part of TYPE with the data from VAL.
+  (let ((format-data (cadr type)))
+(if (stringp format-data)
+   (cons  (format format-data val))
+  (funcall format-data val
+
+(defun org-babel-C-val-to-C-type (val)
+  Determine the type of VAL.
+Return a list (TYPE-NAME FORMAT).  TYPE-NAME should be the name of the type.
+FORMAT can be either a format string or a function which is called with VAL.
+  (cond
+   ((integerp val) '(int %d))
+   ((floatp val) '(double %f))
+   ((or (listp val) (vectorp val))
+(lexical-let ((type (org-babel-C-val-to-C-list-type val)))
+  (list (car type)
+   (lambda (val)
+ (cons
+  (format [%d]%s
+  (length val)
+  (car (org-babel-C-format-val type (elt val 0
+  (concat { 
+  (mapconcat (lambda (v)
+   (cdr (org-babel-C-format-val type v)))
+ val
+ , )
+   }))
+   (t ;; treat unknown types as string
+'(char (lambda (val)
+  (let ((s (format %s val))) ;; convert to string for unknown 
types
+(cons (format [%d] (1+ (length s)))
+  (concat \ s \
+
+(defun org-babel-C-val-to-C-list-type (val)
+  Determine the C array type of a VAL.
+  (let (type)
+(mapc
+ #'(lambda (i)
+(let* ((tmp-type (org-babel-C-val-to-C-type i))
+   (type-name (car type))
+   (tmp-type-name (car tmp-type)))
+  (when (and type (not (string= type-name tmp-type-name)))
+(if (and (member type-name '(int double int32_t))

[O] Customizing export globally

2013-06-06 Thread Klaus-Dieter Bauer
Hello!

Is it possible, short of hacking the exporters, to get indentation of
non-list paragraphs preserved?

E.g. I want some nice-looking formatting inside emacs:

==
And thus Einstein wrote:

E = mc^2
==

The same visual effect in export could be achieved by

==
And thus Einstein wrote:

#+begin_quote
E = mc^2
#+end_quote
==

but at the cost of visual clutter in the org-mode file which by my
emacs-centric export-as-an-afterthought usage would be worse than unwanted
export formatting (I have partially solved this by making the #+ lines
ALMOST white but still...).

I fear the answer will be no, as in the first example both paragraphs are
exported entirely equally as pTEXT/p.

My closest alternative is falling back to $$equations$$, but again --
visual clutter (though here a hack to fontify only the delimiters in a
bright shade of grey should not be so difficult).

kind regards, Klaus


Re: [O] Per file ID

2013-06-06 Thread Klaus-Dieter Bauer
Suvayu Ali fatkasuvayu+linux at gmail.com writes:

 
 On Fri, May 24, 2013 at 04:43:53PM +0200, Klaus-Dieter Bauer wrote:
  Hello!
  
  I intend to use org-mode for organizing my research notes; I prefer 
however
  a wiki style with many files rather than one big file.
  
  I found that the ID mechanism is quite robust for linking across files, 
but
  most of the time I'd like to link to a file, not a heading in that file, 
by
  ID. Is that possible in org-mode?
 
 The motivation behind id links is their guaranteed uniqueness.  For
 linking to files, doesn't simply using filenames do that?
 
   [[file:path/to/file.org][My notes]]
 
 Why reinvent the wheel?  ;)
 
 Hope this helps,
 

For me the purpose of using IDs is, amongst others, being able to reorganize 
my files without breaking links. 

Hence direct file links are unique but not robust. I even add UUIDs to every 
plot I generate by now for similiar reasons ;)

That said, with my wiki-style approach having one top-level heading per file 
turned out reasonable anyway. 

kind regards, Klaus




Re: [O] Suppressing interpeter output in code blocks

2013-06-06 Thread Michael Steeves
On 6/6/13 12:04 PM, Eric Schulte wrote:
 Michael Steeves stee...@raingods.net writes:
 Is there any way to suppress all the extra text, and just get the
 Hello, world. string as my output?

 
 #+begin_src python :session testing
 a = 1
 b = 2
 c = a + b
 Hello, world.
 #+end_src
 
 #+RESULTS:
 : Hello, world.

Thanks for the reply. Unfortunately I need to set :results to output,
since I'm working with a doc where I'm working through a python script,
and want to run a section, get some output and write some additional
text, then move on to the next block (and all within a session, since
block 2 depends on things from block 1, and so on.

I put together a more descriptive example, but interestingly enough I'm
now getting some inconsistent output when I evaluate the source blocks.

#+BEGIN_SRC python :session testing :results output
print Hello, World.
print This is a test.
#+END_SRC

#+RESULTS:
: Hello, World.
: This is a test.

#+BEGIN_SRC python :session testing :results output
a = 1; b = 2
print A is +str(a)
print B is +str(b)
#+END_SRC

#+RESULTS:
:
: A is 1
: B is 2

#+BEGIN_SRC python :session testing :results output
c = a + b
print C is +str(c)
print Now we're done.
#+END_SRC

#+RESULTS:
:
: C is 3
: Now we're done.

#+BEGIN_SRC python :session testing :results output
y = 3
z = 4
print Y is +str(y)
print Z is +str(z)
#+END_SRC

#+RESULTS:
:
:  Y is 3
: Z is 4

I don't understand why the last chunk provides different output than the
second -- the only real difference is that I put the assignments on one
line (seperated with a semicolon) in the second, and on individual lines
in the last.


-Mike
-- 
Michael Steeves (stee...@raingods.net)



Re: [O] [PATCH] ob-C: Add list support.

2013-06-06 Thread Eric Schulte
Applied, Thanks for the excellent patch, test code and examples!

Rüdiger Sonderfeld ruedi...@c-plusplus.de writes:

 * lisp/ob-C.el (org-babel-C-var-to-C): Add list support
 (org-babel-C-val-to-C-list-type, org-babel-C-val-to-C-type,
 org-babel-C-format-val): New functions.
 (org-babel-C-ensure-main-wrap, org-babel-execute:C,
 org-babel-execute:C++, rg-babel-execute:cpp, org-babel-C++-compiler,
 org-babel-C-compiler): Improve docstring.
 * testing/examples/ob-C-test.org (string_var): Add required std::
 (Array): Add missing ID.
 (Matrix): Add tests for list support.
 * testing/lisp/test-ob-C.el (ob-C/table): Test succeeds.
 (ob-C/list-var, ob-C/vector-var, ob-C/list-list-var): Add tests for
 list support.

 Signed-off-by: Rüdiger Sonderfeld ruedi...@c-plusplus.de
 ---
  lisp/ob-C.el   | 98 
 +++---
  testing/examples/ob-C-test.org | 28 +++-
  testing/lisp/test-ob-C.el  | 20 -
  3 files changed, 118 insertions(+), 28 deletions(-)

 diff --git a/lisp/ob-C.el b/lisp/ob-C.el
 index b1e8a06..e9eec93 100644
 --- a/lisp/ob-C.el
 +++ b/lisp/ob-C.el
 @@ -44,24 +44,24 @@ (defvar org-babel-default-header-args:C '())
  
  (defvar org-babel-C-compiler gcc
Command used to compile a C source code file into an
 -  executable.)
 +executable.)
  
  (defvar org-babel-C++-compiler g++
Command used to compile a C++ source code file into an
 -  executable.)
 +executable.)
  
  (defvar org-babel-c-variant nil
Internal variable used to hold which type of C (e.g. C or C++)
  is currently being evaluated.)
  
  (defun org-babel-execute:cpp (body params)
 -  Execute BODY according to PARAMS.  This function calls
 -`org-babel-execute:C++'.
 +  Execute BODY according to PARAMS.
 +This function calls `org-babel-execute:C++'.
(org-babel-execute:C++ body params))
  
  (defun org-babel-execute:C++ (body params)
 -  Execute a block of C++ code with org-babel.  This function is
 -called by `org-babel-execute-src-block'.
 +  Execute a block of C++ code with org-babel.
 +This function is called by `org-babel-execute-src-block'.
(let ((org-babel-c-variant 'cpp)) (org-babel-C-execute body params)))
  
  (defun org-babel-expand-body:C++ (body params)
 @@ -70,8 +70,8 @@ (defun org-babel-expand-body:C++ (body params)
(let ((org-babel-c-variant 'cpp)) (org-babel-C-expand body params)))
  
  (defun org-babel-execute:C (body params)
 -  Execute a block of C code with org-babel.  This function is
 -called by `org-babel-execute-src-block'.
 +  Execute a block of C code with org-babel.
 +This function is called by `org-babel-execute-src-block'.
(let ((org-babel-c-variant 'c)) (org-babel-C-execute body params)))
  
  (defun org-babel-expand-body:c (body params)
 @@ -146,10 +146,10 @@ (defun org-babel-C-expand (body params)
 body) \n) \n)))
  
  (defun org-babel-C-ensure-main-wrap (body)
 -  Wrap body in a \main\ function call if none exists.
 +  Wrap BODY in a \main\ function call if none exists.
(if (string-match ^[ \t]*[intvod]+[ \t\n\r]*main[ \t]*(.*) body)
body
 -(format int main() {\n%s\nreturn(0);\n}\n body)))
 +(format int main() {\n%s\nreturn 0;\n}\n body)))
  
  (defun org-babel-prep-session:C (session params)
This function does nothing as C is a compiled language with no
 @@ -163,6 +163,59 @@ (defun org-babel-load-session:C (session body params)
  
  ;; helper functions
  
 +(defun org-babel-C-format-val (type val)
 +  Handle the FORMAT part of TYPE with the data from VAL.
 +  (let ((format-data (cadr type)))
 +(if (stringp format-data)
 + (cons  (format format-data val))
 +  (funcall format-data val
 +
 +(defun org-babel-C-val-to-C-type (val)
 +  Determine the type of VAL.
 +Return a list (TYPE-NAME FORMAT).  TYPE-NAME should be the name of the type.
 +FORMAT can be either a format string or a function which is called with VAL.
 +  (cond
 +   ((integerp val) '(int %d))
 +   ((floatp val) '(double %f))
 +   ((or (listp val) (vectorp val))
 +(lexical-let ((type (org-babel-C-val-to-C-list-type val)))
 +  (list (car type)
 + (lambda (val)
 +   (cons
 +(format [%d]%s
 +(length val)
 +(car (org-babel-C-format-val type (elt val 0
 +(concat { 
 +(mapconcat (lambda (v)
 + (cdr (org-babel-C-format-val type v)))
 +   val
 +   , )
 + }))
 +   (t ;; treat unknown types as string
 +'(char (lambda (val)
 +(let ((s (format %s val))) ;; convert to string for unknown 
 types
 +  (cons (format [%d] (1+ (length s)))
 +(concat \ s \
 +
 +(defun org-babel-C-val-to-C-list-type (val)
 +  Determine the C array type of a VAL.
 +  (let (type)
 +(mapc
 + #'(lambda (i)
 +  (let* ((tmp-type (org-babel-C-val-to-C-type i))
 + 

Re: [O] [PATCH] ob-C: Add list support.

2013-06-06 Thread Rüdiger Sonderfeld
On Thursday 06 June 2013 12:10:11 Eric Schulte wrote:
 Applied, Thanks for the excellent patch, test code and examples!

Thank you for all the great work on org-mode!

Regards
Rüdiger




[O] org-caldav will continue to work with Google Calendar (was: org-caldav will cease to work with Google Calendar)

2013-06-06 Thread David Engster
David Engster writes:
 Google has announced today that they will shut down their CalDAV API in
 September, since hey, everybody's using their own protocol anyway.

Well, Google has suddenly realized that not only is CalDAV an open
standard, but it's actually used outside the Googleverse. Who could've
known? Anyway, they will continue to support it [1], so org-caldav
should work with Google Calendar for the time being (read: until they
change their mind again).

-David

PS: I know that there are problems with org-caldav and the new
exporter. I'll switch to Org 8 soon and will then merge the pending pull
requests.


[1]
http://googledevelopers.blogspot.ca/2013/06/making-googles-caldav-and-carddav-apis.html



Re: [O] Suppressing interpeter output in code blocks

2013-06-06 Thread Eric Schulte
Michael Steeves stee...@raingods.net writes:

 On 6/6/13 12:04 PM, Eric Schulte wrote:
 Michael Steeves stee...@raingods.net writes:
 Is there any way to suppress all the extra text, and just get the
 Hello, world. string as my output?

 
 #+begin_src python :session testing
 a = 1
 b = 2
 c = a + b
 Hello, world.
 #+end_src
 
 #+RESULTS:
 : Hello, world.

 Thanks for the reply. Unfortunately I need to set :results to output,
 since I'm working with a doc where I'm working through a python script,
 and want to run a section, get some output and write some additional
 text, then move on to the next block (and all within a session, since
 block 2 depends on things from block 1, and so on.

 I put together a more descriptive example, but interestingly enough I'm
 now getting some inconsistent output when I evaluate the source blocks.

 #+BEGIN_SRC python :session testing :results output
 print Hello, World.
 print This is a test.
 #+END_SRC

 #+RESULTS:
 : Hello, World.
 : This is a test.

 #+BEGIN_SRC python :session testing :results output
 a = 1; b = 2
 print A is +str(a)
 print B is +str(b)
 #+END_SRC

 #+RESULTS:
 :
 : A is 1
 : B is 2

 #+BEGIN_SRC python :session testing :results output
 c = a + b
 print C is +str(c)
 print Now we're done.
 #+END_SRC

 #+RESULTS:
 :
 : C is 3
 : Now we're done.

 #+BEGIN_SRC python :session testing :results output
 y = 3
 z = 4
 print Y is +str(y)
 print Z is +str(z)
 #+END_SRC

 #+RESULTS:
 :
 :  Y is 3
 : Z is 4

 I don't understand why the last chunk provides different output than the
 second -- the only real difference is that I put the assignments on one
 line (seperated with a semicolon) in the second, and on individual lines
 in the last.


The cleaning of prompts is a best effort based on things like the prompt
regexp variable in the python session comint buffer.  As it interacts
with an external process it can be somewhat noisy, seemingly especially
so with python sessions.

The attached version of your example file uses a simple post processor
to automatically clean up anything that looks like python session cruft
after each code block execution.

#+Property: post py-session-clean(*this*)

#+BEGIN_SRC python :session testing :results output
print Hello, World.
print This is a test.
#+END_SRC

#+RESULTS:
: Hello, World.
: This is a test.

#+BEGIN_SRC python :session testing :results output
a = 1; b = 2;
print A is +str(a)
print B is +str(b)
#+END_SRC

#+RESULTS:
: A is 1
: B is 2

#+BEGIN_SRC python :session testing :results output
c = a + b
print C is +str(c)
print Now we're done.
#+END_SRC

#+RESULTS:
: C is 3
: Now we're done.

#+BEGIN_SRC python :session testing :results output
y = 3
z = 4
print Y is +str(y)
print Z is +str(z)
#+END_SRC

#+RESULTS:
: Y is 3
: Z is 4

* COMMENT Helper Function

#+name: py-session-clean
#+begin_src sh :var data= :results output :post '()
  echo $data|sed '/^$/d;s/^\+ //g'
#+end_src

Hope this helps,



 -Mike

-- 
Eric Schulte
http://cs.unm.edu/~eschulte


Re: [O] BUG (?): org capture insist *.org file changed in disk, wipes file each time

2013-06-06 Thread Marc Ihm

Hi Z.

Sorry, but cannot think of a proper cause of your troubles other than dropbox.

I do not use dropbox, but only rsync for synchronisation. I get the same 
message that you get now and then, but each time I get it,
it is because I did synchronisation of my org-files from external sources, 
while emacs is still open.

So can only suspect, that your trouble comes from bad interaction with dropbox.

But as you said, you have already tried without, so it can only be very hidden 
and obscure.

Does this happen without a network connection ?


Best regards, Marc


On 06/05/2013 05:18 PM, Xebar Saram wrote:

Hi all

Im having serious issues with org-capture, ive tried everything i can think of 
including advice on #emacs but can find a solution/whats causing this.

So the issue is this. i have org mode configured and working well (see below 
config). the thing is that after the 2nd or 3rd capture (to create a todo) 
emacs gives the following error:

TODO.org changed on disk; really edit the buffer? (y, n, r or C-h) y
File on disk now will become a backup file if you save these changes.

It happens each time i relaunch emacs/org but never on the first time i capture 
(that always works). it always happens from 2/3rd time i try to capture.
I have tired many things with no succes. i have tried it both with org 8.03 and 
other org that comes with default emacs 24 (from the 7.x series) with no 
success.
i have checked carefully that no other app is accessing that file while 
emacs/org is editing it
i have moved the todo file and relevant org capture config to other folders 
(non dropbox/git/etc) and still the same issue occurs

another big issue is that sometime when i press Yes to the above error it wipes 
the whole todo file and puts only the latest capture

any help would be greatly appreciated

for reference here is my complete emacs conf file (in org mode format): 
https://paste.xinu.at/p27KN/

and the relevant capture part: https://paste.xinu.at/Autp/

Best

Z.





[O] [PATCH] lisp/ox-html.el: Minimal encoding for code and verbatim text

2013-06-06 Thread Aurélien Aptel
I've reported the following bug earlier:
http://article.gmane.org/gmane.emacs.orgmode/72967

Here's a fix, attached.


0001-lisp-ox-html.el-Minimal-encoding-for-code-and-verbat.patch
Description: Binary data


Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Carsten Dominik

On 6.6.2013, at 19:39, Josiah Schwab jsch...@gmail.com wrote:

 On 6 jun. 2013, at 10:20, Michael Bach phaebz at gmail.com wrote:
 The LaTeX exporter does not honor the setting of 
 org-list-allow-alphabetical.  
 
 A week or so ago I asked a similar question about the HTML export and lists.
 http://lists.gnu.org/archive/html/emacs-orgmode/2013-05/msg01324.html
 So I just wanted to toss in my 2¢.
 
 On Jun 6, 2013, at 2:17 AM, Carsten Dominik wrote:
 Conventions about the type of bullet to be used in a document belong to the 
 typesetting side, and I rather establish a global setting for a document 
 than follow my momentary decisions when I write the Org-mode version of it.  
 On a similar vein, we do have lists starting with - and * and +, but we 
 still let LaTeX and HTML choose what to use as a bullet.  To me this feels 
 like the right behavior.
 
 I think this argument makes sense;  and to be honest, that's probably how I 
 want the exporter to behave most of the time.
 
 However, there is particular use case where I find this frustrating, which is 
 writing problem sets.  There I like to reference other parts of the problems 
 by name.  For example, 
 
 a) Do something.
 b) Use your answer in part a) to do something else.
 
 Then, if I want to export it to multiple formats (say, html and pdf), there 
 is no general way to tell orgmode: my alphabetical bullet choice was 
 meaningful, please try to preserve it.  One ends up inserting little 
 workarounds for each export format.  Which is not a big deal, but when 
 everything else works so seamlessly it's these little things that stand out :)


This is a good point - but this calls for something else:  A mechanism to name 
a particular list item and refer to it by name.  In LaTeX you can put a \label 
into an ordered list item and refer to it with \ref.  I am not sure if the new 
exporter allows this for list items, but I do not thing so.  Nicolas, has this 
ever been considered?  I don't remember.

This would be useful.

Or, make sure you use a LaTeX stype or HTML style file that uses a specific 
labeling system.

- Carsten


Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-06-06 Thread Nathaniel Cunningham
Suvayu Ali fatkasuvayu+linux at gmail.com writes:

 
 Org mode
 translates _underlined text_ to \underline{underlined text}, however if
 you read the TeX.sx question referenced below you will see that it
 doesn't support line breaks and the TeX community recommends \uline{..}
 from the ulem package.
 
   http://TeX.stackexchange.com/a/13382/4416

The \ul{..} command from the soul package also supports underlining across
line breaks.
*And soul is included by default in org's list of loaded latex packages* -- see
org-latex-default-packages-alist.

Therefore it would be painless for org users if \underline in
org-latex-text-markup-alist were replaced with \ul -- and it would provide
more complete support of underlining!  

Thanks,
Nathaniel




[O] Formatting a calculated cell entry as currency

2013-06-06 Thread J. David Boyd

I've got a simple cell calculation, =@2 * 40

If @2 contained 10, is there anyway to force this to show as $400.00?  I've
combed through the info file, and if it is there I'm blind.

Dave




Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Rasmus
Carsten Dominik carsten.domi...@gmail.com writes:

 a) Do something.
 b) Use your answer in part a) to do something else.
 
 Then, if I want to export it to multiple formats (say, html and
 pdf), there is no general way to tell orgmode: my alphabetical
 bullet choice was meaningful, please try to preserve it.  One ends
 up inserting little workarounds for each export format.  Which is
 not a big deal, but when everything else works so seamlessly it's
 these little things that stand out :)

 This is a good point - but this calls for something else: A mechanism
 to name a particular list item and refer to it by name.  In LaTeX you
 can put a \label into an ordered list item and refer to it with \ref.
 I am not sure if the new exporter allows this for list items, but I do
 not thing so.  Nicolas, has this ever been considered?  I don't
 remember.

 This would be useful.

 Or, make sure you use a LaTeX stype or HTML style file that uses a specific 
 labeling system.


Why doesn't this cut it:

#+BEGIN_SRC org
 1. 1 Do something.
 2. Use your answer in part [[1]] to do something else.
#+END_SRC

–Rasmus

-- 
Hooray!




Re: [O] [PATCH (v3)][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.

2013-06-06 Thread Rasmus

Hi, 

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

 Thanks for your patch. Here are a few comments:

is the attached patch better?

It replaced AUTO with LANG when LANG is recognized and preserve
position and LANG is the argument to LANGUAGE.  I don't know if this
patch uses the most efficient way of replacing AUTO with LANG (see the
dotimes).

–Rasmus

-- 
C is for CookieFrom 8c97851cb499280bee035d835783bbf17943334e Mon Sep 17 00:00:00 2001
From: rasmus.pank rasmus.p...@gmail.com
Date: Sat, 1 Jun 2013 00:20:18 +0200
Subject: [PATCH] Allow AUTO argument to org-latex-guess-babel-language.

* ox-latex.el (org-latex-guess-babel-language): replace AUTO with
  language if AUTO is the option of the LaTeX package Babel.

* ox-latex.el (org-latex-guess-babel-language): retain case in final
replace-match of the function.
---
 lisp/ox-latex.el | 25 ++---
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index ff0ca1d..0628514 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -910,6 +910,9 @@ Insertion of guessed language only happens when Babel package has
 explicitly been loaded.  Then it is added to the rest of
 package's options.
 
+The argument to Babel may be \AUTO\ which is then replaced with
+the language of the document or `org-export-default-language'.
+
 Return the new header.
   (let ((language-code (plist-get info :language)))
 ;; If no language is set or Babel package is not loaded, return
@@ -918,16 +921,24 @@ Return the new header.
 	(not (string-match usepackage\\[\\(.*\\)\\]{babel} header)))
 	header
   (let ((options (save-match-data
-		   (org-split-string (match-string 1 header) ,)))
+		   (org-split-string (match-string 1 header) ,[ \t]*)))
 	(language (cdr (assoc language-code
   org-latex-babel-language-alist
-	;; If LANGUAGE is already loaded, return header.  Otherwise,
-	;; append LANGUAGE to other options.
-	(if (member language options) header
-	  (replace-match (mapconcat 'identity
-(append options (list language))
+	;; If LANGUAGE is already loaded, return header without AUTO.
+	;; Otherwise, replace AUTO with language or append language if
+	;; no AUTO is not present.
+	(replace-match (mapconcat 'identity
+  (if language
+  (cond ((member language options)
+	 (delete AUTO) options)
+	((member AUTO options)
+	 (dotimes (n (length options) options)
+	   (if (equal AUTO (nth n options))
+		   (setf (nth n options) language
+	(t (append options (list language
+(delete AUTO options))
 ,)
-			 nil nil header 1))
+  t nil header 1)
 
 (defun org-latex--find-verb-separator (s)
   Return a character not used in string S.
-- 
1.8.3



Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Josiah Schwab
 Why doesn't this cut it:
 
 #+BEGIN_SRC org
 1. 1 Do something.
 2. Use your answer in part [[1]] to do something else.
 #+END_SRC

That will work ok in LaTeX I think.
But that will export to HTML like

ol class=org-ol
lia id=1 name=1/a Do something.
/li
liUse your answer in part a href=#11/a to do something else.
/li
/ol

and the link name will remain 1, even if one adds type=a to the ol tag to 
adjust the bullet appearance.

Josiah


Re: [O] Formatting a calculated cell entry as currency

2013-06-06 Thread Nick Dokos
da...@adboyd.com (J. David Boyd) writes:

 I've got a simple cell calculation, =@2 * 40

 If @2 contained 10, is there anyway to force this to show as $400.00?  I've
 combed through the info file, and if it is there I'm blind.


This seems to work (apart from the alignment):

--8---cut here---start-8---
| a | b  |
|---+|
| 1 | $8.25  |
| 2 | $16.50 |
| 3 | $24.75 |
#+TBLFM: $2 = 8.25*$1;$%.2f
--8---cut here---end---8---

-- 
Nick




Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Rasmus
Josiah Schwab jsch...@gmail.com writes:

 Why doesn't this cut it:
 
 #+BEGIN_SRC org
 1. 1 Do something.
 2. Use your answer in part [[1]] to do something else.
 #+END_SRC

 That will work ok in LaTeX I think.
 But that will export to HTML like

 ol class=org-ol
 lia id=1 name=1/a Do something.
 /li
 liUse your answer in part a href=#11/a to do something else.
 /li
 /ol

 and the link name will remain 1, even if one adds type=a to the
 ol tag to adjust the bullet appearance.

If you your type you can use a more advance link [[1][a)].  But that's
not very nice.

Perhaps, css counters is the way to go:

 https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Counters

(I did a quick search and I'm not sure css is powerful enough).

In any case, I think it's a fair feature request, but it's a html
bug/deficit.  If we know how to do it in hand-written html it can
relatively easily be added to ox-html or incorporated locally via a
filter.

–Rasmus

-- 
m-mm-mmm- bacon!




Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Rasmus
Rasmus ras...@gmx.us writes:

 Josiah Schwab jsch...@gmail.com writes:

 Why doesn't this cut it:
 
 #+BEGIN_SRC org
 1. 1 Do something.
 2. Use your answer in part [[1]] to do something else.
 #+END_SRC

 That will work ok in LaTeX I think.
 But that will export to HTML like

 ol class=org-ol
 lia id=1 name=1/a Do something.
 /li
 liUse your answer in part a href=#11/a to do something else.
 /li
 /ol

 and the link name will remain 1, even if one adds type=a to the
 ol tag to adjust the bullet appearance.

 If you your type you can use a more advance link [[1][a)].  But that's
 not very nice.

 Perhaps, css counters is the way to go:

  https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Counters

 (I did a quick search and I'm not sure css is powerful enough).

It doesn't seem to be easy or pretty to get \ref-\label-like relations
in html.  Here's the best I could find:

http://stackoverflow.com/questions/2651739/how-to-access-css-generated-content-with-javascript

–Rasmus

-- 
When in doubt, do it!




Re: [O] mydisk.com down?

2013-06-06 Thread Guido Van Hoecke
Hi,

On 4 June 2013 01:58, Rasmus ras...@gmx.us wrote:
 Guido Van Hoecke guivho at gmail.com writes:

  Could it be that mydisk.com is down?

 Check isup.me.

Nice, didn't know this link.


 Or about other free WebDAV servers?
 (My Dropbox account is not an option)

It was just a temporary outage.

Thanks for the reply

Guido



Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Nick Dokos
Josiah Schwab jsch...@gmail.com writes:

 On 6 jun. 2013, at 10:20, Michael Bach phaebz at gmail.com wrote:
 The LaTeX exporter does not honor the setting of 
 org-list-allow-alphabetical.  

 A week or so ago I asked a similar question about the HTML export and lists.
 http://lists.gnu.org/archive/html/emacs-orgmode/2013-05/msg01324.html
 So I just wanted to toss in my 2¢.

 On Jun 6, 2013, at 2:17 AM, Carsten Dominik wrote:
 Conventions about the type of bullet to be used in a document belong
 to the typesetting side, and I rather establish a global setting for
 a document than follow my momentary decisions when I write the
 Org-mode version of it.  On a similar vein, we do have lists
 starting with - and * and +, but we still let LaTeX and HTML choose
 what to use as a bullet.  To me this feels like the right behavior.

 I think this argument makes sense; and to be honest, that's probably
 how I want the exporter to behave most of the time.

 However, there is particular use case where I find this frustrating,
 which is writing problem sets.  There I like to reference other parts
 of the problems by name.  For example,

 a) Do something.
 b) Use your answer in part a) to do something else.

 Then, if I want to export it to multiple formats (say, html and pdf),
 there is no general way to tell orgmode: my alphabetical bullet
 choice was meaningful, please try to preserve it.  One ends up
 inserting little workarounds for each export format.  Which is not a
 big deal, but when everything else works so seamlessly it's these
 little things that stand out :)


I don't have anything to add to what others have said on the
cross-reference question. But I did some investigation into
alpha lists and I wanted to expand a bit on that.

I looked at your earlier question and the latex question a bit and I
have a patch that implements something like what you want. However, I'm
not advocating that org actually implement this. In fact, there are good
reasons *not* to implement it (at least not in this form).

In the patch, there is a change in the parser so that it recognizes an
ordered-alpha list (in addition to the ordered, etc. lists it was
already recognizing). Then there are minor changes to ox-html.el:
basically ordered and ordered-alpha trigger the same response from the
exporter, except in one case: the opening of an ordered-alpha list
includes the ``type=a'' thing. NB: the patch does not address any
of the other exporters.

However, the type=a thingie in ol is a bad idea: it is deprecated in
the HTML spec, so it would be foolish to go chasing after it in
org. Here's what the spec says:

#+BEGIN_QUOTE

For the OL element, possible values for the type attribute are
summarized in the table below (they are case-sensitive):

TypeNumbering style
1   arabic numbers  1, 2, 3, ...
a   lower alpha a, b, c, ...
A   upper alpha A, B, C, ...
i   lower roman i, ii, iii, ...
I   upper roman I, II, III, ...

Note that the type attribute is deprecated and list styles should be
handled through style sheets.

For example, using CSS, one may specify that the style of numbers for
list elements in a numbered list should be lowercase roman numerals. In
the excerpt below, every OL element belonging to the class withroman
will have roman numerals in front of its list items.

STYLE type=text/css
OL.withroman { list-style-type: lower-roman }
/STYLE
BODY
OL class=withroman
LI Step one ...  
LI Step two ...
/OL
/BODY

#+END_QUOTE

See http://www.w3.org/TR/html4/struct/lists.html#type-values.

Even if it were not deprecated, a good implementation would require org
to be able to generate all the values, which would probably require 
YAUO (yet another user option).

What org *could* do is to generate some discriminant (the withroman thing
above) so that the proper CSS could be applied.  Right now, there is no
such capability I believe. It could be done with YAUO, but I, for one,
think org has too many of those: we certainly don't need more unless it
is *really* necessary.

Here's the patch if you still want it: the only use for it
as far as I'm concerned is educational:

diff --git a/lisp/org-list.el b/lisp/org-list.el
index 86afe11..7a606f0 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -1022,7 +1022,8 @@ Possible types are `descriptive', `ordered' and `unordered'.  The
 type is determined by the first item of the list.
   (let ((first (org-list-get-list-begin item struct prevs)))
 (cond
- ((string-match [[:alnum:]] (org-list-get-bullet first struct)) 'ordered)
+ ((string-match [[:alpha:]] (org-list-get-bullet first struct)) 'ordered-alpha)
+ ((string-match [[:digit:]] (org-list-get-bullet first struct)) 'ordered)
  ((org-list-get-tag first struct) 'descriptive)
  (t 'unordered
 
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index facd84c..b30c313 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2387,7 +2387,7 @@ contextual information.
 	(br 

Re: [O] org-list-allow-alphabetical LaTeX export

2013-06-06 Thread Josiah Schwab
 However, the type=a thingie in ol is a bad idea: it is deprecated in
 the HTML spec, so it would be foolish to go chasing after it in org.

I'll take a closer look the rest of your message to tomorrow, but I wanted
to mention that while type was deprecated in HTML4 that is no longer the
case in HTML5.

http://www.w3.org/TR/html-markup/ol.html#ol.attrs.type

Best,
Josiah