Re: [O] Bug: [babel] #+PROPERTY: eval never-export disables interactive evaluation [8.2.5h (release_8.2.5h-806-gb1199e at /Users/rainerkrug/.emacs.d/org-mode/lisp/)]

2014-03-27 Thread Rainer M Krug
Charles Berry ccbe...@ucsd.edu writes:

 Rainer M Krug Rainer at krugs.de writes:

 
 
 The subject says it all - when I set 
 
 #+PROPERTY: eval never-export 
 
 the interactive evaluation of R code blocks is disabled. Message:
 
 Evaluation of this R code-block is disabled.
 
 [rest deleted]

 It works as advertised for me. I copy and pasted your PROPERTY line
 and ran interactively and then exported. Oh yes, I did C-c C-c.

 I am running 

 Org-mode version 8.2.5h (release_8.2.5h-757-gc444e4 @ ...

 I tried with and without :session with same results.

Thanks - I'll look into my setup and see, if necessary, to produce a small
example file.

Cheers,

Rainer


 HTH,

 Chuck




-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgpIQwHsGAH41.pgp
Description: PGP signature


Re: [O] Reverse lookup from pdf to org?

2014-03-27 Thread Rainer M Krug
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 On Tue, Mar 25, 2014 at 11:07:54AM +0100, Rainer M Krug wrote:
 Hi
 
 I am working on a longish document which will be converted to pdf, and I
 am doing debugging of scripts at the moment.
 
 Therefore I export the document to pdf, and look for errors there. Now I
 have to find the corresponding section in the org file - possible, but
 tedious.
 
 Would it be possibler to include reverse-lookup in org, so that I click
 in the pdf, and the cursor jumps to the position in the org document? I
 really like this feature when e.g. using LyX. 
 
 I have no idea how this could be implemented and if this would be
 difficult, but I think this could be a useful feature for longer documents.

 I think this is only possible with synctex.  See this thread:
 http://thread.gmane.org/gmane.emacs.orgmode/78111

 Hope this helps,

Yes - but is there any progress to get it working? The file is not
included in the contrib directory.

Rainer

-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgp6dWmjnFV_Z.pgp
Description: PGP signature


[O] ignoreheading in LaTeX export

2014-03-27 Thread Alan Schmitt
Hello,

I need to ignore a heading during a LaTeX export (I don't want the
section command to be generated, but I need the text to be included;
the heading is there because the previous one is tagged with export).
I found this solution:

https://stackoverflow.com/questions/10295177/is-there-an-equivalent-of-org-modes-b-ignoreheading-for-non-beamer-documents

Is it still the way to go?

Thanks,

Alan



Re: [O] Export Org checkboxes in ox-html using UTF-8 symbols

2014-03-27 Thread Nicolas Goaziou
Hello,

Grant Rettke g...@wisdomandwonder.com writes:

 Sacha Chua made a nice hack to export checkboxes as unicode symbols to
 HTML here:

 http://sachachua.com/blog/2014/03/emacs-tweaks-export-org-checkboxes-using-utf-8-symbols/?shareadraft=baba27119_533313c944f64

 (defun sacha/org-html-checkbox (checkbox)
   Format CHECKBOX into HTML.
   (case checkbox (on span class=\check\#x2611;/span) ;
 checkbox (checked)
 (off span class=\checkbox\#x2610;/span)
 (trans code[-]/code)
 (t )))
 (defadvice org-html-checkbox (around sacha activate)
   (setq ad-return-value (sacha/org-html-checkbox (ad-get-arg 0

 Thanks Sacha.

There is also:

  (setq org-html-checkbox-type 'unicode)


You need a recent Org, though (maybe development version, I didn't check).


Regards,

-- 
Nicolas Goaziou



Re: [O] ignoreheading in LaTeX export

2014-03-27 Thread Nicolas Goaziou
Hello,

Alan Schmitt alan.schm...@polytechnique.org writes:

 I need to ignore a heading during a LaTeX export (I don't want the
 section command to be generated, but I need the text to be included;
 the heading is there because the previous one is tagged with export).
 I found this solution:

 https://stackoverflow.com/questions/10295177/is-there-an-equivalent-of-org-modes-b-ignoreheading-for-non-beamer-documents

 Is it still the way to go?

You can use a hook or a filter to remove the headline. I would use
a hook in this case. See (info (org) Advanced configuration), the
first example, with an appropriate MATCH argument for `org-map-entries'.


Regards,

-- 
Nicolas Goaziou



Re: [O] Reverse lookup from pdf to org?

2014-03-27 Thread Suvayu Ali
On Thu, Mar 27, 2014 at 09:18:43AM +0100, Rainer M Krug wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 
  On Tue, Mar 25, 2014 at 11:07:54AM +0100, Rainer M Krug wrote:
  Hi
  
  I am working on a longish document which will be converted to pdf, and I
  am doing debugging of scripts at the moment.
  
  Therefore I export the document to pdf, and look for errors there. Now I
  have to find the corresponding section in the org file - possible, but
  tedious.
  
  Would it be possibler to include reverse-lookup in org, so that I click
  in the pdf, and the cursor jumps to the position in the org document? I
  really like this feature when e.g. using LyX. 
  
  I have no idea how this could be implemented and if this would be
  difficult, but I think this could be a useful feature for longer documents.
 
  I think this is only possible with synctex.  See this thread:
  http://thread.gmane.org/gmane.emacs.orgmode/78111
 
  Hope this helps,
 
 Yes - but is there any progress to get it working? The file is not
 included in the contrib directory.

In another thread Aaron says he does not use it regularly, and finds the
solution too fiddly.  I guess that would mean there has been no more
progress on this.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Reverse lookup from pdf to org?

2014-03-27 Thread Rainer M Krug
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 On Thu, Mar 27, 2014 at 09:18:43AM +0100, Rainer M Krug wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 
  On Tue, Mar 25, 2014 at 11:07:54AM +0100, Rainer M Krug wrote:
  Hi
  
  I am working on a longish document which will be converted to pdf, and I
  am doing debugging of scripts at the moment.
  
  Therefore I export the document to pdf, and look for errors there. Now I
  have to find the corresponding section in the org file - possible, but
  tedious.
  
  Would it be possibler to include reverse-lookup in org, so that I click
  in the pdf, and the cursor jumps to the position in the org document? I
  really like this feature when e.g. using LyX. 
  
  I have no idea how this could be implemented and if this would be
  difficult, but I think this could be a useful feature for longer 
  documents.
 
  I think this is only possible with synctex.  See this thread:
  http://thread.gmane.org/gmane.emacs.orgmode/78111
 
  Hope this helps,
 
 Yes - but is there any progress to get it working? The file is not
 included in the contrib directory.

 In another thread Aaron says he does not use it regularly, and finds the
 solution too fiddly.  I guess that would mean there has been no more
 progress on this.

Thanks a lot,

Rainer

-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgpSFvK1KSU0e.pgp
Description: PGP signature


Re: [O] Reverse lookup from pdf to org?

2014-03-27 Thread Rainer M Krug
Brett Viren b...@bnl.gov writes:

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

 One more (half-)possibility is as follows: produce the tex file and
 compile it not with pdflatex, but with plain latex, producing a DVI
 file. Passing the -src option to the latex invocation inserts source
 specials into the DVI file that some DVI viewers (in particular, xdvi)
 can interpret to jump back from the DVI view to the (approximate)
 corresponding location in the tex file:

   latex --shell-escape -src foo.tex
   xdvi foo.dvi

 Okay, here is a crazy idea.  Maybe one can use hyperref and place \url{}
 and/or \href{}{} macros in the org file.  These will turn into clickable
 links in the final PDF.  In them place URLs that look like:

I like the idea of reverse links - could be a nice addition when
enabled.


   file:///path/to/foo.tex.orglink?line=42

 And then use .mailcap (or whatever MIME config that xpdf/evince/etc
 honors) to map the .orglink extension to a script that parses the URL
 (does that full URL get passed?) and invokes emacs to open foo.tex at
 line 42?

But jumping to the .org file would be the aim - right?


 If that much can be made to work (big if!) I see one problem in that the
 /path/to will break if the source is moved.

That would not be a problem, as this would primarily be a debugging /
draft feature.


 Chance of success: 10%

I guess higher?

Rainer


 -Brett.

-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgpyvwUuVgOP2.pgp
Description: PGP signature


Re: [O] No link found on links in drawers

2014-03-27 Thread Bastien
Hi Karl,

Karl Voit devn...@karl-voit.at writes:

 I am using custom links like [[photo:FirstnameLastname.jpg]] in my
 contacts.org.

 Those links stopped working recently. Whenever I try to click or C-c
 C-c the link, I get user-error: No link found.

This is a known issue, related to the recent rewrite of
`org-open-at-point', which is more careful about handling links
only in places where they are properly defined syntacticly-wise.

I will provide a workaround for raw links in property drawers
and comments, letting org-open-at-point to fall back on `ffap'
there.  I don't have any good ideas for handling bracket links
in property drawers so far.

-- 
 Bastien



Re: [O] Org-default face?

2014-03-27 Thread Bastien


Hi Sébastien,

Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 Some time ago, the flowing text inside Org buffers was rendered in the
 `org-default' face.

 It isn't the case anymore.  Is it a bug on my side?

You can turn the use of the 'org-default face on with
M-x buffer-face-mode RET

Using buffer-face-mode has been turned off by default:
http://lists.gnu.org/archive/html/emacs-devel/2012-04/msg00363.html

Best,

-- 
 Bastien




Re: [O] [PATCH] Add catch-up all LaTeX errors

2014-03-27 Thread Nicolas Goaziou


Hello,

Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 FWIW, I'm using this in some export code I have:

   (let* ((orgfile (buffer-file-name))
  (base-name (file-name-base orgfile))
  (htmlfile (concat base-name .html))
  (pdffile (concat base-name .pdf)))
   ...
   (when (file-exists-p pdffile)
 (if (file-newer-than-file-p orgfile pdffile)
   (org-latex-export-to-pdf)
   (message PDF is up to date with Org file

 That way, we know if the PDF file has been (re-)produced: it must be
 newer than the Org file...

True, but, unfortunately, `org-latex-compile' has no access to
orgfile.

It is possible to rely on `file-attributes' and compare creation time of
the pdf file before export (if any) and the one after the export.


Regards,

-- 
Nicolas Goaziou




Re: [O] [PATCH] Add catch-up all LaTeX errors

2014-03-27 Thread Sebastien Vauban
Hello,

Nicolas Goaziou wrote:
 Sebastien Vauban writes:

 FWIW, I'm using this in some export code I have:

   (let* ((orgfile (buffer-file-name))
  (base-name (file-name-base orgfile))
  (htmlfile (concat base-name .html))
  (pdffile (concat base-name .pdf)))
   ...
   (when (file-exists-p pdffile)
 (if (file-newer-than-file-p orgfile pdffile)
   (org-latex-export-to-pdf)
   (message PDF is up to date with Org file

 That way, we know if the PDF file has been (re-)produced: it must be
 newer than the Org file...

 True, but, unfortunately, `org-latex-compile' has no access to
 orgfile.

Isn't `orgfile' equal to `org-babel-exp-reference-buffer' in
`org-latex-compile'?

 It is possible to rely on `file-attributes' and compare creation time of
 the pdf file before export (if any) and the one after the export.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] [PATCH] Add catch-up all LaTeX errors

2014-03-27 Thread Francesco Pizzolante


Hi Nicolas,

 IOW, it cannot tell the difference between a successful export and an
 export failure with an already existing PDFFILE.

 This is not true as this code checks for the `errors' variable in all
 cases. With an already existing PDFFILE, you will end up with this
 message: 'Process completed with errors: ...'.

 If file.pdf exists before the export, you will always get Process
 completed, even if the current export was a total failure (e.g., no
 file produced).

 IIUC, you're really looking after a way to know if a pdf file was really
 produced. Reporting Process completed with errors : [unknown error]
 will certainly not help on this you because some errors are not fatal
 (i.e., they are skipped and the pdf file is still produced).

 From my point of view, the issue comes from the fact that the `errors'
 variable is not correctly filled in with errors from the LaTeX log file.

 [...]

 While the wikibooks reference
 (http://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings) tells that to
 be sure to catch *all* errors, we have to check for any line beginning
 with '!'.

 I agree, but this is not sufficient, see below.

 Then, in the case where the `errors' variable would effectively contain
 any error from the log file, the code you mention above would work in
 any case.

 That's why I started with this patch (*and it works*):

 It depends on what you define as working. We're talking about two
 different things. I think a better error system should report:

   1. a PDF file not produced (or updated),
   2. a PDF file produced with errors,
   3. a PDF file produced with warnings (maybe),
   4. a PDF file produced cleanly.

 4 already works. Your patch improves 2, but 1 is still wrong.

OK, I understand your point: the whole process has to be reviewed and
improved.

But, at least, my patch (or something similar) goes in the right
direction providing a better catching of errors from the log file. Isn't
it?

Could we at least apply this patch (or a better one) that fixes this
single precise issue (catching all errors from the log file)?

Thanks for your help.

Regards,
 Francesco




Re: [O] ignoreheading in LaTeX export

2014-03-27 Thread Sebastien Vauban
Nicolas Goaziou wrote:
 Alan Schmitt alan.schm...@polytechnique.org writes:

 I need to ignore a heading during a LaTeX export

 You can use a hook or a filter to remove the headline. I would use
 a hook in this case.

Could you explain why you would choose a hook?  What's guiding your
choice?

Thanks!

 See (info (org) Advanced configuration), the first example, with an
 appropriate MATCH argument for `org-map-entries'.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] [PATCH] Add catch-up all LaTeX errors

2014-03-27 Thread Francesco Pizzolante
Hi Charles,

 First, I have subsequent messages in this thread and the discussion.

 Should Nick's observation, that

 IOW, it cannot tell the difference between a successful export and an
 export failure with an already existing PDF


 also include the qualification that the existing PDF file is also opened at 
 the
 time of the second export? I base this on Francesco's example above and the
 following.

 I usually export a subtree to LaTeX as PDF file and open. If I make small
 corrections to the subtree and export again, AND forget to close the PDF file
 that is already opened from the earlier export, Org reports a successful
 export; however, the revised exported PDF does not exist. (Also I use
 EXPORT_FILE_NAME: in PROPERTIES as the top of the subtree.)

 If I remember to close the first exported PDF, the revised subtree exports OK.

 I'm just curious, does the problem exist iff the pdf, that is to be replaced,
 is opened?

You're observing the exact same issue I have. As you can see, in my
initial email, I wrote:

 As an example, if you open the target PDF file with Adobe Reader and, in 
 the
 meantime, you export your Org file again to PDF, you'll see that Org will 
 tell
 you it's OK (Process Completed) while, if you look at the *Org PDF LaTeX
 Output* buffer, you'll see an error such as:

 ! I can't write on file `toto.pdf'.
 [...]

To answer your question: yes, the problem exists iff the pdf, that is to
be replaced, is opened in Adobe Reader. In this particular case, the
problem comes from the fact that we do not catch *all* errors from the
log file.

Thanks a lot for your remarks.

Regards,
 Francesco



Re: [O] ignoreheading in LaTeX export

2014-03-27 Thread Nicolas Goaziou


Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 Could you explain why you would choose a hook?  What's guiding your
 choice?

The fact that I work in the Org buffer and can use `org-map-entries',
which trivializes the problem here. OTOH, a filter works at the LaTeX
code level and ignoreheading tag may be missing (removed by some other
filter, tags ignored, etc).


Regards,

-- 
Nicolas Goaziou




[O] Warning when make in git

2014-03-27 Thread Rainer M Krug
Hi

I get the following warning when using make in my org-git:

,
| $ make
| .
| .
| .
| Done (Total of 108 files compiled, 3 skipped)
| /Applications/Xcode.app/Contents/Developer/usr/bin/make -C doc info
| org-version: 8.2.5h (release_8.2.5h-864-g3e5fc4)
| makeinfo --no-split org.texi -o org
| org.texi:15: warning: unrecognized encoding name `UTF-8'.
`

Is this something in my setup? Should I worry?

I am using Maverick.

Cheers,

Rainer


-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] ignoreheading in LaTeX export

2014-03-27 Thread Alan Schmitt
Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,

 Alan Schmitt alan.schm...@polytechnique.org writes:

 I need to ignore a heading during a LaTeX export (I don't want the
 section command to be generated, but I need the text to be included;
 the heading is there because the previous one is tagged with export).
 I found this solution:

 https://stackoverflow.com/questions/10295177/is-there-an-equivalent-of-org-modes-b-ignoreheading-for-non-beamer-documents

 Is it still the way to go?

 You can use a hook or a filter to remove the headline. I would use
 a hook in this case. See (info (org) Advanced configuration), the
 first example, with an appropriate MATCH argument for `org-map-entries'.

Thanks a lot for the suggestion, here is what I ended up doing:

#+begin_src emacs-lisp
  (defun as/delete-ignored-heading (backend)
Remove every headline with a tag `ignoreheading' in the
  current buffer. BACKEND is the export back-end being used, as
  a symbol.
(org-map-entries
 (lambda () 
   (when (member ignoreheading (org-get-tags-at nil t))
 (lambda () (delete-region (point) (progn (forward-line) (point

  (setq org-export-before-parsing-hook '(as/delete-ignored-heading))
#+end_src

It works great.

I have a followup question (purely from an aesthetic point of view, the
code works fine). I see that a label is still generated in the LaTeX
file (there is a \label{sec-1} with just the \maketitle above it).
Is it expected?

Thanks again,

Alan



Re: [O] Chaining strings between babel blocks: why so many '\'?

2014-03-27 Thread Alan Schmitt
Hello Nicolas,

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

 Hello,

 Alan Schmitt alan.schm...@polytechnique.org writes:

 I've been playing with block chaining to generate some dot file then to
 export then as images. I had a little trouble finding the number of '\'
 I need to put in front of a quote if I want the quote to be quoted. Here
 is a way to make it work:

 #+name: foo
 #+begin_src emacs-lisp :exports none
 bar [label = \\test1\\]\nbaz [label = \\test2\\]
 #+end_src

 #+results: foo
 : bar [label = \\test1\\]
 : baz [label = \\test2\\]

 #+begin_src dot :file ~/tmp/test-dot.png :var input=foo :exports results
 graph {
   $input
 }
 #+end_src

 My question is: why can't I simply use this:

 #+name: foo
 #+begin_src emacs-lisp :exports none
 bar [label = test1]\nbaz [label = test2]
 #+end_src

 #+results: foo
 : bar [label = \test1\]
 : baz [label = \test2\]

 (I guess the answer is in the error in replace-regexp-in-string:
 (error Invalid use of `\\' in replacement text)
 .)

 Indeed. This function, unless told not to, treats backslashes characters
 specially.

 Would it be problematic to first transform every \\ into a  in
 org-babel-expand-body:dot, before the call to
 replace-regexp-in-string?

 I think `replace-regexp-in-string' should be called with a non-nil
 LITERAL argument in this case.

Yes. I think it should also not try to mach the case (i.e., FIXEDCASE
should be non-nil). Here is a patch to do that.

From c6437e8b7132d95ca432b0690bf65ede6e248567 Mon Sep 17 00:00:00 2001
From: Alan Schmitt alan.schm...@polytechnique.org
Date: Thu, 27 Mar 2014 13:35:31 +0100
Subject: [PATCH] ob-dot.el: Substitute variables literally

* lisp/ob-dot.el (org-babel-expand-body:dot): Do not change the case
nor interpret '\' when substituting block variables.
---
 lisp/ob-dot.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-dot.el b/lisp/ob-dot.el
index b35d7bb..1e399e7 100644
--- a/lisp/ob-dot.el
+++ b/lisp/ob-dot.el
@@ -55,7 +55,9 @@
 	   (replace-regexp-in-string
 		(concat \$ (regexp-quote name))
 		(if (stringp value) value (format %S value))
-		body
+		body
+		t
+		t
  vars)
 body))
 
-- 
1.8.5.3


Best,

Alan


Re: [O] ignoreheading in LaTeX export

2014-03-27 Thread Nicolas Goaziou
Alan Schmitt alan.schm...@polytechnique.org writes:

 Thanks a lot for the suggestion, here is what I ended up doing:

 #+begin_src emacs-lisp
   (defun as/delete-ignored-heading (backend)
 Remove every headline with a tag `ignoreheading' in the
   current buffer. BACKEND is the export back-end being used, as
   a symbol.
 (org-map-entries
  (lambda () 
(when (member ignoreheading (org-get-tags-at nil t))
  (lambda () (delete-region (point) (progn (forward-line) 
 (point

   (setq org-export-before-parsing-hook '(as/delete-ignored-heading))
 #+end_src

I suggest to use the dedicated MATCH argument for `org-map-entries':

  (defun as/delete-ignored-heading (backend)
  Remove every headline with a tag `ignoreheading' in the
current buffer. BACKEND is the export back-end being used, as
a symbol.
  (org-map-entries
   (lambda () (delete-region (point) (progn (forward-line) (point
   +ignoreheading))

 I have a followup question (purely from an aesthetic point of view, the
 code works fine). I see that a label is still generated in the LaTeX
 file (there is a \label{sec-1} with just the \maketitle above it).
 Is it expected?

I don't think so. Though, after a quick test, I'm unable to reproduce
it. Do you have an ECM?


Regards,

-- 
Nicolas Goaziou



[O] what function to use to normalize date to org format?

2014-03-27 Thread Mirko
Hello,

Is there a public function that can accept a string such as 3/4/5 (US
Format) and normalize it to [2005-03-04 Fri]?.

I need it for a bit of helper code.

Thanks,

Mirko




Re: [O] Warning when make in git

2014-03-27 Thread Andrea Rossetti
Rainer M Krug Rainer at krugs.de writes:

 
...
 | makeinfo --no-split org.texi -o org
 | org.texi:15: warning: unrecognized encoding name `UTF-8'.
 `
 
 Is this something in my setup? Should I worry?

My guess: could it be that you have an old version
of makeinfo/texinfo, not supporting UTF-8 for
@documentencoding in org.texi? Regards, Andrea




Re: [O] Warning when make in git

2014-03-27 Thread Rainer M Krug
Andrea Rossetti andrea.rosse...@gmail.com writes:

 Rainer M Krug Rainer at krugs.de writes:

 
 ...
 | makeinfo --no-split org.texi -o org
 | org.texi:15: warning: unrecognized encoding name `UTF-8'.
 `
 
 Is this something in my setup? Should I worry?

 My guess: could it be that you have an old version
 of makeinfo/texinfo, not supporting UTF-8 for
 @documentencoding in org.texi? Regards, Andrea

This is the version info - I did not install an old one on my mac:

,
| $ makeinfo --version
| makeinfo (GNU texinfo) 4.8
| 
| Copyright (C) 2004 Free Software Foundation, Inc.
| There is NO warranty.  You may redistribute this software
| under the terms of the GNU General Public License.
| For more information about these matters, see the files named COPYING.
`

Cheers,

Rainer





-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] Warning when make in git

2014-03-27 Thread Andrea Rossetti
Rainer M Krug Rainer at krugs.de writes:

...
 This is the version info - I did not install an old one on my mac:
 
 ,
 | $ makeinfo --version
 | makeinfo (GNU texinfo) 4.8
 | 
 | Copyright (C) 2004 Free Software Foundation, Inc.
...

I guess the texinfo version is too old for UTF-8: you may see here below that 
UTF-8 is not mentioned, more recent versions have it:

http://www.nongnu.org/texi2latex/texinfo/documentencoding.html#documentencodi
ng

Regards, Andrea





Re: [O] ignoreheading in LaTeX export

2014-03-27 Thread Alan Schmitt
Nicolas Goaziou n.goaz...@gmail.com writes:

 I suggest to use the dedicated MATCH argument for `org-map-entries':

   (defun as/delete-ignored-heading (backend)
   Remove every headline with a tag `ignoreheading' in the
 current buffer. BACKEND is the export back-end being used, as
 a symbol.
   (org-map-entries
(lambda () (delete-region (point) (progn (forward-line) (point
+ignoreheading))

Thank you, this works, with a big caveat (which makes this approach
broken for me): with the following ECM

--8---cut here---start-8---
* No Export:noexport:

test

* Heading 1   :ignoreheading:

foo

* Heading 2

bar
--8---cut here---end---8---

the text under Heading 1 is no longer present. I suspect the heading is
removed before the :noexport: is processed, which captures the text as
well (which is bad: the reason for the heading in the first place is to
end the :noexport: block). I went back to the stack-overflow
suggestion.

 I have a followup question (purely from an aesthetic point of view, the
 code works fine). I see that a label is still generated in the LaTeX
 file (there is a \label{sec-1} with just the \maketitle above it).
 Is it expected?

 I don't think so. Though, after a quick test, I'm unable to reproduce
 it. Do you have an ECM?

It is indeed a problem with the stack-overflow solution and not with
yours. I was confused when trying things out.

Thanks,

Alan



Re: [O] Reverse lookup from pdf to org?

2014-03-27 Thread Brett Viren
Rainer M Krug rai...@krugs.de writes:

 Brett Viren b...@bnl.gov writes:
   file:///path/to/foo.tex.orglink?line=42

 But jumping to the .org file would be the aim - right?

Yes, right.  Maybe a better example is:

  file://foo.orglink?line=42

which might get interpreted as go to line 42 in ./foo.org.

This example is also a relative link which would be less brittle as long
as foo.org and foo.pdf are kept together in the same directory.

 Chance of success: 10%

 I guess higher?

I like your optimism!

-Brett.


pgpSS2ZCL501D.pgp
Description: PGP signature


[O] recent changes in COMMENT and tangling?

2014-03-27 Thread Alan Schmitt
Hello,

Have there been recent changes regarding the COMMENT keyword and
tangling? I just saw some blocks whose grand parent is a comment being
tangled in my configuration file.

Here is an ECM. If you `org-babel-load-file' this file:

--8---cut here---start-8---
* COMMENT level 1
** level 2
#+begin_src emacs-lisp
(message block 2)
#+end_src
*** level 3
#+begin_src emacs-lisp
(message block 3)
#+end_src

* level 1 again
#+begin_src emacs-lisp
(message block 4)
#+end_src
--8---cut here---end---8---

you should see block 3 and block 4 in the Messages buffer.

Thanks,

Alan



Re: [O] Warning when make in git

2014-03-27 Thread Rainer M Krug
Andrea Rossetti andrea.rosse...@gmail.com writes:

 Rainer M Krug Rainer at krugs.de writes:

 ...
 This is the version info - I did not install an old one on my mac:
 
 ,
 | $ makeinfo --version
 | makeinfo (GNU texinfo) 4.8
 | 
 | Copyright (C) 2004 Free Software Foundation, Inc.
 ...

 I guess the texinfo version is too old for UTF-8: you may see here below that 
 UTF-8 is not mentioned, more recent versions have it:

 http://www.nongnu.org/texi2latex/texinfo/documentencoding.html#documentencodi
 ng

OK - now to the next step: makeinfo 4.8 is part of Maverick (OSX) - so
it should be not only me who sees this warning? Is this warning a
problem or can it only result in UTF-8 characters not converted into
texinfo files?

Rainer



 Regards, Andrea





-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] Reverse lookup from pdf to org?

2014-03-27 Thread Rainer M Krug
Brett Viren b...@bnl.gov writes:

 Rainer M Krug rai...@krugs.de writes:

 Brett Viren b...@bnl.gov writes:
   file:///path/to/foo.tex.orglink?line=42

 But jumping to the .org file would be the aim - right?

 Yes, right.  Maybe a better example is:

   file://foo.orglink?line=42

calling

,
| emacs +42 foo.org
`

should open the file foo.org and put the cursor in line 42. 


 which might get interpreted as go to line 42 in ./foo.org.

 This example is also a relative link which would be less brittle as long
 as foo.org and foo.pdf are kept together in the same directory.

Yes - that would be quite useful.


 Chance of success: 10%

 I guess higher?

 I like your optimism!

I am an optimist :-)

Cheers,

Rainer


 -Brett.

-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] Reverse lookup from pdf to org?

2014-03-27 Thread Nick Dokos
Rainer M Krug rai...@krugs.de writes:


 calling

 ,
 | emacs +42 foo.org
 `

 should open the file foo.org and put the cursor in line 42. 


In most cases, it would be better to use emacsclient, otherwise
you might end up with many emacs instances; but more importantly
perhaps, using emacsclient avoids the initialization delay.

Nick





Re: [O] Reverse lookup from pdf to org?

2014-03-27 Thread Rainer M Krug
Nick Dokos ndo...@gmail.com writes:

 Rainer M Krug rai...@krugs.de writes:


 calling

 ,
 | emacs +42 foo.org
 `

 should open the file foo.org and put the cursor in line 42. 


 In most cases, it would be better to use emacsclient, otherwise
 you might end up with many emacs instances; but more importantly
 perhaps, using emacsclient avoids the initialization delay.

True - this was just a proof of concept kind of snippet.

Cheers,

Rainer
 

 Nick





-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] recent changes in COMMENT and tangling?

2014-03-27 Thread Nicolas Goaziou
Hello,

Alan Schmitt alan.schm...@polytechnique.org writes:

 Have there been recent changes regarding the COMMENT keyword and
 tangling? I just saw some blocks whose grand parent is a comment being
 tangled in my configuration file.

This should be fixed. Thank you.


Regards,

-- 
Nicolas Goaziou



[O] [RFC] Sloppy `org-element-context'?

2014-03-27 Thread Nicolas Goaziou
Hello,

As you may know, `org-element-context' returns the object under point,
according to Org Syntax. The questions are: should it be a little
sloppy, for convenience? And, if it should, what degree of sloppiness is
acceptable?

Note that, at the time being, the function is already somewhat sloppy,
because it will return an object right before point. In the following
example, | is point. Even though it is not on the bold object,
evaluating (org-element-context) there will give:

  *bold*| text  =  (bold ...)

Should we go further? A recent discussion about opening links in node
properties suggests that some users expect to encounter Org syntax
there. I believe this is not generally desirable.

One reason is that contents of properties drawers are hidden most of the
time, and we may forget about them. So, for example, an entry could
appear in the agenda but the timestamp triggering it could be difficult
to find. This is why SCHEDULED and DEADLINE keywords were not turned
into node properties: they are always in sight.

Another reason is that properties can contain really anything, including
markup from other languages. For example, EXPORT_LATEX_HEADER property
contains LaTeX code. As such, they should be kept as general as
possible, that is as a pair of key and value, without any syntax
attached to value, much like keywords.

However, it is possible to still parse value of such properties, as
a convenience feature in `org-element-context', as the attached patch
does. Note that it has drawbacks. Let's consider the following idiomatic
example, meant to do something on every active timestamp below point in
the visible part of the buffer,

  (while (re-search-forward [0-9]\\{4\\}- nil t)
(let ((context (org-element-context)))
  (when (eq (org-element-type context) 'timestamp)
...)))

Used without care, it will be applied to non-existing timestamps (e.g.,
timestamps in a node property) and could lead to confusing behaviour,
like displaying an entry in the agenda because of an invisible
timestamp.

Anyway, here we are. I think it is important to define clearly what
belongs to the syntax (I think it is quite good at the moment), what can
be allowed for the sake of convenience, and what line should never be
crossed (I firmly believe, for example, that `org-element-context'
should never return objects in a comment, an example block, or
a fixed-width area).

Opinions?


Regards,

-- 
Nicolas Goaziou
From ab72802ab90950d8edc2d415443f089a1208f5cc Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou n.goaz...@gmail.com
Date: Thu, 27 Mar 2014 15:12:05 +0100
Subject: [PATCH] org-element: Make `org-element-context' sloppy

* lisp/org-element.el (org-element-context): Allow to parse node
  properties.
---
 lisp/org-element.el | 22 ++
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index d94243b..a774528 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -5598,7 +5598,9 @@ object type, but always include `:begin', `:end', `:parent' and
 `:post-blank'.
 
 As a special case, if point is right after an object and not at
-the beginning of any other object, return that object.
+the beginning of any other object, return that object.  Also,
+parse Org syntax and return objects in planning lines and node
+properties, for convenience.
 
 Optional argument ELEMENT, when non-nil, is the closest element
 containing point, as returned by `org-element-at-point'.
@@ -5668,8 +5670,12 @@ Providing it allows for quicker computation.
 	   (if (and (= pos (point)) ( pos (line-end-position)))
 	   (narrow-to-region (point) (line-end-position))
 	 (throw 'objects-forbidden element
-	;; At a planning line, if point is at a timestamp, return it,
-	;; otherwise, return element.
+	;; Convenience features.
+	;;
+	;; - At a planning line, if point is at a timestamp, return
+	;;   it, otherwise, return element.
+	;;
+	;; - Return objects in node properties values.
 	((eq type 'planning)
 	 (dolist (p '(:closed :deadline :scheduled))
 	   (let ((timestamp (org-element-property p element)))
@@ -5677,8 +5683,16 @@ Providing it allows for quicker computation.
 			(= (org-element-property :begin timestamp) pos)
 			( (org-element-property :end timestamp) pos))
 	   (throw 'objects-forbidden timestamp
-	 ;; All other locations cannot contain objects: bail out.
 	 (throw 'objects-forbidden element))
+	((eq type 'node-property)
+	 (beginning-of-line)
+	 (search-forward : (line-end-position) t 2)
+	 (skip-chars-forward  \t)
+	 (if ( (point) pos) (throw 'objects-forbidden element)
+	   (narrow-to-region (point) (line-end-position))
+	   ;; Do not limit object types in a node property.
+	   (setq type 'paragraph)))
+	;; All other locations cannot contain objects: bail out.
 	(t (throw 'objects-forbidden element)))
(goto-char (point-min))
(let ((restriction (org-element-restriction type))
-- 
1.9.1



Re: [O] recent changes in COMMENT and tangling?

2014-03-27 Thread Alan Schmitt
Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,

 Alan Schmitt alan.schm...@polytechnique.org writes:

 Have there been recent changes regarding the COMMENT keyword and
 tangling? I just saw some blocks whose grand parent is a comment being
 tangled in my configuration file.

 This should be fixed. Thank you.

Thanks, I confirm it's working now.

Alan



Re: [O] [BABEL] BUG Re: Omitting try/catch blocks from tangled R code?

2014-03-27 Thread Eric Schulte
Rainer M Krug rai...@krugs.de writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Rainer M Krug rai...@krugs.de writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Rainer M Krug rai...@krugs.de writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Charles Berry ccbe...@ucsd.edu writes:

 John Hendy jw.hendy at gmail.com writes:

 [deleted]
 
  I think the default behavior should be reverted, as tangling and
  exporting are two different things. When I tangle, I want to see the
  code blocks as they are in the org document (with possible variables 
  and
  expansions) but not to create files where I do not put it explicitly
  into a code block. These wrappers have nothing to do with the code, 
  and
  are only there for the exported engine. So I would either revert to 
  the
  original behavior, or, introduce a new header argument,
  e.g. :include-wrappers, which would, if set to t, include the export
  wrappers in the tangled file. This might be useful for debugging
  exporting of code block results, but not for general tangling.
 
 Thanks for chiming in. This was my gut reaction to the default
 behavior. I guess we're still only a sample size of 2, but
 intuitively, I would think that tangling would be a separate beast in
 most cases from exporting. Just to have it on the record, if I tangle,
 it's usually to take the code I've used in something like a Beamer
 presentation or document and combine it into a single .R file so
 someone can run it without needing Org-mode.

 [deleted]

 Sorry to be late to add my $0.02...

 I never want the try/catch wrappers.

 But noweb is indispensable.

 I use noweb a lot to organize and collect blocks. In some cases, I 
 export
 them and in others I just tangle them.

 I hope that the revised code will allow me to turn off try/catch 
 wrapping
 and still be able to use noweb when tangling or exporting.


 In addition to noweb, there are cases where variable expansion is useful
 in tangled code.

 The simplest option is to move things like try/catch blocks out of the
 code block expansion function, and into the execution function.  Then if
 other language present similar constructs (which we want to add to
 execution by default but never want to tangle), we can think about
 abstracting this out into some new level of code block expansion.

 Thoughts?

 Makes perfect sense to me, and would definitely be the better place to
 add them.

 If one wants enclosing code in the tangling, there is always
 the :epilogue and :prologue header arguments, and the try/catch should
 be considered as internal to the execution.


 Great, how's this patch work?  If it looks good I'll apply it.

 Git still puzzles me a lot... If you tell me how I can apply this patch
 (from emacs?) I will try it out.


 Here are some instructions from the command line.

 1. write the patch out to a file on disk, say /tmp/0001-etc...patch

 2. cd into the org-mode directory

 3. make sure you're up to date with the latest

  git pull

 4. apply the patch

  git am /tmp/0001-etc...patch

 and that should do it.

 OK - managed to apply the patch.

 Using 

 Org-mode version 8.2.5h (release_8.2.5h-846-geb806d @ 
 /Users/rainerkrug/.emacs.d/org-mode/lisp/)

 updated this morning, I get the following error:


Could you provide a minimal example file generating this error?

Thanks,


 ,
 | Debugger entered--Lisp error: (wrong-type-argument sequencep 67)
 |   mapconcat(identity COLUMNS -
 | 
 read.table(\/var/folders/50/wcr5bjwn75q595n6x82gxj28gn/T/babel-21363l1U/R-import-21363S9b\,\n
 | header=TRUE,\n row.names=1,\n sep=\\\t\,\n
 | as.is=TRUE)\nCOLS_TO_EVAL -
 | 
 read.table(\/var/folders/50/wcr5bjwn75q595n6x82gxj28gn/T/babel-21363l1U/R-import-21363fHi\,\n
 | header=TRUE,\n row.names=1,\n sep=\\\t\,\n as.is=TRUE)\nALLSPECIES
 | -
 | 
 read.table(\/var/folders/50/wcr5bjwn75q595n6x82gxj28gn/T/babel-21363l1U/R-import-21363sRo\,\n
 | header=TRUE,\n row.names=1,\n sep=\\\t\,\n as.is=TRUE)\nSPECIES -
 | 
 read.table(\/var/folders/50/wcr5bjwn75q595n6x82gxj28gn/T/babel-21363l1U/R-import-213635bu\,\n
 | header=TRUE,\n row.names=1,\n sep=\\\t\,\n as.is=TRUE)\nYEARS -
 | 
 read.table(\/var/folders/50/wcr5bjwn75q595n6x82gxj28gn/T/babel-21363l1U/R-import-21363Gm0\,\n
 | header=TRUE,\n row.names=1,\n sep=\\\t\,\n as.is=TRUE)\nPRESENT -
 | 2008\nMINEFFORT - 3\nPROPTRAIN - 0.6\nRNGSEED - 13\nRNGKIND -
 | \Mersenne-Twister\\nRNGNORMALKIND - \Inversion\\nREFGRID -
 | \./refGrid_8km.rds\\nIFN -
 | \./__BOX__/IFN/DB_IFN/rds/tabplot.rds\\nIFNCOUNT -
 | \./__BOX__/IFN/DB_IFN/rdsRasterized/tabplot.count.8km.rds\\nIFNMEAN
 | -
 | \./__BOX__/IFN/DB_IFN/rdsRasterized/tabplot.mean.8km.rds\\nIFNPRES
 | -
 | \./__BOX__/IFN/DB_IFN/rdsRasterized/tabplot.pres.8km.rds\\nIFNSD
 | -
 | \./__BOX__/IFN/DB_IFN/rdsRasterized/tabplot.sd.8km.rds\\nIFNTABTREE
 | - \./__BOX__/IFN/DB_IFN/rds/tabtree.rds\\ndata.sources -
 | list.files(\./data\, pattern=\*.rda$\,
 | full.names=TRUE)\nR.sources - list.files(\./R\, 

Re: [O] Export arrays for 'sh' code blocks when using bash

2014-03-27 Thread Eric Schulte
Hi Pascal,

This looks like a good patch.  If I could make three changes/requests.

1. This patch should also work for begin_src bash code blocks.  After
   a very quick glance it doesn't appear to.

2. Could you include one or two tests ensuring that this patch does what
   it intends with bash code blocks, and does not affect code blocks
   executed with bin/sh?

3. Large contributions like this require some FSF paperwork.  Please see
   the following page for information on requirements to contribute.

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

Thanks, and I look forward to seeing this merged into Org-mode!
Eric

Pascal Fleury fle...@google.com writes:

 Hello,

 I'dl like to propose a patch for inclusion into org-mode (ob-shell.el in
 particular).

 *TL;DR:* use arrays and associative arrays when exporting variables to bash
 in 'sh' code blocks.

 *Details:*
 When variables are defined in a 'sh' code block, they are exported as
 strings. when the variable itself is an array or a table, then we simply
 get a shell variable that contains the list of all values in a
 non-structured form. E.g.

 #+NAME: my_list
 | one   |
 | two   |
 | three |

 #+NAME: experiment
 | name | first_attempt|
 | date | [2014-03-27 Thu] |
 | user | fleury   |

 #+BEGIN_SRC sh :var scalar=some value :var array=my_list :var table=config
 echo ${scalar}  # - prints 'some value'
 echo ${array}   # - prints 'one two three'
 echo ${table}   # - prints 'first attempt [2014-03-27 Thu] fleury'
 #+END_SRC

 This will print simple strings. Also, there is no easy way to access the
 date of the experiment, for example. Now bash has things like arrays and
 associative arrays, but the current ob-shell.el does not use these.
 Probably because their syntax is bash-specific, and ob-shell.el is
 shell-agnostic.

 My patch (attached) changes this in the case you have
 (setq org-babel-sh-command bash)
 in your emacs config somewhere. If any other value is used, it continues to
 export them as we do today (I don't know enough about other shells).

 In that case, it will export the list as an array, the table as an
 associative array, and the scalar as it does already. So the 'sh' code
 block could then use

 #+BEGIN_SRC sh :var scalar=some value :var array=my_list :var table=config
 echo ${scalar}
 echo ${array[1]} # - prints two
 echo ${table[user]} # - prints fleury
 #+END_SRC

 In the case we have a bigger table, then the first row is used as key, the
 others are represented as a string with all the values (as it is for array
 currently). bash does not have multi-dimensional arrays, so it needs to be
 a string.

 This makes writing shell snippets much easier in my experience, and there
 I'd like to propose this fix for the org-mode community at large.

 --paf

 diff --git a/lisp/ob-shell.el b/lisp/ob-shell.el
 index 3ede701..0a691e2 100644
 --- a/lisp/ob-shell.el
 +++ b/lisp/ob-shell.el
 @@ -106,6 +106,30 @@ This function is called by 
 `org-babel-execute-src-block'.
  
  ;; helper functions
  
 +(defun org-babel-variable-assignments:bash_array (varname values optional 
 sep hline)
 +  Returns a list of statements declaring the values as a bash array.
 +  (format declare -a %s=( \%s\ )
 + varname
 + (mapconcat 'identity
 +   (mapcar
 + (lambda (value) (org-babel-sh-var-to-sh value sep hline))
 + values)
 +   \ \)))
 +
 +(defun org-babel-variable-assignments:bash_associative (varname values 
 optional sep hline)
 +  Returns a list of statements declaring the values as bash associative 
 array.
 +  (format declare -A %s\n%s
 +varname
 +(mapconcat 'identity
 +  (mapcar
 +(lambda (items)
 +  (format %s[\%s\]=%s
 +varname
 +(org-babel-sh-var-to-sh (car items) sep hline)
 +(org-babel-sh-var-to-sh (cdr items) sep hline)))
 +values)
 +  \n)))
 +
  (defun org-babel-variable-assignments:sh (params)
Return list of shell statements assigning the block's variables.
(let ((sep (cdr (assoc :separator params)))
 @@ -114,9 +138,17 @@ This function is called by 
 `org-babel-execute-src-block'.
hline
  (mapcar
   (lambda (pair)
 -   (format %s=%s
 -(car pair)
 -(org-babel-sh-var-to-sh (cdr pair) sep hline)))
 +   (if (and (string= org-babel-sh-command bash) (listp (cdr pair)))
 + (if (listp (car (cdr pair)))
 +   (org-babel-variable-assignments:bash_associative
 +   (car pair) (cdr pair) sep hline)
 +   (org-babel-variable-assignments:bash_array
 +   (car pair) (cdr pair) sep) hline)
 + (format %s=%s
 + (car pair)
 + (org-babel-sh-var-to-sh (cdr pair) sep hline))
 +   )
 + )
   (mapcar #'cdr (org-babel-get-header params :var)
  
  (defun org-babel-sh-var-to-sh (var optional sep hline)

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



[O] Bugfix ob-C.el mixed input variable

2014-03-27 Thread Jakob Lombacher
 When using org-babel with mixed (double, int) input like below, the c file
was not written correctly. The numbers where left out and only the commas
where written.

I guess it was a typo. Attached is the patch.

Jakob

---

#+RESULTS[8894f01ba8e219bd6cafb49748f4d5cad8bb6fd1]: test-parameter
| 1 | 2.3 |
| 3 | 4.2 |



   #+begin_src cpp :var x=test-parameter :includes '(iostream)
 using namespace std;
 cout  hallo  endl;
   #+end_src
From baea909dd3e6d7e4c8eaa2c506a3c6f31c472f11 Mon Sep 17 00:00:00 2001
From: Jakob Lombacher ja...@lombacher.net
Date: Thu, 27 Mar 2014 19:27:03 +0100
Subject: [PATCH] Bugfix, there was one entry too much.

It failed when mixed (int double) table is used as input variable e.g
| 1 | 1.2 |
---
 lisp/ob-C.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index 4c2d1ba..bbd0525 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -264,7 +264,7 @@ FORMAT can be either a format string or a function which is called with VAL.
 	   (when (and type (not (string= type-name tmp-type-name)))
 	 (if (and (member type-name '(int double int32_t))
 		  (member tmp-type-name '(int double int32_t)))
-		 (setq tmp-type '(double  %f))
+		 (setq tmp-type '(double %f))
 	   (error Only homogeneous lists are supported by C.  You can not mix %s and %s
 		  type-name
 		  tmp-type-name)))
-- 
1.9.1



Re: [O] Warning when make in git

2014-03-27 Thread Andrea Rossetti
On my Win7 + MSYS + MinGW + MikTex I found a texinfo 4.13 that compiled
without complaints about UTF-8. I suppose the problem is faced mostly by
Mac users.

Unfortunately I can't reproduce the problem here, so I have no clue about
the contents of the .info output...

Kindest regards, Andrea
Il giorno 27/mar/2014 15:36, Rainer M Krug rai...@krugs.de ha scritto:

 Andrea Rossetti andrea.rosse...@gmail.com writes:

  Rainer M Krug Rainer at krugs.de writes:
 
  ...
  This is the version info - I did not install an old one on my mac:
 
  ,
  | $ makeinfo --version
  | makeinfo (GNU texinfo) 4.8
  |
  | Copyright (C) 2004 Free Software Foundation, Inc.
  ...
 
  I guess the texinfo version is too old for UTF-8: you may see here below
 that
  UTF-8 is not mentioned, more recent versions have it:
 
 
 http://www.nongnu.org/texi2latex/texinfo/documentencoding.html#documentencodi
  ng

 OK - now to the next step: makeinfo 4.8 is part of Maverick (OSX) - so
 it should be not only me who sees this warning? Is this warning a
 problem or can it only result in UTF-8 characters not converted into
 texinfo files?

 Rainer


 
  Regards, Andrea
 
 
 
 

 --
 Rainer M. Krug
 email: Raineratkrugsdotde
 PGP: 0x0F52F982



[O] [Patch] Few small fixes to html header

2014-03-27 Thread Marcin Antczak

I've attached patch below, but I'm affraid that there is something wrong
with indentation.
I'm not sure if there is problem with my settings or just entire
ox-html.el is indented badly.

I've been trying to indent file with the default parameters.
I started Emacs with -Q parameter and as I can see there is
a .dir-locals.el in org-mode repo.

So, everything should be ok. Unfortunately there are some differences related 
to indentation in my patch.

Please review and accept this patch, or enlighten me how to set
indentation properly.


My patch fixes HTML meta data produced on export by ox-html.el

1. Meta charset definition should be set before title as document title can 
contain
some unicode symbols etc.

2. Added viewport declaration as described here:

https://github.com/h5bp/html5-boilerplate/blob/v4.3.0/doc/html.md

here:

https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html

3. Fixed unnecessary \n at the end of Description meta.
4. Removed unnecessary spaces in meta tags.



Marcin

From 2df844b2a14e823fa2020cc425ad5ede75f12534 Mon Sep 17 00:00:00 2001
From: Marcin Antczak marcin.antc...@neutrico-themes.pl
Date: Thu, 27 Mar 2014 19:29:41 +0100
Subject: [PATCH] Few small fixes to html header.

* ox-html.el: Few small fixes to meta tags defined by org-html--build-meta-info function.

1. Meta charset should be set before title of html document.
2. Added meta viewport declaration.
3. Fixed unnecessary \n at the end of Description meta.
4. Removed unnecessary spaces in meta tags.

---
 lisp/ox-html.el | 130 
 1 file changed, 66 insertions(+), 64 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index a843441..39967e1 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -235,7 +235,7 @@ for the JavaScript code in this tag.
   .todo   { font-family: monospace; color: red; }
   .done   { color: green; }
   .tag{ background-color: #eee; font-family: monospace;
-padding: 2px; font-size: 80%; font-weight: normal; }
+	padding: 2px; font-size: 80%; font-weight: normal; }
   .timestamp { color: #bebebe; }
   .timestamp-kwd { color: #5f9ea0; }
   .right  { margin-left: auto; margin-right: 0px;  text-align: right; }
@@ -686,11 +686,11 @@ e.g. \tex:mathjax\.  Allowed values are:
 nilIgnore math snippets.
 `verbatim' Keep everything in verbatim
 `dvipng'   Process the LaTeX fragments to images.  This will also
-   include processing of non-math environments.
+	   include processing of non-math environments.
 `imagemagick'  Convert the LaTeX fragments to pdf files and use
-   imagemagick to convert pdf files to png files.
+	   imagemagick to convert pdf files to png files.
 `mathjax'  Do MathJax preprocessing and arrange for MathJax.js to
-   be loaded.
+	   be loaded.
 t  Synonym for `mathjax'.
   :group 'org-export-html
   :version 24.4
@@ -826,15 +826,15 @@ you can reuse them:
   `rowgroup-number': group number of current row
  `start-rowgroup-p': non-nil means the row starts a group
`end-rowgroup-p': non-nil means the row ends a group
-`top-row-p': non-nil means this is the top row
+	`top-row-p': non-nil means this is the top row
  `bottom-row-p': non-nil means this is the bottom row
 
 For example:
 
 \(setq org-html-table-row-tags
   (cons '(cond (top-row-p \tr class=\\\tr-top)
-   (bottom-row-p \tr class=\\\tr-bottom)
-   (t (if (= (mod row-number 2) 1)
+		   (bottom-row-p \tr class=\\\tr-bottom)
+		   (t (if (= (mod row-number 2) 1)
 			  \tr class=\\\tr-odd
 			\tr class=\\\tr-even)))
 	\/tr\))
@@ -1033,9 +1033,9 @@ scale   Scaling for the HTML-CSS backend, usually between 100 and 133
 align   How to align display math: left, center, or right
 indent  If align is not center, how far from the left/right side?
 mathml  Should a MathML player be used if available?
-This is faster and reduces bandwidth use, but currently
-sometimes has lower spacing quality.  Therefore, the default is
-nil.  When browsers get better, this switch can be flipped.
+	This is faster and reduces bandwidth use, but currently
+	sometimes has lower spacing quality.  Therefore, the default is
+	nil.  When browsers get better, this switch can be flipped.
 
 You can also customize this for each buffer, using something like
 
@@ -1058,41 +1058,41 @@ You can also customize this for each buffer, using something like
 script type=\text/javascript\
 !--/*--![CDATA[/*!--*/
 MathJax.Hub.Config({
-// Only one of the two following lines, depending on user settings
-// First allows browser-native MathML display, second forces HTML/CSS
-:MMLYES: config: [\MMLorHTML.js\], jax: [\input/TeX\],
-:MMLNO: jax: [\input/TeX\, 

Re: [O] [RFC] Sloppy `org-element-context'?

2014-03-27 Thread Rasmus
Hi,

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

 As you may know, `org-element-context' returns the object under point,
 according to Org Syntax. The questions are: should it be a little
 sloppy, for convenience? And, if it should, what degree of sloppiness is
 acceptable?

Would it make sense to make it optional?  For my personal hacks, I
much prefer to work with an element, if possible, and flexibility
could facility fast and easy hacks.  On the other hand in Org-core
clarity and strictness is (probably) preferable.  So something like
this

(let (org-element-strict) (FUN (org-element-context) ...)).


 Note that, at the time being, the function is already somewhat sloppy,
 because it will return an object right before point. In the following
 example, | is point. Even though it is not on the bold object,
 evaluating (org-element-context) there will give:

   *bold*| text  =  (bold ...)

 Should we go further? A recent discussion about opening links in node
 properties suggests that some users expect to encounter Org syntax
 there. I believe this is not generally desirable.

I haven't seen this discussion.  I looked briefly at the suggested
patch; I don't understand why it would be necessary or desirable.  But
I will not rule out that I have yet to consider the correct case!

 Anyway, here we are. I think it is important to define clearly what
 belongs to the syntax (I think it is quite good at the moment), what can
 be allowed for the sake of convenience, and what line should never be
 crossed (I firmly believe, for example, that `org-element-context'
 should never return objects in a comment, an example block, or
 a fixed-width area).

As a user I have no problems with the syntax.

As a hacker (not quite a developer!), I do at time desire more
flexibility with org-context to temporarily evaluating an element
under alternative assumptions of its properties.  A recent example
evaluate $x^{z}$ as-if it isn't a latex-fragment.

—Rasmus

--
This space is left intentionally blank




Re: [O] ignoreheading in LaTeX export

2014-03-27 Thread Rasmus
Alan Schmitt alan.schm...@polytechnique.org writes:

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

 I suggest to use the dedicated MATCH argument for `org-map-entries':

   (defun as/delete-ignored-heading (backend)
   Remove every headline with a tag `ignoreheading' in the
 current buffer. BACKEND is the export back-end being used, as
 a symbol.
   (org-map-entries
(lambda () (delete-region (point) (progn (forward-line) (point
+ignoreheading))

 Thank you, this works, with a big caveat (which makes this approach
 broken for me): with the following ECM

 * No Export:noexport:

 test

 * Heading 1   :ignoreheading:

 foo

 * Heading 2

 bar

 the text under Heading 1 is no longer present. I suspect the heading is
 removed before the :noexport: is processed, which captures the text as
 well (which is bad: the reason for the heading in the first place is to
 end the :noexport: block). I went back to the stack-overflow
 suggestion.

This is why you would want to use a filter rather than a hook
(i.e. you only want to retain the Org structure when exporting).
Here's a slightly modified version of the filter I use.  It sucks, but
ignoreheading is quite hard to get right, especially outside of LaTeX.
Note the comment in the first defun!  If you are unhappy with that
limitation you can use a regexp to look for ignoreheading in the first
line of org-ignoreheading function.  I think I even have an old
version somewhere that uses a regexp.

(defun rasmus/get-org-headline-string-element  (headline backend info)
  Return the org element representation of an element.

Will NOT work with headlines like this one, that has no text-properties

* =verb=
  (let ((prop-point (next-property-change 0 headline)))
(if prop-point (plist-get (text-properties-at prop-point headline) 
:parent
  

(defun rasmus/org-latex-ignoreheading (headline backend info)
  Strip headline from HEADLINE if it has tag ignoreheading.

Somewhat broken for ascii. . .

  (when (org-export-derived-backend-p backend 'latex 'ascii)
(let ((tags
   (org-element-property :tags
 (rasmus/get-org-headline-string-element 
headline backend info
  (when (and tags (member-ignore-case ignoreheading tags))
(string-match \\`.*\n.*\n headline)
(replace-match  nil nil headline)

(add-to-list 'org-export-filter-headline-functions
   'rasmus/org-latex-ignoreheading)


—Rasmus

-- 
Sådan en god dansk lagereddike kan man slet ikke bruge mere




Re: [O] Bugfix ob-C.el mixed input variable

2014-03-27 Thread Eric Schulte
Applied, Thanks!

Jakob Lombacher ja...@lombacher.net writes:

  When using org-babel with mixed (double, int) input like below, the c file
 was not written correctly. The numbers where left out and only the commas
 where written.

 I guess it was a typo. Attached is the patch.

 Jakob

 ---

 #+RESULTS[8894f01ba8e219bd6cafb49748f4d5cad8bb6fd1]: test-parameter
 | 1 | 2.3 |
 | 3 | 4.2 |



#+begin_src cpp :var x=test-parameter :includes '(iostream)
  using namespace std;
  cout  hallo  endl;
#+end_src

 From baea909dd3e6d7e4c8eaa2c506a3c6f31c472f11 Mon Sep 17 00:00:00 2001
 From: Jakob Lombacher ja...@lombacher.net
 Date: Thu, 27 Mar 2014 19:27:03 +0100
 Subject: [PATCH] Bugfix, there was one entry too much.

 It failed when mixed (int double) table is used as input variable e.g
 | 1 | 1.2 |
 ---
  lisp/ob-C.el | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/lisp/ob-C.el b/lisp/ob-C.el
 index 4c2d1ba..bbd0525 100644
 --- a/lisp/ob-C.el
 +++ b/lisp/ob-C.el
 @@ -264,7 +264,7 @@ FORMAT can be either a format string or a function which 
 is called with VAL.
  (when (and type (not (string= type-name tmp-type-name)))
(if (and (member type-name '(int double int32_t))
 (member tmp-type-name '(int double int32_t)))
 -  (setq tmp-type '(double  %f))
 +  (setq tmp-type '(double %f))
  (error Only homogeneous lists are supported by C.  You can not 
 mix %s and %s
 type-name
 tmp-type-name)))

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



[O] Bug: Org-mode interprets lines starting with | as tables even when those lined are inside an align* block [8.2.5h (8.2.5h-30-gdd810b-elpa @ /home/kosta/.emacs.d/elpa/org-20140303/)]

2014-03-27 Thread Konstantin Kliakhandler

Hello,

Pretty much what the headline says. This incorrect interpretation means
that if for example one tries to use org-cdlatex completions in that
line or later in the block, they won't work: Instead, new cells will be
created.

Example code:

\begin{align*}
|x
\end{align*}

Emacs  : GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2014-01-01 on gkar, modified by Debian
Package: Org-mode version 8.2.5h (8.2.5h-30-gdd810b-elpa @ 
/home/user/.emacs.d/elpa/org-20140303/)

current state:
==
(setq
 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-speed-command-hook '(org-speed-command-default-hook
  org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function '(lambda (name contents) contents)
 org-log-done 'time
 org-format-latex-options '(:foreground default :background default :scale 3
:html-foreground Black :html-background
Transparent :html-scale 1.0 :matchers
(begin $1 $ $$ \\( \\[))
 org-latex-format-inlinetask-function 'ignore
 org-confirm-shell-link-function 'yes-or-no-p
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-pretty-entities t
 org-agenda-custom-commands '((w todo TODO)
  (h agenda  ((org-agenda-show-all-dates nil)))
  (W agenda 
   ((org-agenda-ndays 21)
(org-agenda-show-all-dates nil))
   )
  (A agenda 
   ((org-agenda-ndays 1)
(org-agenda-overriding-header Today))
   )
  )
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-default-notes-file ~/Dropbox/Documents/Org/notes.org
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-pretty-entities-include-sub-superscripts nil
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook org-show-block-all 
append
local]
   5]
 #[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook 
org-babel-show-result-all
append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes
 setup-org-mode)
 org-use-speed-commands t
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
org-babel-execute-safely-maybe)
 org-directory ~/Dropbox/Documents/Org/
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-todo-keywords '((type TODO(t!) STARTED(s) WAITING(w@/!) |
  CANCELLED(c) FUTURE(f) DONE(d!))
 (type Note(n)) (type Event(e))
 (sequence PROJECT(p) | COMPLETE(c@)))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-html-format-headline-function 'ignore
 org-html-format-inlinetask-function 'ignore
 org-agenda-files '(~/Dropbox/Documents/Org/)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )



[O] o-blog and org-export-as-html

2014-03-27 Thread Esben Stien

I'm trying to use o-blog with org-mode-8.2.5h, but the function
org-publish-blog in o-blog requests org-export-as-html. The correct
function is org-html-export-as-html

Is o-blog so unmaintained and should I just look for an alternative?

-- 
Esben Stien is b0ef@e s  a 
 http://www. s tn m
  irc://irc.  b  -  i  .   e/%23contact
   sip:b0ef@   e e 
   jid:b0ef@n n



Re: [O] [PATCH] Add catch-up all LaTeX errors

2014-03-27 Thread Marcin Borkowski
Dnia 2014-03-26, o godz. 18:33:30
Charles Millar mill...@verizon.net napisał(a):

 If I remember to close the first exported PDF, the revised subtree 
 exports OK.
 
 I'm just curious, does the problem exist iff the pdf, that is to be 
 replaced, is opened?

This is rather a workaround, but don't use Adobe Reader, use any other
PDF viewer instead.  (IIRC, there's also a workaround that makes Adobe
Reader behave correctly, i.e. not lock the pdf file, but I can't find
it now.  See here, for example:
http://stackoverflow.com/questions/4910029/possible-to-make-adobe-reader-not-hold-a-file-lock-on-windows)
(I, for one, did welcome our new Linux overlords more than a decade
ago, and don't experience that problem at all, using first xpdf, and
now evince.;))

 Charlie Millar

Hth,

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



Re: [O] A problem with publishing

2014-03-27 Thread Marcin Borkowski
Dnia 2014-03-26, o godz. 09:26:15
Rick Frankel r...@rickster.com napisał(a):

 On 2014-03-23 17:01, Marcin Borkowski wrote:
  Hi list,
  
  publishing doesn't work.  I guess that I broke something;).  May the
  source and publishing directories be the same?  I have this in my
  init.el:
  
  (setq org-publish-project-alist
  '((fnis2014
  :base-directory ~/directory
  :publishing-directory ~/directory
  :base-extension org\\|css\\|jpg\\|png
  :publishing-function org-reveal-export-to-html
  :completion-function (lambda () (compile make install)
  
  The make install means just rsync'ing to a remote server.
  
  When I export (C-c C-e R R) and then publish (C-c C-e P x) (or
  M-x compile), everything is ok.  When I just publish, changes
  seem not to be pushed to the remote server, and I'm left with some
  *Org export* process buffers.
 
 My guess is that using *-export-to-html as the publishing function is
 the culprit. There should/needs to be an org-reveal-publish-to-html
 publishing function. I'm guessing the reason it works when you
 manually export is that since the html file is up-to-date vis. the org
 source, the code path bypasses that step (and just runs the completion
 function).
 
 If org-reveal doesn't have a publishing function, try (not tested):
 
 (lambda (plist filename pubdir)
 (org-publish-org-to 'reveal filename .html plist pubdir))

Thanks, I'll try it!

 BTW, org-publish has built-in support for pushing to a remote server.
 You can use a tramp url as the publishing-directory, bypassing the
 completion function.

I know, but I read in the manual that it may not be the fastest thing
in the world.  (In fact, I use a very simple Makefile, which in turn
uses rsync, so it /might/ indeed be faster, not copying unnecessary
stuff.  Not sure whether Emacs+Tramp would do it.)

 rick

Thanks again,

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



Re: [O] Reverse lookup from pdf to org?

2014-03-27 Thread Marcin Borkowski
Dnia 2014-03-27, o godz. 15:43:45
Rainer M Krug rai...@krugs.de napisał(a):

 Brett Viren b...@bnl.gov writes:
 
  Rainer M Krug rai...@krugs.de writes:
 
  Brett Viren b...@bnl.gov writes:
file:///path/to/foo.tex.orglink?line=42
 
  But jumping to the .org file would be the aim - right?
 
  Yes, right.  Maybe a better example is:
 
file://foo.orglink?line=42
 
 calling
 
 ,
 | emacs +42 foo.org
 `
 
 should open the file foo.org and put the cursor in line 42. 
 
 
  which might get interpreted as go to line 42 in ./foo.org.
 
  This example is also a relative link which would be less brittle as
  long as foo.org and foo.pdf are kept together in the same directory.
 
 Yes - that would be quite useful.
 
 
  Chance of success: 10%
 
  I guess higher?
 
  I like your optimism!
 
 I am an optimist :-)

You really are.

Inserting stuff like this into the TeX file /may/ very easily break it,
in the sense that it does compile, but /looks/ different (read: has
different line and/or page breaks) than without it.  (Though it /might/
be possible, I'm only saying that it would require much TeX expertise
and being very careful.  In fact, TeX4ht seems to do something similar
(though I never used it), so maybe I'm too pessimistic;).)

 Cheers,
 
 Rainer

Best,

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



Re: [O] New headline after no content (empty headline)

2014-03-27 Thread Brady Trainor

Bastien bzg at gnu.org writes:

 ---does the Org version that comes from the maint branch 
 still needs a fix?  If so, can you describe the problem
 again?


I did test the `maint` branch today. The behavior was not ideal for my 
funny use-case.

For `org-insert-heading' (M-RET), I wanted the following action on empty 
headlines:

*  |-- * \n* , rather than *\n* .

This patch may be suitable:

(org.el)

==

diff --git a/lisp/org.el b/lisp/org.el
index 6d6fbeb..86eb347 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7685,9 +7685,10 @@ This is important for non-interactive uses of the 
command.
 So this will delete or add empty lines.
   (save-excursion
 (goto-char (point-at-bol))
-(if (looking-back \\s-+ nil 'greedy)
-(replace-match ))
-(or (bobp) (insert \n))
+(unless (looking-back \* \n)
+  (if (looking-back \\s-+ nil 'greedy)
+  (replace-match ))
+  (or (bobp) (insert \n)))
 (while ( N 0)
   (insert \n)
   (setq N (1- N)

==

Thank you!

Brady