Re: [O] [RFC] Org linting library

2015-04-23 Thread Sebastien Vauban
Nicolas Goaziou wrote:
 Here's another update. I added a few more tests.

 If there's no more bug report or feedback, I'll simply put it in
 a wip-lint branch until Org 8.4 starts its development cycle.

Could `org-lint' return a success/fail indication, so that we could
write something along in an export hook:

--8---cut here---start-8---
(if (org-lint)
... continue with export ...
  ... stop with message or display the lint buffer ...)
--8---cut here---end---8---

As well, could the buffer be hidden (or killed) if it's empty?

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Resolving conflicts with ediff and folding

2015-04-23 Thread J. David Boyd
Charles C. Berry ccbe...@ucsd.edu writes:

 On Tue, 21 Apr 2015, Suvayu Ali wrote:

 Hi,

 Something that has been bugging me for many years now, everytime I
 resolve conflicts in Org files with ediff, it's a pain.  All the buffers
 keep folding the outlines, hiding the conflicts.  I keep going to the
 buffers manually (which can be somewhat of a pain in a text terminal),
 and unfolding them manually.  But of course the PROPERTY drawers,
 LOGBOOKs, and other DRAWERs are still folded!

 And then after I have jumped through hoops, and resolved the conflicts,
 I realise I could have just switched to text-mode before invoking ediff!

 Is there a way where I don't have to remember to switch the major mode
 before invoking ediff[1]?  Or maybe an ediff experience where the
 buffers are forced to unhide text.  I guess it should be possible to
 just temporarily remove all overlays or invisible properties.

 Any thoughts, ideas?

 Did you see this thread:

 http://lists.gnu.org/archive/html/emacs-orgmode/2013-04/msg00400.html

 ??

 HTH,

 Chuck

That't what I was going to say.  I added that to my setup long ago, and it has
been working fine since then.  I don't ediff all that often, but when I do it
certainly helps.

Dave




Re: [O] ob-R, problem with try/catch

2015-04-23 Thread Rainer M Krug


Envoyé de mon iPhone

 Le 23 avr. 2015 à 18:13, Charles C. Berry ccbe...@ucsd.edu a écrit :
 
 On Wed, 22 Apr 2015, Rainer M Krug wrote:
 
 
 
 Envoyé de mon iPhone
 
 Le 23 avr. 2015 à 04:23, Charles C. Berry ccbe...@ucsd.edu a écrit :
 
 On Wed, 22 Apr 2015, Thomas S. Dye wrote:
 
 Aloha all,
 
 Prior to eaa3a761dae, when working in a session, I was able to run this
 R source code block without problems:
 
 ,-
 | #+header: :file r/adze_wt_log.pdf
 | #+header: :results output graphics
 | #+header: :width 4 :height 3
 | #+begin_src R
 |   g - ggplot(x, aes(x = weight))
 |   g + geom_histogram(aes(y=..density..))
 
 ## Try this:
 
 print( g + geom_histogram(aes(y=..density..)) ) # before rm(g).
 
 
 |   rm(g)
 | #+end_src
 `-
 
 After eaa3a761dae, I get an error and an empty output file.
 
 That commit introduced a tryCatch() wrapper for graphics results.
 
 You probably know that ggplot (or ggplot2) relies on printing of objects to 
 produce graphics (see R-FAQ 7.22).
 
 tryCatch(expr,...) evaluates expr and returns its value, which is `rm(g)' 
 in your case. But `rm(g)' is not autoprinted, and you get an empty file.
 
 I am not in front of my computer but there must be more, as even before the 
 commit there should have been empty file for exactly the same reason.
 
 `:results output' will return the autoprinted values. Without tryCatch it 
 works.
 
 
 Also, the error is strange. Could you send a small reproducable example, so 
 that we can see which error you get? Because if you get an error and an 
 empty file, an error must be in the tryCatcb block.
 
 Here are two blocks that differ in using tryCatch. The first produces an 
 empty, malformed pdf. The second produces a valid pdf. If you comment out the 
 `invisible()' line in the first, then both will produce similar valid pdf's.
 
 #+header: :file nada.pdf
 #+header: :results output graphics
 #+header: :width 4 :height 3
 #+begin_src R
  require(ggplot2)
  df -
  data.frame(gp = factor(rep(letters[1:3], each = 10)),
 y = rnorm(30))
  ggplot(df, aes(x = gp, y = y)) + geom_point()
  invisible()
 #+end_src
 
 
 #+BEGIN_SRC R :results output
  require(ggplot2)
  pdf(file=aok.pdf,width=4,height=3)
  df -
  data.frame(gp = factor(rep(letters[1:3], each = 10)),
 y = rnorm(30))
  ggplot(df, aes(x = gp, y = y)) + geom_point()
  invisible()
  dev.off()
 #+END_SRC
 
 

Sorry I overlooked the :results output graphic header. 

This combination is, as far as I can see (holiday, sun, no notebook, org or R) 
not recommended as it will lead to invalid files. 
Should it actually be valid? I would say these two options contradict each 
other, as output returns the output from the session ( terminal ) which is not 
a graphic. 
Possible a candidate for the new linting library for org, to mark it as an 
invalid argument combination 

Cheers, 

Rainer

 
 HTH,
 
 Chuck



Re: [O] [release_8.3beta-1062-gce4e64] Error when exporting to ODT

2015-04-23 Thread Vicente Vera
The patch works. Thank you.

About 2bdc661fde75ed226b19c802ecd31ce12d2ec7e1, I don't use
latexmlmath so can't comment on that.



Re: [O] ob-R, problem with try/catch

2015-04-23 Thread Thomas S. Dye
Aloha Rainer,

Rainer M Krug r.m.k...@gmail.com writes:

 After eaa3a761dae, I get an error and an empty output file.
 
 That commit introduced a tryCatch() wrapper for graphics results.
 
 You probably know that ggplot (or ggplot2) relies on printing of
 objects to produce graphics (see R-FAQ 7.22).
 
 tryCatch(expr,...) evaluates expr and returns its value, which is
 `rm(g)' in your case. But `rm(g)' is not autoprinted, and you get an
 empty file.

 I am not in front of my computer but there must be more, as even
 before the commit there should have been empty file for exactly the
 same reason. Also, the error is strange. Could you send a small
 reproducable example, so that we can see which error you get? Because
 if you get an error and an empty file, an error must be in the
 tryCatcb block.

I'm picking up a project that I last worked on in 2013.  I was under the
impression that the source code blocks were working at that time, but I
guess it is possible that I added the rm() statements after the code
blocks were working and didn't realize that the addition broke them.  I
haven't looked too deeply into the problem, but just assumed that the
session expressed in the source code block behaved as if it were entered
at the R prompt.

In the R session, I see this, which I initially thought was an error:

 png(filename=r/buck-shoulder-hist.png,width=400,height=300); tryCatch({
b - ggplot(x, aes(x=((thickness_shoulder * 100) / mapply(max, 
width_shoulder_front, width_shoulder_back
b + geom_histogram(aes(y=..density..))  + geom_density(weight=2) +
xlab(Buck's Shoulder Index) + facet_wrap(~ turner)
rm(b)
},error=function(e){plot(x=-1:1, y=-1:1, type='n', xlab='', ylab='', 
axes=FALSE); text(x=0, y=0, labels=e$message, col='red'); paste('ERROR', 
e$message, sep=' : ')}); dev.off()
'org_babel_R_eoe'
+ . + null device 
  1 

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] ob-R, problem with try/catch

2015-04-23 Thread Rainer M Krug


Envoyé de mon iPhone

 Le 23 avr. 2015 à 17:53, Thomas S. Dye t...@tsdye.com a écrit :
 
 Aloha Rainer,
 

Hi Thomas,

 Rainer M Krug r.m.k...@gmail.com writes:
 
 After eaa3a761dae, I get an error and an empty output file.
 
 That commit introduced a tryCatch() wrapper for graphics results.
 
 You probably know that ggplot (or ggplot2) relies on printing of
 objects to produce graphics (see R-FAQ 7.22).
 
 tryCatch(expr,...) evaluates expr and returns its value, which is
 `rm(g)' in your case. But `rm(g)' is not autoprinted, and you get an
 empty file.
 
 I am not in front of my computer but there must be more, as even
 before the commit there should have been empty file for exactly the
 same reason. Also, the error is strange. Could you send a small
 reproducable example, so that we can see which error you get? Because
 if you get an error and an empty file, an error must be in the
 tryCatcb block.
 
 I'm picking up a project that I last worked on in 2013.  I was under the
 impression that the source code blocks were working at that time, but I
 guess it is possible that I added the rm() statements after the code
 blocks were working and didn't realize that the addition broke them.

The rm() did not break anything. The behavior that if you want to have a ggplot 
(and e.g. Lattice as well) in a pdf/png/... You have to use print() is standard 
R behavior and was the same before. This question question comes up from time 
to time on the R list as well. And I don't think this can be easily be dealt 
with in org, as it is standard R. 


  I
 haven't looked too deeply into the problem, but just assumed that the
 session expressed in the source code block behaved as if it were entered
 at the R prompt.

It does - only that you wrap you code in pdf() ... dev.off() to get the output 
in a file. 

 
 In the R session, I see this, which I initially thought was an error:
 
 png(filename=r/buck-shoulder-hist.png,width=400,height=300); tryCatch({
 b - ggplot(x, aes(x=((thickness_shoulder * 100) / mapply(max, 
 width_shoulder_front, width_shoulder_back
 b + geom_histogram(aes(y=..density..))  + geom_density(weight=2) +
 xlab(Buck's Shoulder Index) + facet_wrap(~ turner)
 rm(b)
 },error=function(e){plot(x=-1:1, y=-1:1, type='n', xlab='', ylab='', 
 axes=FALSE); text(x=0, y=0, labels=e$message, col='red'); paste('ERROR', 
 e$message, sep=' : ')}); dev.off()
 'org_babel_R_eoe'
 + . + null device 
  1 
 

Nope - this is no error, but simply the code evaluated. An error would be shown 
in the resulting graph. 

 hth,

Yes it does,

Cheers,

Rained

 Tom
 
 -- 
 Thomas S. Dye
 http://www.tsdye.com



Re: [O] ob-R, problem with try/catch

2015-04-23 Thread Aaron Ecay
Hello all,

2015ko apirilak 23an, Rainer M Krug-ek idatzi zuen:
 I'm picking up a project that I last worked on in 2013.  I was under the
 impression that the source code blocks were working at that time, but I
 guess it is possible that I added the rm() statements after the code
 blocks were working and didn't realize that the addition broke them.
 
 The rm() did not break anything. The behavior that if you want to have
 a ggplot (and e.g. Lattice as well) in a pdf/png/... You have to use
 print() is standard R behavior and was the same before. This question
 question comes up from time to time on the R list as well. And I don't
 think this can be easily be dealt with in org, as it is standard R.

Before this change, the code was fed line-by-line to the R interpreter,
and thus each line was auto printed.  (Technically, the result of each
expresion, whcih could span multiple lines.)  After this change, the
code is one expression, and only the result of the whole block is
printed.  Thus the different behavior.

The previous behavior was not unproblematic.  If a code block contained
more than one plot, the results would have been odd: for a pdf device a
multi-page pdf is generated.  For jpg/png, several files are generated
with a sequence number appended to each.

The principled approach is to use the evaluate package for this.  I had
worked on a patch to move towards this approach, but the effort stalled
when Charles Berry reported some regressions with remote sessions, which
I was never able to reproduce (and thus fix) satisfactorily.  The patch
is here: http://mid.gmane.org/87k35orl2w@gmail.com.

In any case, it is clear that one of the workarounds discussed in
this thread should be used.  Perhaps we should generate a warning for
“:results output graphics” R code blocks, since they could produce
this strange situation.  A priori, I expect that “:results value
graphics” should be free from this problem.

-- 
Aaron Ecay



Re: [O] ob-R, problem with try/catch

2015-04-23 Thread Thomas S. Dye
Aloha Rainer,

Rainer M Krug r.m.k...@gmail.com writes:

 Sorry I overlooked the :results output graphic header. 

 This combination is, as far as I can see (holiday, sun, no notebook,
 org or R) not recommended as it will lead to invalid files.
 Should it actually be valid? I would say these two options contradict
 each other, as output returns the output from the session ( terminal )
 which is not a graphic.
 Possible a candidate for the new linting library for org, to mark it
 as an invalid argument combination

IIRC :results output graphics is needed for the ggplot package.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



[O] [PATCH] fix for ignored header args in org-babel-tangle

2015-04-23 Thread Sam Ritchie
I found that all of my header arguments to source blocks were getting 
ignored. Moving the header-args into the let* binding seems to fix this 
issue, though I'm not enough of a guru to know why. Without this 
arguments like


#+BEGIN_SRC clojure :tangle ./project.clj

and

#+BEGIN_SRC clojure :tangle no

were getting ignored and substituted for :tangle yes along with other 
defaults.


Hope this patch is in the right format:

diff --git a/ob-core.el b/ob-core-old.el
index ba82d88..a6ffcc4 100644
--- a/ob-core.el
+++ b/ob-core-old.el
@@ -1368,14 +1368,7 @@ specified in the properties of the current 
outline entry.

 (or body )
  (preserve-indentation (or org-src-preserve-indentation
(save-match-data
- (string-match -i\\ switches
- (header-args (apply #'org-babel-merge-params
- org-babel-default-header-args
- (when (boundp lang-headers) (eval 
lang-headers))

- (append
-  (org-babel-params-from-properties lang)
-  (list (org-babel-parse-header-arguments
- (org-no-properties (or 
(match-string 4) 

+ (string-match -i\\ switches)
 (list lang
   ;; get block body less properties, protective commas, and 
indentation

   (with-temp-buffer
@@ -1383,7 +1376,13 @@ specified in the properties of the current 
outline entry.

   (insert (org-unescape-code-in-string body))
   (unless preserve-indentation (org-do-remove-indentation))
   (buffer-string)))
-  header-args
+  (apply #'org-babel-merge-params
+ org-babel-default-header-args
+ (when (boundp lang-headers) (eval lang-headers))
+ (append
+  (org-babel-params-from-properties lang)
+  (list (org-babel-parse-header-arguments
+ (org-no-properties (or (match-string 4) ))
   switches
   block-indentation)))



--
Sam Ritchie (@sritchie)
Paddleguru Co-Founder
703.863.8561
www.paddleguru.com http://www.paddleguru.com/
Twitter http://twitter.com/paddleguru// Facebook 
http://facebook.com/paddleguru


[O] completion M-TAB / :CREATED: property issue

2015-04-23 Thread Francis J. Monari, Esquire
completion M-TAB / :CREATED: property issue

what i saw: a list of possible drawers
what i expected: a list of possible properties

In the following outline: using completion after the 1st colon / open
property location presents a list of possible properties; using
completion after the 2nd colon / open property location presents a list
of possible drawers.  I believe that the issue is caused by the
:CREATED: property.

* test
  :PROPERTIES:
  :
  :CREATED:  [2015-04-23 Thu 12:41]
  :
  :END:


I am able to reproduce this issue in a 'fresh' file with the outline
above.  I am using:

Window 7 Home Premium Version 6.1 (Build 7601: Service Pack 1).  It is
my habit to run Windows Update.

(emacs-version) GNU Emacs 24.4.1 (i686-pc-mingw32)  of 2014-10-24 on
LEG570
(org-version) 8.2.10 20150420.

(require 'org-expiry)
;;;org-expiry - variables
(setq org-expiry-confirm-flag t)
(setq org-expiry-inactive-timestamps t)
;;;org-expiry
(org-expiry-insinuate)

I am able to reproduce this issue in a minimal setup runemacs -Q with
one difference: Using completion at the 2nd colon inserts the beginning
of a new property drawer :PROPERTIES:.  I do not see this difference
as being significant (a drawer instead of a property is offered).

I have not found this issue on the list of open or archived bugs.

I realize that this is an add-on and the answer might be: This issue is
somebody elses' problem.

Any help or a pointer as to where a correction might lie would be
greatly appreciated.

Thank you,

Frank.



[O] CAPTURE in org-mode

2015-04-23 Thread Steve Prud'Homme
Hi,
I use org-mode with dropbox sync with the iphone client.

On the iPhone client I press on the button capture, i press on the +
button, i write a note.
After I press on botton Outlines and on the Sync button.

In Emacs i do m-x org-mobile-pull, emacs detect the entry.
I undestand that mobile-org put the capture on the from-mobile,org.

I use one file with org-mode is my task,org.
Is there a way to put the capture note on my task,org.
On to switch the note on the from-mobile.org buffer to my task.org buffer.

Thanks


Re: [O] ob-R, problem with try/catch

2015-04-23 Thread Charles C. Berry

On Wed, 22 Apr 2015, Rainer M Krug wrote:




Envoyé de mon iPhone


Le 23 avr. 2015 à 04:23, Charles C. Berry ccbe...@ucsd.edu a écrit :


On Wed, 22 Apr 2015, Thomas S. Dye wrote:

Aloha all,

Prior to eaa3a761dae, when working in a session, I was able to run this
R source code block without problems:

,-
| #+header: :file r/adze_wt_log.pdf
| #+header: :results output graphics
| #+header: :width 4 :height 3
| #+begin_src R
|   g - ggplot(x, aes(x = weight))
|   g + geom_histogram(aes(y=..density..))


## Try this:

print( g + geom_histogram(aes(y=..density..)) ) # before rm(g).



|   rm(g)
| #+end_src
`-

After eaa3a761dae, I get an error and an empty output file.


That commit introduced a tryCatch() wrapper for graphics results.

You probably know that ggplot (or ggplot2) relies on printing of objects to 
produce graphics (see R-FAQ 7.22).

tryCatch(expr,...) evaluates expr and returns its value, which is `rm(g)' in 
your case. But `rm(g)' is not autoprinted, and you get an empty file.


I am not in front of my computer but there must be more, as even before 
the commit there should have been empty file for exactly the same 
reason.


`:results output' will return the autoprinted values. Without tryCatch it 
works.



Also, the error is strange. Could you send a small reproducable example, 
so that we can see which error you get? Because if you get an error and 
an empty file, an error must be in the tryCatcb block.


Here are two blocks that differ in using tryCatch. The first produces an 
empty, malformed pdf. The second produces a valid pdf. If you comment out 
the `invisible()' line in the first, then both will produce similar valid 
pdf's.


#+header: :file nada.pdf
#+header: :results output graphics
#+header: :width 4 :height 3
#+begin_src R
  require(ggplot2)
  df -
  data.frame(gp = factor(rep(letters[1:3], each = 10)),
 y = rnorm(30))
  ggplot(df, aes(x = gp, y = y)) + geom_point()
  invisible()
#+end_src


#+BEGIN_SRC R :results output
  require(ggplot2)
  pdf(file=aok.pdf,width=4,height=3)
  df -
  data.frame(gp = factor(rep(letters[1:3], each = 10)),
 y = rnorm(30))
  ggplot(df, aes(x = gp, y = y)) + geom_point()
  invisible()
  dev.off()
#+END_SRC



HTH,

Chuck

Re: [O] Bug: HTML export ignoring CUSTOM_ID properties

2015-04-23 Thread Nicolas Goaziou
Daniel Clemente n142...@gmail.com writes:

 While the two systems work, I don't see either why the #orgheadline129
 system is better than the #sec-1-4-3-1-2.

Actually is is better because it is consistent. sec-1-4-3-1-2 is
almost as fragile and doesn't play nice with unnumbered headlines.

However, this is not the reason why this change was introduced.
I explained it already.

 Not important enough to justify a breaking change either.

This is not really a breaking change. AFAIK, sec-x.x.x labelling was
never made public. However, you can use CUSTOM_ID to enforce some label
and then refer to it.

 IDs are not only internal. CSS knows about it, JS too, and URLs can be
 built and shared through the web that include org IDs
 (myweb.com/somedoc.html#someid).

ID not specified by the user are internal. sec-x-x is an internal
scheme. You can still use CUSTOM_ID for that.

Of course, it is also possible to add an anchor with id sec-x-x to
numbered headlines only (maybe as an opt-in so newcomers can at least
read about it). However, I suspect that a filter can do as well.


Regards,



Re: [O] Fwd: Don't treat [n] as a footnote, and export [n]

2015-04-23 Thread Nicolas Goaziou
Hello,

Rob Stewart robstewar...@gmail.com writes:

 And just as soon as I send this email, I find the answer:

[num] syntax for footnotes is indeed a pain.  

However, the solution below is really a kludge because some parts of Org
(or external libraries) could hard-code it anyway.

 (setq org-footnote-re
   (concat \\[\\(?:
   ;; Match inline footnotes.
   (org-re fn:\\([-_[:word:]]+\\)?:\\|)
   ;; Match other footnotes.
   ;; \\(?:\\([0-9]+\\)\\]\\)\\|
   (org-re \\(fn:[-_[:word:]]+\\))
   \\)))

 (setq org-footnote-definition-re
   (org-re ^\\[\\(fn:[-_[:word:]]+\\)\\]))

 From http://stackoverflow.com/a/25342297/1526266 .

From an export perspective, you can turn these footnotes back into
regular text at the parse tree level:

--8---cut here---start-8---
(defun my-ignore-false-footnotes (ast backend info)
  (org-element-map ast 'footnote-reference
(lambda (f)
  (let ((label (org-element-property :label f)))
(when (org-string-match-p \\`[0-9]+\\' label)
  (org-element-set-element
   f
   (concat [ label ]
   (make-string (org-element-property :post-blank f) ?\s)))
  ast)

(add-to-list org-export-filter-parse-tree-functions #'my-ignore-false-footnotes)
--8---cut here---end---8---


Regards,

-- 
Nicolas Goaziou



[O] Don't treat [n] as a footnote, and export [n]

2015-04-23 Thread Rob Stewart
Hi,

I have the following in an org mode file (that  do not want as inline
verbatim inside =foo=) :

int[2] a;

When I try exporting to HTML, I get the error:

org-export-get-footnote-definition: Definition not found for footnote 2

I've seen two solutions online:
http://emacsclub.github.io/html/org_tutorial.html
https://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg01248.html

The first works for me, i.e.

#+OPTIONS: f:nil

For this, though, the exported HTML omits the [2] text, i.e. the HTML is

int a;

How do I turn off footnotes for [n] where n is a number, so that [n]
is exported?

Thanks,

--
Rob



[O] Fwd: Don't treat [n] as a footnote, and export [n]

2015-04-23 Thread Rob Stewart
And just as soon as I send this email, I find the answer:

(setq org-footnote-re
  (concat \\[\\(?:
  ;; Match inline footnotes.
  (org-re fn:\\([-_[:word:]]+\\)?:\\|)
  ;; Match other footnotes.
  ;; \\(?:\\([0-9]+\\)\\]\\)\\|
  (org-re \\(fn:[-_[:word:]]+\\))
  \\)))

(setq org-footnote-definition-re
  (org-re ^\\[\\(fn:[-_[:word:]]+\\)\\]))

From http://stackoverflow.com/a/25342297/1526266 .

--
Rob



-- Forwarded message --
From: Rob Stewart robstewar...@gmail.com
Date: 23 April 2015 at 20:10
Subject: Don't treat [n] as a footnote, and export [n]
To: emacs-orgmode@gnu.org


Hi,

I have the following in an org mode file (that  do not want as inline
verbatim inside =foo=) :

int[2] a;

When I try exporting to HTML, I get the error:

org-export-get-footnote-definition: Definition not found for footnote 2

I've seen two solutions online:
http://emacsclub.github.io/html/org_tutorial.html
https://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg01248.html

The first works for me, i.e.

#+OPTIONS: f:nil

For this, though, the exported HTML omits the [2] text, i.e. the HTML is

int a;

How do I turn off footnotes for [n] where n is a number, so that [n]
is exported?

Thanks,

--
Rob



Re: [O] Fwd: Don't treat [n] as a footnote, and export [n]

2015-04-23 Thread Rob Stewart
Hi Nicolas,

For the last line:

(add-to-list org-export-filter-parse-tree-functions #'my-ignore-false-footnotes)

I'm getting

Debugger entered--Lisp error: (wrong-type-argument symbolp
(org-bibtex-merge-contiguous-citations org-bibtex-process-bib-files))
  add-to-list((org-bibtex-merge-contiguous-citations
org-bibtex-process-bib-files) my-ignore-false-footnotes)
  eval((add-to-list org-export-filter-parse-tree-functions (function
my-ignore-false-footnotes)) nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

? Thanks,

--
Rob


On 23 April 2015 at 20:40, Nicolas Goaziou m...@nicolasgoaziou.fr wrote:
 Hello,

 Rob Stewart robstewar...@gmail.com writes:

 And just as soon as I send this email, I find the answer:

 [num] syntax for footnotes is indeed a pain.

 However, the solution below is really a kludge because some parts of Org
 (or external libraries) could hard-code it anyway.

 (setq org-footnote-re
   (concat \\[\\(?:
   ;; Match inline footnotes.
   (org-re fn:\\([-_[:word:]]+\\)?:\\|)
   ;; Match other footnotes.
   ;; \\(?:\\([0-9]+\\)\\]\\)\\|
   (org-re \\(fn:[-_[:word:]]+\\))
   \\)))

 (setq org-footnote-definition-re
   (org-re ^\\[\\(fn:[-_[:word:]]+\\)\\]))

 From http://stackoverflow.com/a/25342297/1526266 .

 From an export perspective, you can turn these footnotes back into
 regular text at the parse tree level:

 --8---cut here---start-8---
 (defun my-ignore-false-footnotes (ast backend info)
   (org-element-map ast 'footnote-reference
 (lambda (f)
   (let ((label (org-element-property :label f)))
 (when (org-string-match-p \\`[0-9]+\\' label)
   (org-element-set-element
f
(concat [ label ]
(make-string (org-element-property :post-blank f) 
 ?\s)))
   ast)

 (add-to-list org-export-filter-parse-tree-functions 
 #'my-ignore-false-footnotes)
 --8---cut here---end---8---


 Regards,

 --
 Nicolas Goaziou



Re: [O] Fwd: Don't treat [n] as a footnote, and export [n]

2015-04-23 Thread Rob Stewart
On 23 April 2015 at 20:53, Nicolas Goaziou m...@nicolasgoaziou.fr wrote:
 (add-to-list 'org-export-filter-parse-tree-functions 
 #'my-ignore-false-footnotes)

Perfect, that works. Thanks Nicolas,

--
Rob



Re: [O] [PATCH] fix for ignored header args in org-babel-tangle

2015-04-23 Thread Nicolas Goaziou
Hello,

Sam Ritchie sritchi...@gmail.com writes:

 I found that all of my header arguments to source blocks were getting
 ignored. Moving the header-args into the let* binding seems to fix
 this issue, though I'm not enough of a guru to know why. Without this
 arguments like

 #+BEGIN_SRC clojure :tangle ./project.clj

 and

 #+BEGIN_SRC clojure :tangle no

 were getting ignored and substituted for :tangle yes along with
 other defaults.

 Hope this patch is in the right format:

Thank you. 

Would you mind providing your patch with git format-patch and follow
guidelines at

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

for the commit message (e.g., you need to add TINYCHANGE at its end if
you didn't sign FSF papers yet).

Eventually, could you write a test for this? See
testing/lisp/test-ob-tangle.el.


Regards,

-- 
Nicolas Goaziou



Re: [O] How to export an Org file to LaTeX's book class, but without parts?

2015-04-23 Thread Marcin Borkowski

On 2015-04-22, at 08:27, Miguel Ruiz rbeni...@inbox.com wrote:

 If you don't mind to live with part-chapter-section instead 
 chapter-section-subsection:

 ---8-orgmode src8---

 #+LaTeX_CLASS: book

 #+LaTeX_HEADER: \let\part\chapter
 #+LaTeX_HEADER: \let\chapter\section
 #+LaTeX_HEADER: \let\section\subsection

 ---8---end of orgmode src8---

Haha, thanks!  Not a clean way, but should work.  Nice!

 Regards.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



[O] Creating a link to a file using ID

2015-04-23 Thread Yuri Niyazov
I would like to link to a whole file (rather than a heading in that
file), but instead of using the path+name, I would like to use an id,
so that it survives renames. Is it possible to assign an ID to the
whole buffer? I tried doing
#+CUSTOM_ID:   A948A2E7-F4A0-4F77-8D7A-C6273DA7D734
and
#+ID:   A948A2E7-F4A0-4F77-8D7A-C6273DA7D734

but a link to such an ID results in an error when clicked. I am going
to link to a heading in the file instead for now, but it would be nice
to know if this is possible. Thanks!



Re: [O] ob-R, problem with try/catch

2015-04-23 Thread Aaron Ecay
Hi Tom,

2015ko apirilak 23an, Thomas S. Dye-ek idatzi zuen:
 
 IIRC :results output graphics is needed for the ggplot package.

Hmm.  This is the case if the code is *not* evaluated in a session.  In
a session, either value or output result types work.  (All this has been
tested with a recent master version.)  An unfortunate situation – IMO
the value type ought to work outside of a session, provided that the
value of the last expression in the block is a ggplot object.

Here’s a code block that can be adapted to test various combinations:

#+begin_src R :results output graphics :file foo.png :session *foo*
  library(ggplot2)
  ggplot(data.frame(x = rnorm(10), y = rnorm(10)),
 aes(x = x, y = y)) +
geom_point()
#+end_src

-- 
Aaron Ecay



Re: [O] CAPTURE in org-mode

2015-04-23 Thread Subhan Michael Tindall
Look into org-refile (mapped to C-c C-w)
This will allow you to move subtrees from one org file to another.


From: emacs-orgmode-bounces+subhant=familycareinc@gnu.org 
[mailto:emacs-orgmode-bounces+subhant=familycareinc@gnu.org] On Behalf Of 
Steve Prud'Homme
Sent: Thursday, April 23, 2015 10:57 AM
To: Emacs-orgmode@gnu.org
Subject: [O] CAPTURE in org-mode

Hi,
I use org-mode with dropbox sync with the iphone client.

On the iPhone client I press on the button capture, i press on the + button, i 
write a note.
After I press on botton Outlines and on the Sync button.

In Emacs i do m-x org-mobile-pull, emacs detect the entry.
I undestand that mobile-org put the capture on the from-mobile,org.

I use one file with org-mode is my task,org.
Is there a way to put the capture note on my task,org.
On to switch the note on the from-mobile.orghttp://from-mobile.org buffer to 
my task.orghttp://task.org buffer.

Thanks



This message is intended for the sole use of the individual and entity to which 
it is addressed and may contain information that is privileged, confidential 
and exempt from disclosure under applicable law. If you are not the intended 
addressee, nor authorized to receive for the intended addressee, you are hereby 
notified that you may not use, copy, disclose or distribute to anyone the 
message or any information contained in the message. If you have received this 
message in error, please immediately advise the sender by reply email and 
delete the message.  Thank you.


Re: [O] How to export an Org file to LaTeX's book class, but without parts?

2015-04-23 Thread Marcin Borkowski

On 2015-04-22, at 03:32, Nick Dokos ndo...@gmail.com wrote:

 Marcin Borkowski mb...@mbork.pl writes:

 Hi all,

 this is an actual question, but it can be viewed as a continuation of
 the why use LaTeX directly and not Org thread (disclaimer: from the
 POV of an experienced LaTeX user and much less experienced Org-exporter
 user).

 So, I tried to do the opposite, just to learn something/unlock the Org
 Exporter skill;-).  I want to export my Org file to the book class
 (actually, a class similar to it, but never mind), but I want my
 first-level headings to be chapters, not parts.  OTOH, I don't want to
 modify org-latex-classes. Is that possible, and if yes, how to achieve
 that?

 AFAIK, no, not without modifying org-latex-classes - why don't you want
 to modify it?

Because I want this setup for only one file, and not necessarily globally.

BTW, I'll probably settle with this:

,
| #+LATEX_CLASS: mwbk
| # Local Variables:
| # org-latex-classes: ((mwbk \\documentclass[11pt]{mwbk} (\\chapter{%s} 
. \\chapter*{%s}) (\\section{%s} . \\section*{%s})))
| # End:
`

Seems to do the trick (mwbk is a Polish-localized - or rather, European
- version of the book class).  The drawback is that it keeps asking for
confirmation that it is safe.  It seems that there is no option to mark
a /variable/ and not a /variable-value pair/ as safe as file local
variables - I guess I'll file an Emacs feature request for that.

 Nick

Thanks to all, and best regards!

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



Re: [O] Bug: HTML export ignoring CUSTOM_ID properties

2015-04-23 Thread Daniel Clemente
El Tue, 21 Apr 2015 09:25:13 +0200 Nicolas Goaziou va escriure:
 
 Hello,
 
 Daniel Clemente n142...@gmail.com writes:
 
  I also saw this change (diff format):
 
  -div id=outline-container-sec-1-4-3-1-2 class=outline-6
  -h6 id=sec-1-4-3-1-2span class=section-number-61.4.3.1.2/span 
  tercer error con stash/h6
  +div id=outline-container-orgheadline129 class=outline-6
  +h6 id=orgheadline129span class=section-number-61.4.3.1.2/span 
  tercer error con stash/h6
 
  The #sec-1-4-3-1-2 format was better. If I delete section 1.4.3.1.2,
  section 1.5 is still called 1.5, that's good.
 
 And if you delete section 1.4, section 1.5 is no longer called 1.5. So
 you need to update IDs most times you change headline numbering. I don't
 think it is really better than the current state.
 

It's good to minimize the number of changes after each export. I prefer to 
review 10 changes rather than 200. I cannot just forget and let the automatic 
export work its way; I need to review it because in every export I find many 
different export bugs or unexpected features.

While the two systems work, I don't see either why the #orgheadline129 system 
is better than the #sec-1-4-3-1-2. Not important enough to justify a breaking 
change either.


  And what's the use of IDs if they're not permanent?
 
 The point is that Org knows the ID associated to a given headline, and
 provides tools to access them (`org-export-get-reference' for back-end
 developers, [[*tercer error con stash]] for users).
 

IDs are not only internal. CSS knows about it, JS too, and URLs can be built 
and shared through the web that include org IDs (myweb.com/somedoc.html#someid).



Re: [O] Fwd: Don't treat [n] as a footnote, and export [n]

2015-04-23 Thread Nicolas Goaziou
Rob Stewart robstewar...@gmail.com writes:

 For the last line:

 (add-to-list org-export-filter-parse-tree-functions 
 #'my-ignore-false-footnotes)

Typo. It should be

  (add-to-list 'org-export-filter-parse-tree-functions 
#'my-ignore-false-footnotes)

Regards,



Re: [O] ob-R, problem with try/catch

2015-04-23 Thread Thomas S. Dye
Hi Aaron,

Aaron Ecay aarone...@gmail.com writes:

 Hi Tom,

 2015ko apirilak 23an, Thomas S. Dye-ek idatzi zuen:
 
 IIRC :results output graphics is needed for the ggplot package.

 Hmm.  This is the case if the code is *not* evaluated in a session.  In
 a session, either value or output result types work.  (All this has been
 tested with a recent master version.)

Yes, indeed.  I'd forgotten this distinction, which Erik Iverson spelled
out clearly several years ago:
http://article.gmane.org/gmane.emacs.orgmode/26082

Unless Erik minds, I'll work his post into ob-doc-R when I find some
time.  IMO, it would be nice to have this kind of systematic description
in the first place one goes for help.

 An unfortunate situation – IMO
 the value type ought to work outside of a session, provided that the
 value of the last expression in the block is a ggplot object.

 Here’s a code block that can be adapted to test various combinations:

 #+begin_src R :results output graphics :file foo.png :session *foo*
   library(ggplot2)
   ggplot(data.frame(x = rnorm(10), y = rnorm(10)),
  aes(x = x, y = y)) +
 geom_point()
 #+end_src

Thanks, this code will be useful as I pick up this project, which was
the first time I tried to do something substantial with Org mode.  I'm
going to find a ton of cruft ...

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] ob-R, problem with try/catch

2015-04-23 Thread Thomas S. Dye
Aloha Chuck,

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

 On Wed, 22 Apr 2015, Thomas S. Dye wrote:

 Aloha all,

 Prior to eaa3a761dae, when working in a session, I was able to run this
 R source code block without problems:

 ,-
 | #+header: :file r/adze_wt_log.pdf
 | #+header: :results output graphics
 | #+header: :width 4 :height 3
 | #+begin_src R
 |   g - ggplot(x, aes(x = weight))
 |   g + geom_histogram(aes(y=..density..))

 ## Try this:

 print( g + geom_histogram(aes(y=..density..)) ) # before rm(g).

Perfect--a graph in the file and a clean session.  Thanks!

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] [release_8.3beta-1062-gce4e64] Error when exporting to ODT

2015-04-23 Thread Rasmus
Hi Vicente,

Thanks for catching another bug.

Vicente Vera vicente...@gmail.com writes:

 Just tried to export an Org file to ODT but this error appeared (taken
 from the Messages buffer):

 ...
 LaTeX to MathML converter not available.
 Formatting LaTeX using verbatim
 OpenDocument export failed: Assertion failed: (funcall predicate element info)

 Tried with a MWE and with a minimal init.el (because of
 org-export-backends and the odt symbol) but the error persists.

Yeah, my guess is that the error is in org-odt-format-label.  It used to
be that an inline formula would not have a label.  But now it does.  So
label is non-nil.  The attached patch seems to fix it, but
org-odt-format-label is pretty fragile in its assumptions...

I also pushed a fix to org.el that may be related if you e.g. use
latexmlmath.

For the record, it can be reproduced with the following example from 
emacs -q.

—Rasmus

* set up   :noexport:
#+BEGIN_SRC emacs-lisp
  (require 'ox-odt)
  (setq org-latex-to-mathml-convert-command
  latexmlmath \%i\ --presentationmathml=%o)
#+END_SRC
* test
  see \(x\)

-- 
Don't panic!!!
From aad7dd24864f3ce988a67061a391d85e649aa375 Mon Sep 17 00:00:00 2001
From: Rasmus ras...@gmx.us
Date: Thu, 23 Apr 2015 12:35:43 +0200
Subject: [PATCH 1/2] ox-odt: Fix bug links without labels.

* ox-odt.el (org-odt-format-label): Determine label more carefully.

Reported-by: Vicente Vera vicente...@gmail.com
http://permalink.gmane.org/gmane.emacs.orgmode/97090
---
 lisp/ox-odt.el | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index a8544a4..faf0b1c 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -2152,13 +2152,15 @@ Return value is a string if OP is set to `reference' or a cons
 cell like CAPTION . SHORT-CAPTION) where CAPTION and
 SHORT-CAPTION are strings.
   (assert (memq (org-element-type element) '(link table src-block paragraph)))
-  (let* ((caption-from
+  (let* ((element-or-parent
 	  (case (org-element-type element)
 	(link (org-export-get-parent-element element))
 	(t element)))
 	 ;; Get label and caption.
-	 (label (org-export-get-reference element info))
-	 (caption (let ((c (org-export-get-caption caption-from)))
+	 (label (and (or (org-element-property :name element)
+			 (org-element-property :name element-or-parent))
+		 (org-export-get-reference element-or-parent info)))
+	 (caption (let ((c (org-export-get-caption element-or-parent)))
 		(and c (org-export-data c info
 	 ;; FIXME: We don't use short-caption for now
 	 (short-caption nil))
-- 
2.3.6



Re: [O] [RFC] Org linting library

2015-04-23 Thread Eric Abrahamsen
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Here's another update. I added a few more tests.

 If there's no more bug report or feedback, I'll simply put it in
 a wip-lint branch until Org 8.4 starts its development cycle.

This is handy! No bugs to report.




[O] Avoiding recompilation of ditaa ASCII if unmodified between exports

2015-04-23 Thread Rob Stewart
Hi,

I really appreciate the integration with ditaa and org mode.
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ditaa.html

I have an Org mode document with 5 ditaa diagrams, and exporting my
Org file is taking quite a long time, about 10 seconds to compile 5
ditaa diagrams + HTML export.

At the moment, even if I don't modify any of the ditaa ASCII, all 5
are compiled from ASCII to a PNG. Is there a way ask ditaa to only
generate a new PNG file if the contents of the `#+BEGIN_SRC ditaa`
have changed?

Thanks,

--
Rob



Re: [O] Avoiding recompilation of ditaa ASCII if unmodified between exports

2015-04-23 Thread Loris Bennett
Hi,

Rob Stewart robstewar...@gmail.com writes:

 Hi,

 I really appreciate the integration with ditaa and org mode.
 http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ditaa.html

 I have an Org mode document with 5 ditaa diagrams, and exporting my
 Org file is taking quite a long time, about 10 seconds to compile 5
 ditaa diagrams + HTML export.

 At the moment, even if I don't modify any of the ditaa ASCII, all 5
 are compiled from ASCII to a PNG. Is there a way ask ditaa to only
 generate a new PNG file if the contents of the `#+BEGIN_SRC ditaa`
 have changed?

 Thanks,

 --
 Rob

I think you want to look at caching:

http://orgmode.org/manual/cache.html

Cheers,

Loris

-- 
This signature is currently under construction.




Re: [O] Visibility cycling at end of headline

2015-04-23 Thread Nikolaus Rath
On Apr 23 2015, Kyle Meyer k...@kyleam.com wrote:
 Nikolaus Rath nikol...@rath.org wrote:
 [...]
 * Sample heading 1...
 * Sample heading 2

 If the cursor is to the right of the 1 (in particular if it's at the
 end of the line), nothing happens.

 Why is this,

 I think this is because point is considered to be on the hidden text,
 not the headline, so the cycling behavior does not apply.  To test this,
 run `org-element-at-point' before and after '...'.

Yes, that seems to be a problem.

 and is there a way to change it?

 C-a?

Well, obviously I meant a way to *automatically* have Tab work at the
end of the line (I think redefining Tab to first call C-a would break
stuff in other situations).

Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

 »Time flies like an arrow, fruit flies like a Banana.«



Re: [O] [PATCH] fix for ignored header args in org-babel-tangle

2015-04-23 Thread Charles C. Berry

On Thu, 23 Apr 2015, Nicolas Goaziou wrote:


Hello,

Sam Ritchie sritchi...@gmail.com writes:


I found that all of my header arguments to source blocks were getting
ignored. Moving the header-args into the let* binding seems to fix
this issue, though I'm not enough of a guru to know why. Without this
arguments like

#+BEGIN_SRC clojure :tangle ./project.clj

and

#+BEGIN_SRC clojure :tangle no

were getting ignored and substituted for :tangle yes along with
other defaults.

Hope this patch is in the right format:


I think it is inverted w.r.t. '-' vs '+'



Thank you.


The patch in question modifies `org-babel-parse-src-block-match', which is 
a central part of org-babel.


The patch looks innocuous, but I have a hard time believing that `:tangle 
no' is ignored - there are many places I use it.


And if header args were ignored, lots of other things would break, too.



Would you mind providing your patch with git format-patch and follow


Maybe start with an ECM?

Chuck




[O] Visibility cycling at end of headline

2015-04-23 Thread Nikolaus Rath
Hello,

When I'm trying to expand a folded headline using Tab, this seems to
work only if the cursor is before the '...', i.e. just before the 1 in
the following example:

* Sample heading 1...
* Sample heading 2

If the cursor is to the right of the 1 (in particular if it's at the
end of the line), nothing happens.

Why is this, and is there a way to change it?

Thanks,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

 »Time flies like an arrow, fruit flies like a Banana.«



Re: [O] Visibility cycling at end of headline

2015-04-23 Thread Kyle Meyer
Nikolaus Rath nikol...@rath.org wrote:
[...]
 * Sample heading 1...
 * Sample heading 2

 If the cursor is to the right of the 1 (in particular if it's at the
 end of the line), nothing happens.

 Why is this,

I think this is because point is considered to be on the hidden text,
not the headline, so the cycling behavior does not apply.  To test this,
run `org-element-at-point' before and after '...'.

 and is there a way to change it?

C-a?

--
Kyle