[O] Fwd: org-publish bug

2013-06-05 Thread Marvin Doyley
Hi Carsten,

An excellent example/tutorial can be found at 
http://lists.gnu.org/archive/html/emacs-orgmode/2010-04/msg00933.html

it would nice if this example could be included in worg

Best Wishes,

M

Begin forwarded message:

 From: Carsten Dominik carsten.domi...@gmail.com
 Subject: Re: [O] org-publish bug
 Date: June 4, 2013 2:03:26 AM EDT
 To: Marvin Doyley m.doy...@rochester.edu
 
 
 On 1.6.2013, at 13:06, Marvin Doyley m.doy...@rochester.edu wrote:
 
 Hi Carsten,
 
 I  do indeed think there need to be better documentation. I will provide a 
 simple example that could be included in the manual or on worg.
 
 That would be nice, thank you.
 
 - Carsten
 
 
 Cheers,
 M
 
 
 
 On Jun 1, 2013, at 2:45 AM, Carsten Dominik carsten.domi...@gmail.com 
 wrote:
 
 
 On 31.5.2013, at 02:04, Marvin Doyley m.doy...@rochester.edu wrote:
 
 Hi there,
 
 I solved the problem. It turns out that I needed to include
 
 #+index:
 
 Hi Marvin,
 
 does this need to be documented somewhere?  If so, can you propose a patch?
 
 Cheers
 
 - Carsten
 
 
 cheers,
 M
 
 



Re: [O] export to LaTeX with TOC but without numbers

2013-06-05 Thread Andreas Leha
Nick Dokos ndo...@gmail.com writes:

 Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Instead of adding toc entries, you can use latex to delete section
 numbers:

 #+LATEX_HEADER: \setcounter{secnumdepth}{0}
 ...

 The problem might be that the sections are not numbered in the TOC
 either. But if you don't care about that, this is certainly simpler
 than adding toc entries by hand.

 Thanks for that!  That is really cool and having the entries in the TOC
 un-numbered is exactly what I want!

 As a follow-up, it would be nice if I could mix
 that now again with num:1.  That way I could add a TOC with depth 1
 (only sections) and have them un-numbered.


 There is a tocdepth counter that you can set similarly. Will that
 do what you want?

 #+LATEX_HEADER: \setcounter{tocdepth}{1}
 #+LATEX_HEADER: \setcounter{secnumdepth}{0}



That does what I want.  Thanks a lot!

Best,
Andreas

PS: I will come back when I need a cross-backend-solution, that work for
odt as well




Re: [O] export to LaTeX with TOC but without numbers

2013-06-05 Thread Andreas Leha
Eric Abrahamsen e...@ericabrahamsen.net writes:

 Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Hi Eric,

 Eric S Fraga e.fr...@ucl.ac.uk writes:

 Andreas Leha andreas.l...@med.uni-goettingen.de writes:
 Eric S Fraga e.fr...@ucl.ac.uk writes:

 [...]

 There are workarounds but they involve using latex directly (to add
 entries to a TOC basically).

 I am aware of that.  Sorry for being unclear.  I would like to automate
 exactly that.

 I use several LaTeX export classes and I would like that possibility
 (TOC with unnumbered sections/subsections/...) in each of these classes.
 Thus, I am searching for a (more) general approach, that I could 'switch 
 on'
 and have it insert the latex statement on its own.

 Best,
 Andreas

 Ah, I see.  Well, you could do something along these lines (completely
 untested and likely to be wrong...):

 #+latex_header: 
 \newcommand{\mysection}[1]{\section*{#1}\addcontentsline{toc}{section}{#1}}

 and similar for subsection, subsubsection, ...

 Then customise org-latex-classes and replace, for instance,
 \\section*{%s} by \\mysection{%s}.

 However, you'll probably need to put a bit more TeX in the
 addcontentsline bit if you want some proper formatting (have a look at
 latex.ltx [around line 5659 in my version of this file] to see how
 content lines are handled by default...).

 Not trivial but also not impossible!

 I would suggest you look at latex-specific fora for answers to the more
 general question of generating tables of contents for unnumbered
 headings as I can imagine that there are simpler solutions.


 Thanks for these hints!  When I follow that route I'll have to do
 more work I guess:
 1. either I have to provide two versions of my org-latex-classes (one
for numbered and one for un-numbered cases)
 2. or I have to provide a filter or sth similar to replace sections
with mysections, correct?

 I've gone the filter route before, with pretty good success: checking
 for the type of heading and adding toc statements. In my case I *wanted*
 something more complicated, though, using tocloft and \addtocontents. If
 you don't need all that then Nick's suggestion seems perfect.


The more I think about it, the more I get the impression, that it would
have been faster (even given my elisp 'skills') to write such a
filter than to raise that here.  And I might even need a similar and
more complicated TOC handling soon, so it would have been a good start.

Anyway, Nick's suggestion works for now.  As I said in the other post,
it works at least as long as I do not want odt as well...

Best,
Andreas




Re: [O] export to LaTeX with TOC but without numbers

2013-06-05 Thread Eric S Fraga
Andreas Leha andreas.l...@med.uni-goettingen.de writes:


[...]

 That's why I would prefer to follow Nick's suggestion.

Yes, Nick's suggestion is straightforward and should work very well for
what you want.
-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_8.0.3-193-g334581




Re: [O] bug in new exporter

2013-06-05 Thread Nicolas Goaziou
Hello,

Rasmus ras...@gmx.us writes:

 Nick Dokos ndo...@gmail.com writes:

 if I rearrange the line to

  #+ATTR_LATEX: :width  :placement [htb!] :options scale=1.5  

 I get the Wrong argument type error in the current version as
 well. 

 I can reproduce this here.

 I guess :width has to be after the :options ?!? I don't quite
 understand the rules I guess.

 Neither do I in this case.  I'm guessing it has do with the escaping
 of  'cause it also fails if you :placement behind width.  

 With 

#+ATTR_LATEX:  :options scale=1.5:width  :placement [htb!]
 it fails here
(attr (org-export-read-attribute :attr_latex parent))
  
 which evalues to something like

 Result: (:options scale=1.5 :placement [htb!] :width )

 when it doesn't crash.

This bug should be fixed in maint. Thanks to both of you for identifying
it.


Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Respect org-export-babel-evaluate on export

2013-06-05 Thread Nicolas Goaziou
Hello,

Christopher Allan Webber cweb...@dustycloud.org writes:

 Here's such a file.  The exact contents of it don't really matter.

 What's significant is you should see a lol appear in your *Messages*
 buffer... which shouldn't happen when exporting to anything while
   (setq org-export-babel-evaluate nil)

I cannot reproduce it.


Regards,

-- 
Nicolas Goaziou



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

2013-06-05 Thread Nicolas Goaziou
Hello,

Rasmus ras...@gmx.us writes:

Thanks for your patch. Here are a few comments:

 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.

(let ((language-code (plist-get info :language)))
  ;; If no language is set or Babel package is not loaded, return
 @@ -917,17 +920,26 @@ Return the new header.
  (if (or (not (stringp language-code))
   (not (string-match usepackage\\[\\(.*\\)\\]{babel} header)))
   header
 -  (let ((options (save-match-data
 -(org-split-string (match-string 1 header) ,)))
 - (language (cdr (assoc language-code
 -   org-latex-babel-language-alist
 - ;; If LANGUAGE is already loaded, return header.  Otherwise,
 +  (let ((options (save-match-data  
 +;; As with `org-latex-guess-inputenc' it only works with
 +;; uppercase AUTO

You need to punctuate your sentence.

 +(remove AUTO

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

 +(org-split-string 
 + ;; in case of [lang_one, lang_two]
 + (replace-regexp-in-string [ \t\n]* 
 +   (match-string 1 
 header)) ,

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]*)

 + (language (or
 +(cdr (assoc language-code
 +org-latex-babel-language-alist))
 +language-code)))
 + ;; If LANGUAGE is already loaded, return header without AUTO.  
 Otherwise,
   ;; append LANGUAGE to other options.
 - (if (member language options) header
 -   (replace-match (mapconcat 'identity
 - (append options (list language))
 - ,)
 -  nil nil header 1))
 + (replace-match (mapconcat 'identity
 +   (if (member language options) 
 +   options
 + (append options (list language)))
 +   ,)
 +t nil header 1)

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.


Regards,

-- 
Nicolas Goaziou



[O] ob: Make src block location available to execution backend

2013-06-05 Thread Vitalie Spinu

Hi, 

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

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

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

Vitalie

	Modified   lisp/ob-core.el
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 8d26c4e..653975a 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -251,7 +251,7 @@ 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))
@@ -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)))
@@ -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 ()


[O] Automatically adding local variables to tangled file

2013-06-05 Thread Rainer M Krug
Hi 

I am trying to improve my workflow of literate programming of R in
org. My org file is tangled into many R files and I am using ESS to
debug.

If an error occurs, I can jump via ESS to the .R file, and in a second
step via calling org-babel-tangle-jump-to-org into the org file where
the buggy line sits.


Now this is error prone, as one (or is it only me?) is easily tempted to
edit the R file which is reverted after the next tangle.

So I was thinking: what about calling org-babel-tangle-jump-to-org
directly from ESS. Vitalie Spinu looked into this option, and came up with the
following suggestion:

If the tangled .R file contains a local variable, one could easily
identify that it is a tangled file and call org-babel-tangle-jump-to-org
and would be at the line causing the error.

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

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

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


pgp94EmsPRbEV.pgp
Description: PGP signature


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

2013-06-05 Thread Darlan Cavalcante Moreira

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?

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.

--
Darlan

At Wed, 05 Jun 2013 16:04:59 +0200,
Rainer M Krug wrote:
 
 Hi 
 
 I am trying to improve my workflow of literate programming of R in
 org. My org file is tangled into many R files and I am using ESS to
 debug.
 
 If an error occurs, I can jump via ESS to the .R file, and in a second
 step via calling org-babel-tangle-jump-to-org into the org file where
 the buggy line sits.
 
 
 Now this is error prone, as one (or is it only me?) is easily tempted to
 edit the R file which is reverted after the next tangle.
 
 So I was thinking: what about calling org-babel-tangle-jump-to-org
 directly from ESS. Vitalie Spinu looked into this option, and came up with the
 following suggestion:
 
 If the tangled .R file contains a local variable, one could easily
 identify that it is a tangled file and call org-babel-tangle-jump-to-org
 and would be at the line causing the error.
 
 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)
 `
 
 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).
 
 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



[O] [PATCH] org-entities: Add support for hbar.

2013-06-05 Thread Rüdiger Sonderfeld
* lisp/org-entities.el (org-entities): Add support for hbar.

Signed-off-by: Rüdiger Sonderfeld ruedi...@c-plusplus.de
---
 lisp/org-entities.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/org-entities.el b/lisp/org-entities.el
index 019b6c8..a1519b0 100644
--- a/lisp/org-entities.el
+++ b/lisp/org-entities.el
@@ -366,6 +366,7 @@ (defconst org-entities
 (rfloor \\rfloor t rfloor; [right floor] [right floor] ⌋)
 (lang \\langle t lang;   ⟨)
 (rang \\rangle t rang;   ⟩)
+(hbar \\hbar t #8463; hbar hbar ℏ)
 
 ** Arrows
 (larr \\leftarrow t larr; - - ←)
-- 
1.8.3



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

2013-06-05 Thread Xebar Saram
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.


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

2013-06-05 Thread Vitalie Spinu


  Darlan Cavalcante Moreira darc...@gmail.com
  on Wed, 05 Jun 2013 11:32:22 -0300 wrote:

  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?

In principle yes, but it would be nice to avoid searching the whole
buffer for org comments on every step of the debugger. Especially given
that OP's workflow is very specific and most users won't ever need it.

Instead of local variable it might be just a simple comment at bof and a
function org-babel-tangled-file-p to quickly recognize the file.

Vitlaie




Re: [O] [PATCH] org-entities: Add support for hbar.

2013-06-05 Thread Carsten Dominik
Applied, thanks.

- Carsten

On 5.6.2013, at 17:12, Rüdiger Sonderfeld ruedi...@c-plusplus.de wrote:

 * lisp/org-entities.el (org-entities): Add support for hbar.
 
 Signed-off-by: Rüdiger Sonderfeld ruedi...@c-plusplus.de
 ---
 lisp/org-entities.el | 1 +
 1 file changed, 1 insertion(+)
 
 diff --git a/lisp/org-entities.el b/lisp/org-entities.el
 index 019b6c8..a1519b0 100644
 --- a/lisp/org-entities.el
 +++ b/lisp/org-entities.el
 @@ -366,6 +366,7 @@ (defconst org-entities
 (rfloor \\rfloor t rfloor; [right floor] [right floor] ⌋)
 (lang \\langle t lang;   ⟨)
 (rang \\rangle t rang;   ⟩)
 +(hbar \\hbar t #8463; hbar hbar ℏ)
 
 ** Arrows
 (larr \\leftarrow t larr; - - ←)
 -- 
 1.8.3
 




[O] how to disable timestamp html export

2013-06-05 Thread OSiUX
When export using org-publish-project,
Org add a comment with timestamp in HTML:

 # git diff

 html xmlns=http://www.w3.org/1999/xhtml; lang=es xml:lang=es
  head
  titleviewing two years of orgmode with gnuplot/title
 -!-- 2013-06-05 mié 12:10 --
 +!-- 2013-06-05 mié 12:38 --
  meta  http-equiv=Content-Type content=text/html;charset=utf-8 /
  meta  name=generator content=Org-mode /

In my .emacs, I have:

(setq org-publish-project-alist
  (quote ((osiux-blog-org
...others...options...
:with-timestamps nil

How I can disable this feature?

Thanks!

-- 

::

  Osiris Alejandro Gomez (OSiUX) os...@osiux.com.ar
  DC44 95D2 0D5D D544 FC1A F00F B308 A671 9237 D36C
  http://www.osiux.com.ar http://www.altermundi.net


signature.asc
Description: Digital signature


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

2013-06-05 Thread Julian M. Burgos
Hi Rainer,

Then sorry... this goes beyond my meager knowledge of emacs and org
mode. :)

Rainer M Krug writes:

 #secure method=pgpmime mode=sign

 Julian M. Burgos jul...@hafro.is writes:

 Hi Rainier,

 Hi Julian,

 If I understood correctly, you need to add the following to your
 .emacs file:

 (setq org-src-window-setup 'current-window)

 With this when you use C-' to switch between editing your org mode file
 and being in ESS mode you will say in the same windows.

 This is definitely true, but this is my setting, but this only effects
 C-' to start an indirect buffer - the org file is opened in a normal
 buffer, and not in an indirect buffer.

 Cheers,

 Rainer


 All the best,

 Julian


-- 
Julian Mariano Burgos, PhD
Hafrannsóknastofnun/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: jul...@hafro.is



Re: [O] bug in new exporter

2013-06-05 Thread Nick Dokos
Nicolas Goaziou n.goaz...@gmail.com writes:

 With 

#+ATTR_LATEX:  :options scale=1.5:width  :placement [htb!]
 it fails here
(attr (org-export-read-attribute :attr_latex parent))
  
 which evalues to something like

 Result: (:options scale=1.5 :placement [htb!] :width )

 when it doesn't crash.

 This bug should be fixed in maint. Thanks to both of you for identifying
 it.


And also in master, correct? I can never remember who goes first.

In any case, I updated from master and checked: it works with the :width
option anywhere in the sequence of options, so it does seem to be fixed.
In all cases, there is no width specification, just the scale, on the
\includegraphics - and no error.

Just a heads-up: As part of testing this, I stumbled on an unrelated
current-working-directory problem, where on exporting to pdf, the
pdflatex of the produced tex file fails to find an image file specified
with a relative pathname (it works fine with an absolute path name). The
tex file looks OK and I can process it from the command line. I'll try
to pin this down more precisely, but do I understand correctly that the
processing of the tex file should take place with the current working
directory set to the directory of the org file?

Thanks!
-- 
Nick




Re: [O] how to disable timestamp html export

2013-06-05 Thread Nick Dokos
OSiUX xu...@osiux.com.ar writes:

 When export using org-publish-project,
 Org add a comment with timestamp in HTML:

  # git diff

  html xmlns=http://www.w3.org/1999/xhtml; lang=es xml:lang=es
   head
   titleviewing two years of orgmode with gnuplot/title
  -!-- 2013-06-05 mié 12:10 --
  +!-- 2013-06-05 mié 12:38 --
   meta  http-equiv=Content-Type content=text/html;charset=utf-8 /
   meta  name=generator content=Org-mode /

 In my .emacs, I have:

 (setq org-publish-project-alist
   (quote ((osiux-blog-org
 ...others...options...
 :with-timestamps nil

 How I can disable this feature?


To do it globally, customize org-export-time-stamp-file and set it to
nil.

Per file, you can use an option:

--8---cut here---start-8---
#+OPTIONS: timestamp:nil
--8---cut here---end---8---

or through a local variable by adding this at the *end* of the file:

--8---cut here---start-8---
# Local Variables:
# org-export-time-stamp-file: nil
# End:
--8---cut here---end---8---

You will need to close and reopen the file in this case, for it
to take effect.

OTOH, it's just a comment: org is trying to be helpful and tell you
when the html file was produced. Why do you want to get rid of it?
At some point, it might save you hours of debugging (ok, rhetorical
exaggeration perhaps, but still...)
-- 
Nick




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

2013-06-05 Thread Thorsten Jolitz
Rainer M Krug rai...@krugs.de writes:

Hi,

 I am trying to improve my workflow of literate programming of R in
 org. My org file is tangled into many R files and I am using ESS to
 debug.

[...]

 Now this is error prone, as one (or is it only me?) is easily tempted to
 edit the R file which is reverted after the next tangle.

are you aware that literate programming can be done without any tangling
at all now? I had similar issues like you when using literate
programming for organizing my .emacs, and finally figured out its
actually a conceptual problem:

,
| --- Text --- Text with Code --- | --- Code with (Comment) Text --- Code ---
`

If you write a complex text/book with source code examples, literate
programming is just perfect (see e.g. Bernt Hansens Org-mode tutorial).
But if you write code with some comment text, it becomes burdensome.
Although working with interpreted dynamic languages, your workflow with
all that tangling starts to feel similar like working with compiled
languages (with the frequent tangling step replacing the frequent
compilation step).

So, looking at the line above, right from the '|' you really might want
to work in a source code buffer to enjoy all the advantages of Lisps (or
R's) dynamic. Its about programming with some text then, not vice versa.

You can do this with outshine.el and outorg.el (and optionally
navi-mode.el and poporg.el), see the tutorial on Worg
(http://orgmode.org/worg/org-tutorials/org-outside-org.html).

Short example:

Structure your R file like an Org-mode file:

,-
| ## * my-sources.R --- my R Source file
| ##   :PROPERTIES:
| ##   :copyright: my_name
| ##   :copyright-years: 2013
| ##   :version:  0.9
| ##   :created:  21-01-2013
| ##   :licence:  GPL 2 or later (free software)
| ##   :licence-url: http://www.gnu.org/licenses/
| ##   :author:   my_name
| ##   :author_email: my_email AT gamil DOT com
| ##   :inspiration: foo bar
| ##   :keywords: foo bar
| ##   :END:
|
| ## ** Commentary
|
| ## Geometry Object Model from OGC OpenGIS Simple Features Specification for
| ## SQL Revision. 1.1 [...]
|
| ## ** Changes
|
| ## | author  | version | date|
| ## |-+-+-|
| ## | my_name | 0.9 | 2013-06-05 Mi |
|
| ## * code
| ## ** My first R Function
|
| ## simple example function from the manual
| twosam - function(y1, y2) {
|  n1  - length(y1); n2  - length(y2)
|  yb1 - mean(y1);   yb2 - mean(y2)
|  s1  - var(y1);s2  - var(y2)
|  s - ((n1-1)*s1 + (n2-1)*s2)/(n1+n2-2)
|  tst - (yb1 - yb2)/sqrt(s*(1/n1 + 1/n2))
|  tst
|}
|
| ## ** My second R Function
|
| ## another simple example function from the manual
| bslash - function(X, y) {
|X - qr(X)
|qr.coef(X, y)
|  }
|
| ## my-sources.R ends here
`-

With outline-minor-mode and outshine.el activated, you will have all the
structure-editing and outline-navigation commands you are used to from
Org-mode. But you can program in this buffer directly without any
intermediate steps, and send your functions or whatever via ESS to the R
process-buffer.

The literate programming part comes from outorg.el then. With 

,--
| C-c ’
`--

on or inside any header in this file, the subtree at point is offered
for editing in a temporary Org buffer, with all source code enclosed in
source blocks and all comment text uncommented, e.g. 

,--
| ** My first R Function
| 
| simple example function from the manual
| #+begin_src ess
| twosam - function(y1, y2) {
|  n1  - length(y1); n2  - length(y2)
|  yb1 - mean(y1);   yb2 - mean(y2)
|  s1  - var(y1);s2  - var(y2)
|  s - ((n1-1)*s1 + (n2-1)*s2)/(n1+n2-2)
|  tst - (yb1 - yb2)/sqrt(s*(1/n1 + 1/n2))
|  tst
|}
| #+end_src
`--

With 

,--
| C-u C-c '
`--

the whole buffer is converted to Org. 

You can then do your (comment) text editing will full Org-mode
functionality, and since the headlines are converted too, you can export
to any backend or use other Org functions that act on headlines. 

When you are done, just type 

,
| M-#
`

and the temporary Org-mode buffer is killed and all the changes are
applied to the original source code buffer. 

So you really have the lookfeel of Org-mode in your source code
buffers, but without the annoying and error prone tangling. It works
for all kinds of major modes (emacs-lisp, picolisp, ess, and, at least in
theory, all others).

This way the line between Org-mode and source code buffers is blurring
and literate programming becomes more efficient and 

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

2013-06-05 Thread Michael Brand
Hi Eric

On Wed, May 29, 2013 at 6:14 PM, Michael Brand
michael.ch.br...@gmail.com wrote:
 Hi Eric

 On Wed, May 22, 2013 at 7:03 PM, Michael Brand
 michael.ch.br...@gmail.com wrote:
 Please review and comment my attached patch containing doc and ERT.

 As there has been no answer yet from anyone else: Could you please
 read this thread and review my Babel patch? I guess that you did not
 follow the thread because the subject and the first two posts are
 non-Babel.

 Michael

I don't expect a review within a few days but it would help me to know
whether you or somebody else plans to look at my two weeks old patch.

One of the emails in the thread misses a References in the email
header but the following URL gives a complete list of all messages of
this thread:
http://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=link+abbreviation+with+multiple+params%2C+e.+g.+for+geo+locationssubmit=Search!idxname=emacs-orgmodemax=100result=normalsort=date%3Aearly

Michael



Re: [O] How to omit h1 title heading in HTML export?

2013-06-05 Thread *
On 6/4/13, Rasmus ras...@gmx.us wrote:
 * viki.ve...@gmail.com writes:

 Hey Basile
 Thanks for your reply!

 Yes, the suggestion helps :-)
 A blank TITLE option seems to produce some empty tags like so:
 h1 class=title/h1

 And maybe there are also some jquery fixes, for instance...
 $(#content h1:first-child).hide();

 Sometimes tricks are fun,
 but I guess one of my questions was: Do all documents generated by
 HTML export contain the h1 class=titleblabla/h1 markup?

 Yes seems like it.  check ox-html.el and org-html--build-meta-info.

 If you are very unhappy with blank title solution proposed by
 Bastien you could use a filter.  Here's a filter I use for headlines;
 you can easily adapt it to your case:

 (defun rasmus/org-html-ignore-title-if-present (string backend info)
 Strip title if it's already there for html.
 (when (and (org-export-derived-backend-p backend 'html)
(string-match h1 class=\mytitle\ string))
   (replace-regexp-in-string h1 class=\title\.*?/h1  string)))

 (add-to-list 'org-export-filter-final-output-functions
  'rasmus/org-html-ignore-title-if-present)




 --
 I hear there's rumors on the, uh, Internets. . .





Thanks for your reply!
Yes, perhaps this is what I was looking for :-)

See below for the snippet that I added to the publishing configuration file.
Modulo very small tweaks, it's your snippet... errors are mine...

In the configuration file I also have to now explicitly say (require 'ox-html)

I'm new at this, so perhaps I ask more questions: Should filters be
defined in the publishing configuration file, like I've done?

(require 'ox-html)
(defun rasmus/org-html-ignore-title-if-present (string backend info)
  Strip title if it's already there for html.
  (when (and (org-export-derived-backend-p backend 'html)
 (string-match h1 class=\title\ string))
(replace-regexp-in-string h1 class=\title\.*?/h1\n+  string)))

(add-to-list 'org-export-filter-final-output-functions
 'rasmus/org-html-ignore-title-if-present)



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

2013-06-05 Thread Rainer M Krug
On Wednesday, June 5, 2013, Darlan Cavalcante Moreira wrote:


 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?


Yes and no. In regards to jumping to the source code, it would necessitate
a searching in the text, but it would be much easier to have it in a file
local variable. This is more standardized then a comment.



 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.


My reasoning - and I would make all tangled R files read only.

Cheers,

Rainer



 --
 Darlan

 At Wed, 05 Jun 2013 16:04:59 +0200,
 Rainer M Krug wrote:
 
  Hi
 
  I am trying to improve my workflow of literate programming of R in
  org. My org file is tangled into many R files and I am using ESS to
  debug.
 
  If an error occurs, I can jump via ESS to the .R file, and in a second
  step via calling org-babel-tangle-jump-to-org into the org file where
  the buggy line sits.
 
 
  Now this is error prone, as one (or is it only me?) is easily tempted to
  edit the R file which is reverted after the next tangle.
 
  So I was thinking: what about calling org-babel-tangle-jump-to-org
  directly from ESS. Vitalie Spinu looked into this option, and came up
 with the
  following suggestion:
 
  If the tangled .R file contains a local variable, one could easily
  identify that it is a tangled file and call org-babel-tangle-jump-to-org
  and would be at the line causing the error.
 
  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)
  `
 
  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).
 
  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 javascript:;
 
  Skype:  RMkrug



-- 
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 (F):   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug


[O] Suppressing interpeter output in code blocks

2013-06-05 Thread Michael Steeves
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?




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



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

2013-06-05 Thread Achim Gratz
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.


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

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada




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

2013-06-05 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 

Re: [O] bug in new exporter

2013-06-05 Thread Nick Dokos
Nick Dokos ndo...@gmail.com writes:

 Just a heads-up: As part of testing this, I stumbled on an unrelated
 current-working-directory problem, where on exporting to pdf, the
 pdflatex of the produced tex file fails to find an image file specified
 with a relative pathname (it works fine with an absolute path name). The
 tex file looks OK and I can process it from the command line. I'll try
 to pin this down more precisely, but do I understand correctly that the
 processing of the tex file should take place with the current working
 directory set to the directory of the org file?


The problem was that I had customized my org-latex-pdf-process to the
texi2dvi recommended value:

 texi2dvi -p -b -c -V %f

The -c (equivalently: --clean or --build=clean) breaks relative paths
because texi2dvi executes in a different directory. The *Org PDF LaTeX
Output* buffer shows

  /usr/bin/texi2dvi: cd /home/nick/src/org/latex/foo.t2d/pdf/build

whereas the org file was in /home/nick/src/org/latex.

If you use texi2dvi, beware of -c (and also --tidy I presume).

So nothing to do with org, but maybe the customization option should not
include the -c.
-- 
Nick