Re: [O] How to trigger the clockcheck in an agenda view.

2013-07-29 Thread Rainer Stengele
Am 7/17/2013 2:07 PM, schrieb Rainer Stengele:
 Am 12.07.2013 10:06, schrieb Rainer Stengele:
 Hi,

 I want to start an aganda view over a week and immediately check the 
 consistency of clock entries:


 See manual for agenda dispacther:

 v c
 Show overlapping clock entries, clocking gaps, and other clocking 
 problems in the current agenda range. You can then visit clocking lines and 
 fix them manually. See the
 variable org-agenda-clock-consistency-checks for information on how to 
 customize the definition of what constituted a clocking problem. To return 
 to normal agenda display, press l
 to exit Logbook mode.


 I can't seem to find a way to trigger the clockcheck in the agenda view 
 options.

 At the moment I have::

 ..
  (Aw
   agenda + no todos - this week - log-mode - ARCHIVE included - clock 
 report
   agenda 
   (
(org-agenda-sorting-strategy '(time-up priority-down))
(org-agenda-span 'week)
(org-agenda-start-with-log-mode t)
(org-agenda-archives-mode t)
(org-agenda-start-with-clockreport-mode t)
))
 ..

 Do I miss the variable to be set?

 Thanks,
 Rainer



 Anybody?
 
 
I know this is special,  but I do not know how to check the existence of such a 
variable.
If it doesn't I would suggest it as enhancement.

Thanks,
Rainer



Re: [O] [babel] Table as varaiables a differently proccesed by #+call lines vs. source code blocks

2013-07-29 Thread Jambunathan K
Torsten Wagner torsten.wag...@gmail.com writes:

 The different ways of calling a source code block might come with
 different system-wide values of header arguments.  Thus, the behaviour
 of a source code block might differ, depending on the way how it was
 called. The table below depicts the variables and standard values for
 the different ways to execute a source code block.

I don't understand the current context.  Nor do I understand Babel. But
purely from a copy-editing perspective, you can say something like

You can modify the behaviour of a source block by customizing
system-wide header arguments.  The table below summarizes these
variables and their standard values

or something like 

The behaviour of a source block depends on the values of system-wide
header arguments.  The table below depicts these variables and their
standard values

Btw, is it system-wide values of header arguments or
   values of system-wide header arguments?

The first suggestion starts with a You - and this style is very
typical of Emacs manuals.  The second paragraph will put one to sleep.
Not a criticism.  Just a suggestion from someone who is bored.



Re: [O] Encoding Problem in export?

2013-07-29 Thread Jambunathan K

If Org links are escaped by Org will the URLs be functional outside of
Org?

i.e., If I am on some machine, that has no Emacs or Org or if I am using
a version of Org that uses new unescape algorithm but the original
link was encoded with the old escape algorithm, will Copy-pasting the
link to a browser still work.

If Org is a MUST to unescape the link then it would be a good decision
to re-look at the link syntax so that the questions of escape and
un-escape is dealt with squarely and have no reasons to arise in future.

[1] IIRC, escaping doesn't happen if URL is copy-pasted but only if it
is inserted.  i.e., escaping much depends on the workflow of the user
and the workflow of a user could much depend on his whims and fancies
and day of the week and seasons of the year.

Just a cent from a Org user.



Re: [O] Encoding Problem in export?

2013-07-29 Thread Jambunathan K

I sense a design flaw.  Fix it rather than escape it.


Jambunathan K kjambunat...@gmail.com writes:

 If Org links are escaped by Org will the URLs be functional outside of
 Org?

 i.e., If I am on some machine, that has no Emacs or Org or if I am using
 a version of Org that uses new unescape algorithm but the original
 link was encoded with the old escape algorithm, will Copy-pasting the
 link to a browser still work.

 If Org is a MUST to unescape the link then it would be a good decision
 to re-look at the link syntax so that the questions of escape and
 un-escape is dealt with squarely and have no reasons to arise in future.

 [1] IIRC, escaping doesn't happen if URL is copy-pasted but only if it
 is inserted.  i.e., escaping much depends on the workflow of the user
 and the workflow of a user could much depend on his whims and fancies
 and day of the week and seasons of the year.

 Just a cent from a Org user.



Re: [O] [ANN] Bibliography support ODT + JabRef

2013-07-29 Thread Jambunathan K

 It can work with Chinese characters now. thanks!

Thanks for confirming this.

 2. Word References should be added to `org-export-dictionary'

I am CCing Ngz.  

Currently Bibliography support in Org is EXPERIMENTAL.  Things will be
in a state of flux until it gets standardized.

I also think the spaces preceding the \cite{ } element should be gobbled
up by the exporter.  In actuality, this is something that ox.el has to
take care as part of standardization effort (I think).

(Ngz can ignore the rest of the message)

 1. the current issue is that the exported references like: 

 References

 * .
 * ..
 * ..

 instead of :

 References

 [1] ...
 [2] ...
 [3]  

 Is it default setting or a bug?

Do you see numbered list in the ODT file that I sent you.  If yes, then
it is likely that you don't have the new styles file
(etc/styles/OrgOdtStyles.xml) or that the exporter is picking up the old
styles file.

What is the value of 

  (custom-set-variables
   '(org-odt-citation-transcoders
 (quote
  (org-odt-citation-reference/numbered
  . org-jabref-odt-bibliography/numbered

You need the above setting for creating numbered entries.  Yes, there
are multiple transcoders that you can use.  One of the transcoders will
NOT use the numbered list.  See custom buffer for details.

If you do

  M-x load-library RET ox-odt.el RET

and subsequently look at *Messages* buffer what styles file is it
using.  It should use the updated styles file.  In my case, I see

  Debug (ox-odt): Using styles under
  /home/kjambunathan/src/org-mode/etc/styles/

If you have merged from my git repo, you will have the updated styles
file.  But for some reason it may not be picked up.  In that case,
update your .emacs with this line.  The path below should point to the
parent of the styles sub-directory.

  (setq org-odt-data-dir ~/src/org-mode/etc/)

The ODT style that is newly introduced is called OrgBibliographyList.
If everything is alright, it should be visible as a List Style in
LibreOffice's Stylist.

feng shu tuma...@gmail.com writes:

 On Mon, Jul 29, 2013 at 3:48 AM, Jambunathan K
 kjambunat...@gmail.com wrote:

 Sorry about spamming you.
 
  s/RTFChars/XMLChars/ is what was needed.
 
 If I use XMLChars, then the Chinese characters in content.xml are
 actually numerically encoded. This would make reading of
 content.xml
 and hence debugging of corruption issues very difficult.
 
 So, I have used s/XMLChars/FormatChars/ and pushed one more update
 to
 the JabRef plugin.
 
 The download link below is still the same. It always points to the
 latest plugin jar.
 
 

 2. Word References should be added to `org-export-dictionary'

 Jambunathan K kjambunat...@gmail.com writes:
 
  OK. I have pushed a fix.
 
  Here is the direct link to updated JabRef Plugin:
 
 
 http://repo.or.cz/w/JabRefChicagoForOrgmode.git/blob_plain/master:/net.
 sf.jabref.export.Chicago.ODF(English)-1.2.jar
 
  Git repository (Home Page):
  http://repo.or.cz/w/JabRefChicagoForOrgmode.git
 
  Pull URL:
  git://repo.or.cz/JabRefChicagoForOrgmode.git
  http://repo.or.cz/r/JabRefChicagoForOrgmode.git
 
  s/RTFChars/XMLChars/ is what was needed. With export preferences
 set to
  utf-8, I am able to export you *.bib entry. I am attaching the
 test
  case file. They seem OK to my non-chinese eye.
 
 
 
 
 
  Jambunathan K kjambunat...@gmail.com writes:
 
  Thanks for trying out.
 
  I don't understand JabRef. So both of us are proceeding blindly
 here.
 
  Possibility 1:
  =
 
  The original JabRef plugin is actually a RTF exporter.
 
  1. Identify the type of the Bib entry you are exporting. Looks
 like the
  entry below is a masterthesis (It could be book, article
  etc). Identify the correspoding layout file. For example,
 
  Chicago.text.mastersthesis.layout
  Chicago.reference.mastersthesis.layout
 
  ,
  | \begin{author}
  | \format[RTFChars,AuthorLastFirstCommas]{\author}. \end
 {author}
  | \begin{year}\format[RTFChars]{\year}. \end{year}
  | \begin{title}\format[RTFChars]{\title}. \end{title}Masters
 thesis,
  | \format[RTFChars]{\school}. \\par\\par
  `
 
  You can open the Jar file right within Emacs with C-x C-f
  whatever.jar.
 
  2. Fix up the layout files.
 
  i.e, Replace \format[RTFChars] with \format[XMLChars]. The
  documentation in
 http://jabref.sourceforge.net/help/CustomExports.php
  is not very clear.
 
  3. Zip up the Jarfile.
 
  4. Uninstall the old plugin
 
  5. Install the new plugin
 
  6. Re-export.
 
  7. See whether the output now makes sense.
 
  Possibility 2:
  

Re: [O] Encoding Problem in export?

2013-07-29 Thread Jambunathan K

Nicolas, David

I just interjected.

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

 ...if that part cannot happen for some reason, links will be unusable
 outside Org.

Correctness should overrule compatibility.  In practice, we may have to
strike a balance, with more weight thrown in favor of correctness.  

I am stating the obvious here, but in a way that is practically useless
to the discussion at hand.

I trust that any solution that you come up with will be a good one.
Also the timing is right.  We can always say Org-8.0 makes a clear
departure from earlier versions for reasons of robustness and
correctness.



Speaking from gut (aka making things up)

Link (un)escaping has also something to do with org-protocol and how the
URL in browser's address bar is captured, encoded(?) and
transferred to the Emacs proper via the bookmarklet.  So the browser
(don't forget the clipboard) acts as *active* intermediaries as the URL
makes it's way from the browser to the Org file either via hand or
through emacsclient.  To complicate the issue, browser being user facing
may be expected to be very lenient with a URL or how it is presented
to the user.

ps-1: org-protocol to work on Windows is quite flaky.

ps-2: There are frequent posts to Emacs mailing lists where copying from
browser to a Emacs buffer will show up un-readable boxes.



Don't read further, if you are allergic to meta musings.

As far as Org is concerned, backward compatibility is not a issue.  The
community is always being replaced *every* academic year.  New scholars
come and the old scholars leave.  The only steady lot of the population
is the college dons.  They will not rely on Org *solely* for serious
publishing work.  They do revise their course support material - like
beamer presentations etc - every term.

In summary, shelf-life of an Org source file that is actually exported
is unlikely to be beyond 4-5 years.  The contents of such source file
has less of stable parts and more of moving parts.



Re: [O] [ANN] Bibliography support ODT + JabRef

2013-07-29 Thread Jambunathan K

   2. Install the JabRef plugin [Chicago Export filters for Org-mode].
   [Chicago Export filters for Org-mode]
   
 http://repo.or.cz/w/JabRefChicagoForOrgmode.git/blob_plain/HEAD:/net.sf.jabref.export.Chicago.ODF(English)-1.2.jar

This is a port of Chicago plugin for JabRef.  Search for Chicago in the
below page.

http://jabref.sourceforge.net/resources.php#plugins

There is a PDF file in there which I have copied over to 


http://repo.or.cz/w/JabRefChicagoForOrgmode.git/blob_plain/refs/heads/master:/Chicago_export_filters.pdf



M-: org-jabref-export-formats

= ((odt
(Chicago Manual of Style (author-date)
 :in-text chicago.ODF.text :bibliography
chicago.ODF.reference)))

Remembers the layout filters are for RTF.  There are multiple formats in
that plugin.  But text and reference are the only filters I have
fixed (i.e, a dirty job) to get satisfactory XML output.  So if
someone is interested in other formats and willing to educate me on how
the ODT document should look like, let me know.

Here is some quick notes on that pdf file.


| Entry types   |
|---|
| article   |
| book  |
| conference|
| electronic|
| inproceedings |
| incollection  |
| masterthesis  |
| phdthesis |
| unpublished   |



| System | Parts | files |
|+---+---|
| author-date| reference list for| Chicago.reference |
|| complete list of sources  |   |
|+---+---|
|| text citations in parenthesis | Chicago.text  |
|+---+---|
| notes and  | biblio for bibliographies | Chicago.biblio|
| bibliography   |   |   |
|+---+---|
|| footend for footnotes | Chicago.footend   |
|| and endnotes  |   |
|+---+---|
|| footend short for subsequent  | Chicago.footend.short |
|| notes or works with   |   |
|| full bibliographies   |   |
|+---+---|
| abstract and note  |   | Chicago.abstract  |
| (follows notes and |   | Chicago.note  |
| biblio style)  |   |   |



Re: [O] Latest Org Compatible with Emacs 23.3.1

2013-07-29 Thread Jambunathan K
Jambunathan K kjambunat...@gmail.com writes:

 Look at the error messages and YOU tell us what the problem is.  It is
 quite obvious what the problem is and how it can be fixed.

I was rude, sorry.  I C-s ed for error and landed up in makeinfo.

The messages pertaining to scroll etc usually pop up as warning messages
in Emacs-24.  This is routine.  I didn't anticipate the functions were
not defined on Emacs 23 so I just overlooked them.



 Kenneth Jacker k...@be.cs.appstate.edu writes:

 Good day!

 I'm running emacs-23.3.1 on an up-to-date Xubuntu 12.04.2 system.
 It includes orgmode-6.33x.

 I downloaded orgmode-8.0.6, but the build failed with these error
 messages:




 The messages suggest that 8.0.6 is not compatible with my version of Emacs.

 Though I was able to run it, I am concerned that some of the
 functionality might be broken and I'll run into trouble later.


 So, wanting to use the latest version possible, I ask: 

 What is the latest version of Orgmode that I can use?

 From where might I down it?


 Thanks for your comments/suggestions!

   -Kenneth



Re: [O] How to trigger the clockcheck in an agenda view.

2013-07-29 Thread Sebastien Vauban
Hi Rainer Stengele,

Rainer Stengele wrote:
 Am 7/17/2013 2:07 PM, schrieb Rainer Stengele:
 Am 12.07.2013 10:06, schrieb Rainer Stengele:

 I want to start an aganda view over a week and immediately check the
 consistency of clock entries:

 I can't seem to find a way to trigger the clockcheck in the agenda view
 options.

 At the moment I have::

 (Aw
  agenda + no todos - this week - log-mode - ARCHIVE included - clock 
 report
  agenda 
  (
   (org-agenda-sorting-strategy '(time-up priority-down))
   (org-agenda-span 'week)
   (org-agenda-start-with-log-mode t)
   (org-agenda-archives-mode t)
   (org-agenda-start-with-clockreport-mode t)
   ))

 Do I miss the variable to be set?

 Anybody?

 I know this is special, but I do not know how to check the existence of such
 a variable. If it doesn't I would suggest it as enhancement.

The following does what you want:

--8---cut here---start-8---
  (add-to-list 'org-agenda-custom-commands
   '(rC Clock Review
 agenda 
 ((org-agenda-archives-mode t)
  (org-agenda-clockreport-mode t)
  (org-agenda-overriding-header Clocking Review)
  (org-agenda-show-log 'clockcheck)
  (org-agenda-span 'day))) t)
--8---cut here---end---8---

Best regards,
  Seb

PS- I've been on holidays and still ahve ~300 Org posts to read...

-- 
Sebastien Vauban




[O] Yet another literate programming application

2013-07-29 Thread Alan Schmitt
Or rather, I should say a literate algebra and calculating application:
http://calca.io/

I'd really like to be able to call such an engine from org-mode. (And
I'm secretly hoping something will say that $some_programming_language
already does it and is fully integrating with org.)

Alan



Re: [O] Yet another literate programming application

2013-07-29 Thread Eric Schulte
Alan Schmitt alan.schm...@polytechnique.org writes:

 Or rather, I should say a literate algebra and calculating application:
 http://calca.io/


If this is appealing, it may be worth checking out the Embedded Mode
of Emacs calc [1].  From what I can tell on the calc.io website, Emacs
calc provides the same functionality, but Emacs calc has the benefits of
(1) it is open source meaning you can confirm calculations and your
answers (in my opinion a must for any peer reviewed publication), and
(2) it may be embedded in *any* type of file.


 I'd really like to be able to call such an engine from org-mode. (And
 I'm secretly hoping something will say that $some_programming_language
 already does it and is fully integrating with org.)


Yes, you can use calc embedded mode in Org-mode files as well.


 Alan


Cheers,

Footnotes: 
[1]  (info (calc)Embedded Mode)

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



Re: [O] [BUG][PATCH] Commit '3142297d69f6063221215757a3ba9c74adcf3e43' breaks some my files

2013-07-29 Thread Eric Schulte
Hi Vladimir,

Thanks for mentioning this bug and sending along your trial and error
patch.  It helped me to confirm the location of the bug.  I've just
pushed up a fix.

Best,

Vladimir Lomov lomov...@gmail.com writes:

 Hello,
 as title states, commit '3142297d69f6063221215757a3ba9c74adcf3e43'
 breaks one of my Org document (I have many but faced with a bug only
 with particular one). In that file tables contain data (three columns,
 one header) which are transformed and tangle to files (xml, txt). Before
 the commit '3142297d69f6063221215757a3ba9c74adcf3e43' all works fine,
 begining with it I can't tangle files with error message
 BEGIN_EXAMPLE
   mapc: Wrong type argument: consp, nil
 END_EXAMPLE

 By means of trial-and-error I made small patch which fixes the problem
 for me. As I'm know very few in Emacs Lisp I'm not sure if my fix is
 correct, so I just added two lines without proper reindenting of whole
 block.

 BEGIN_EXAMPLE
 diff --git a/lisp/ob-core.el b/lisp/ob-core.el
 index c2722db..013646b 100644
 --- a/lisp/ob-core.el
 +++ b/lisp/ob-core.el
 @@ -2353,6 +2353,7 @@ parameters when merging lists.
  (setq vars (reverse vars))
  (while vars (setq params (cons (cons :var (cddr (pop vars))) params)))
  ;; clear out col-names and row-names for replaced variables
 +(when (and (consp :colname-names) (consp :rowname-names))
  (mapc
   (lambda (name)
 (mapc
 @@ -2365,6 +2366,7 @@ parameters when merging lists.
 params)))
   (list :colname-names :rowname-names)))
   clearnames)
 +)
  (mapc
   (lambda (hd)
 (let ((key (intern (concat : (symbol-name hd
 END_EXAMPLE


 P.S. I was lazy to prepare MWE. The mentioned document is available at
 https://github.com/vp1981/scripts/blob/master/docs/openbox/rc.org

 ---
 WBR, Vladimir Lomov

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



Re: [O] [Bug] #+call does not respect :colnames argument

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

 Eric Schulte writes:
 I've just pushed up that patch.

 …which breaks testing:

 10 unexpected results:
FAILED  ob-exp/use-case-of-reading-entry-properties
FAILED  test-ob-header-arg-defaults/global/call
FAILED  test-ob-header-arg-defaults/global/noweb
FAILED  test-ob-header-arg-defaults/tree/accumulate/call
FAILED  test-ob-header-arg-defaults/tree/accumulate/noweb
FAILED  test-ob-header-arg-defaults/tree/complex/call
FAILED  test-ob-header-arg-defaults/tree/complex/noweb
FAILED  test-ob-header-arg-defaults/tree/overwrite/call
FAILED  test-ob-header-arg-defaults/tree/overwrite/noweb
FAILED  test-ob-lob/call-with-header-arguments

 with 

 (wrong-type-argument consp nil)

 None of these tests deal with table arguments AFAICS.


I just pushed up a fix, I now only get 1 failing test locally, but it is
related to table alignment so I believe it must be unrelated to this
commit.

Best,



 Regards,
 Achim.

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



Re: [O] import R data frame into org-mode table

2013-07-29 Thread Rob Stewart
Hi Andreas,

On 17 July 2013 23:09, Andreas Leha andreas.l...@med.uni-goettingen.de wrote:

 Definitely there is:

 --8---cut here---start-8---
 #+begin_src R :results table :colnames yes
   read.csv('test.csv')
 #+end_src

 #+results:
 | X | Variant | Xaxis | N |   mean |   sd |   se |
 |---+-+---+---++--+--|
 | 1 | line1   |10 | 5 | 111.11 | 9.33 | 3.11 |
 | 1 | line1   |20 | 5 | 112.11 | 9.13 | 3.14 |
 | 1 | line1   |30 | 5 | 113.11 | 9.43 |  3.1 |
 | 1 | line2   |10 | 5 | 101.11 | 8.33 | 2.11 |
 | 1 | line2   |20 | 5 | 100.11 | 8.13 | 2.12 |
 | 1 | line2   |30 | 5 | 108.11 | 8.03 |  2.1 |

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

Great. I've gone ahead and done this. There are two additional requirements:
1) My table needs a caption. Will #+CAPTION: just above the
#+BEGIN_SRC just work? Even better, a label, allowing me to also cross
reference it.
2) My table is too long for 1 page. It spans multiple pages
vertically. According to this StackOverflow answer
http://stackoverflow.com/a/2896850/1526266 , I should instead use
longtable, not tabular. Is there a way to coerce your above snippet to
use longtable, instead of tabular which is the default.

Thanks!

--
Rob



Re: [O] import R data frame into org-mode table

2013-07-29 Thread Cook, Malcolm
Hi Andreas,
 
 On 17 July 2013 23:09, Andreas Leha andreas.l...@med.uni-goettingen.de 
 wrote:
 
  Definitely there is:
 
  --8---cut here---start-8---
  #+begin_src R :results table :colnames yes
read.csv('test.csv')
  #+end_src
 
  #+results:
  | X | Variant | Xaxis | N |   mean |   sd |   se |
  |---+-+---+---++--+--|
  | 1 | line1   |10 | 5 | 111.11 | 9.33 | 3.11 |
  | 1 | line1   |20 | 5 | 112.11 | 9.13 | 3.14 |
  | 1 | line1   |30 | 5 | 113.11 | 9.43 |  3.1 |
  | 1 | line2   |10 | 5 | 101.11 | 8.33 | 2.11 |
  | 1 | line2   |20 | 5 | 100.11 | 8.13 | 2.12 |
  | 1 | line2   |30 | 5 | 108.11 | 8.03 |  2.1 |
 
  --8---cut here---end---8---
 
 Great. I've gone ahead and done this. There are two additional requirements:
 1) My table needs a caption. Will #+CAPTION: just above the
 #+BEGIN_SRC just work? 

Yes

 Even better, a label, allowing me to also cross
 reference it.
 2) My table is too long for 1 page. It spans multiple pages
 vertically. According to this StackOverflow answer
 http://stackoverflow.com/a/2896850/1526266 , I should instead use
 longtable, not tabular. Is there a way to coerce your above snippet to
 use longtable, instead of tabular which is the default.
 

Looks like your answer is here: 
http://orgmode.org/manual/Tables-in-LaTeX-export.html

 Thanks!
 
 --
 Rob




Re: [O] import R data frame into org-mode table

2013-07-29 Thread John Hendy
On Mon, Jul 29, 2013 at 10:35 AM, Cook, Malcolm m...@stowers.org wrote:
Hi Andreas,
  
  On 17 July 2013 23:09, Andreas Leha andreas.l...@med.uni-goettingen.de 
 wrote:
  
   Definitely there is:
  
   --8---cut here---start-8---
   #+begin_src R :results table :colnames yes
 read.csv('test.csv')
   #+end_src
  
   #+results:
   | X | Variant | Xaxis | N |   mean |   sd |   se |
   |---+-+---+---++--+--|
   | 1 | line1   |10 | 5 | 111.11 | 9.33 | 3.11 |
   | 1 | line1   |20 | 5 | 112.11 | 9.13 | 3.14 |
   | 1 | line1   |30 | 5 | 113.11 | 9.43 |  3.1 |
   | 1 | line2   |10 | 5 | 101.11 | 8.33 | 2.11 |
   | 1 | line2   |20 | 5 | 100.11 | 8.13 | 2.12 |
   | 1 | line2   |30 | 5 | 108.11 | 8.03 |  2.1 |
  
   --8---cut here---end---8---
  
  Great. I've gone ahead and done this. There are two additional requirements:
  1) My table needs a caption. Will #+CAPTION: just above the
  #+BEGIN_SRC just work?

 Yes

 Even better, a label, allowing me to also cross
  reference it.
  2) My table is too long for 1 page. It spans multiple pages
  vertically. According to this StackOverflow answer
  http://stackoverflow.com/a/2896850/1526266 , I should instead use
  longtable, not tabular. Is there a way to coerce your above snippet to
  use longtable, instead of tabular which is the default.
  

 Looks like your answer is here: 
 http://orgmode.org/manual/Tables-in-LaTeX-export.html

Sort of. Depends on the Org-mode version, and someone will have to
chime in on the updated status of various parts of the manual. For 8+,
I believe the syntax is different:

#+attr_latex: :environment longtable

Also, there have been many threads in the past about how to add
#+attr_latex lines to results output (mostly graphics/files)
successfully. If you simply take the above and add =#+attr_latex:
stuff= above the =#+results= line, babel won't recognize it and will
just create a new results block. If those on this email are already
well aware of this... my apologies for being redundant, but it causes
enough confusion that I figured I'd leave another bread crumb trail :)
Here's an example of a time that came up on the list:
- http://lists.gnu.org/archive/html/emacs-orgmode/2012-07/msg00237.html

You need to use any attributes (that includes #+begin/end_center, and
any #+attr_backend lines) *in combination with* a named source block.
So the full solution should look something like this:

#+name: export-table
#+begin_src R :results table :colnames yes
read.csv('test.csv')
#+end_src

#+RESULTS: export-table
#+attr_latex: :environment longtable
| | |

I see above that =:results output org= was used. There was some
discussion about this for use with the new exporter as I wasn't
getting great results:
- https://lists.gnu.org/archive/html/emacs-orgmode/2013-03/msg01582.html
- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg69748.html

If it's working for you, don't worry about it. If not, you may find
some help in those threads. I've taken to using the ascii package for
output org-mode tables from R.
- http://orgmode.org/worg/org-contrib/babel/examples/ascii.html

Works great for me.


Good luck!
John



  Thanks!
  
  --
  Rob





Re: [O] Yet another literate programming application

2013-07-29 Thread Alan Schmitt
schulte.e...@gmail.com writes:

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

 Or rather, I should say a literate algebra and calculating application:
 http://calca.io/


 If this is appealing, it may be worth checking out the Embedded Mode
 of Emacs calc [1].  From what I can tell on the calc.io website, Emacs
 calc provides the same functionality, but Emacs calc has the benefits of
 (1) it is open source meaning you can confirm calculations and your
 answers (in my opinion a must for any peer reviewed publication), and
 (2) it may be embedded in *any* type of file.

Embedded calc mode is amazing, thanks for the link! It does not seem as
intuitive to work with equations (I've tried doing the Functions and
Solving Equations examples in calc), and there are funny results with
spaces in names. If someone knows how to do the even/odd example in
calc, please let me know. Here is what I got so far:

* Variables

#+BEGIN_SRC calc

m := 42

b := 1000

m x + b = 42 x + 1000

mass of earth := 5.972e24 kg

mass of moon := 7.34767309e22 kg

mass of earth / (mass of moon) = earth / moon

#+END_SRC

* Functions

#+BEGIN_SRC calc

eq := f = 1.8 c + 32

ceq := solve(eq, c) = c = f / 1.8 - 17.78

subst(eq, c, 20) = f = 68.

subst(ceq, f, 100) = c = 37.78

even(n) := n = 0 ? true : odd(n - 1)

odd(n) := n = 1 ? true : even(n - 1)

#+END_SRC

Thanks again for pointing me to how great calc can be,

Alan



Re: [O] Yet another literate programming application

2013-07-29 Thread Eric Schulte
Alan Schmitt alan.schm...@polytechnique.org writes:

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

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

 Or rather, I should say a literate algebra and calculating application:
 http://calca.io/


 If this is appealing, it may be worth checking out the Embedded Mode
 of Emacs calc [1].  From what I can tell on the calc.io website, Emacs
 calc provides the same functionality, but Emacs calc has the benefits of
 (1) it is open source meaning you can confirm calculations and your
 answers (in my opinion a must for any peer reviewed publication), and
 (2) it may be embedded in *any* type of file.

 Embedded calc mode is amazing, thanks for the link! It does not seem as
 intuitive to work with equations (I've tried doing the Functions and
 Solving Equations examples in calc),

Very cool, thanks for sharing.  I would note, that one nice thing about
embedded mode is that there is no need for the #+begin/end_src calc
blocks, rather the formulas may be placed directly in the Org-mode file.
So to re-write a small portion of your previous example...

#+Title: Emacs Calc Embedded Mode Examples

* Temperature Conversion (solving equations)
Conversion from Celsius to Fahrenheit involves multiplication by 1.8
and the addition of 32 as shown below.

eq := f = 1.8 c + 32

Solving for Celsius from Fahrenheit is then.

ceq := solve(eq, c) =

So, if we know that water boils at 100\deg Celsius, we can find the
boiling point of water in Fahrenheit.

subst(eq, c, 100) =

Or if we know that paper burns at 451\deg Fahrenheit, we can find the
burning point of paper in Celsius.

subst(ceq, f, 451) =

Using embedded mode is still fairly awkward for me.  I would benefit
greatly from some sort of quick reference card explaining the key
bindings and maybe an easier way to switch to/from embedded mode.

 and there are funny results with spaces in names. If someone knows how
 to do the even/odd example in calc, please let me know. Here is what I
 got so far:


I'm not clear on how the even/odd example works in calc, could you share
a link to the specific manual page you're referencing?  I've long felt
that calc would be a *very* powerful tool, if only I could climb the
learning curve.

Thanks,

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


Re: [O] [Bug] #+call does not respect :colnames argument

2013-07-29 Thread Achim Gratz
Eric Schulte writes:
 I just pushed up a fix, I now only get 1 failing test locally, but it is
 related to table alignment so I believe it must be unrelated to this
 commit.

I confirm the fix.  As to your oither test fail, it doesn't show up for
me and it most certainly shouldn't show up for you if you started the
test suite via make test-dirty.  Is that not working for you?


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

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




Re: [O] import R data frame into org-mode table

2013-07-29 Thread Nick Dokos
John Hendy jw.he...@gmail.com writes:

 On Mon, Jul 29, 2013 at 10:35 AM, Cook, Malcolm m...@stowers.org wrote:
Hi Andreas,
  
  On 17 July 2013 23:09, Andreas Leha andreas.l...@med.uni-goettingen.de 
 wrote:
  
   Definitely there is:
  
   --8---cut here---start-8---
   #+begin_src R :results table :colnames yes
 read.csv('test.csv')
   #+end_src
  
   #+results:
   | X | Variant | Xaxis | N |   mean |   sd |   se |
   |---+-+---+---++--+--|
   | 1 | line1   |10 | 5 | 111.11 | 9.33 | 3.11 |
   | 1 | line1   |20 | 5 | 112.11 | 9.13 | 3.14 |
   | 1 | line1   |30 | 5 | 113.11 | 9.43 |  3.1 |
   | 1 | line2   |10 | 5 | 101.11 | 8.33 | 2.11 |
   | 1 | line2   |20 | 5 | 100.11 | 8.13 | 2.12 |
   | 1 | line2   |30 | 5 | 108.11 | 8.03 |  2.1 |
  
   --8---cut here---end---8---
  
  Great. I've gone ahead and done this. There are two additional 
 requirements:
  1) My table needs a caption. Will #+CAPTION: just above the
  #+BEGIN_SRC just work?

 Yes

I don't think so: the caption is a property of the table, not of the
code block, so putting it before the code block does not work (at least
in my limited 8.x tests). You have to put it before the table - see
example below.


 Even better, a label, allowing me to also cross
  reference it.
  2) My table is too long for 1 page. It spans multiple pages
  vertically. According to this StackOverflow answer
  http://stackoverflow.com/a/2896850/1526266 , I should instead use
  longtable, not tabular. Is there a way to coerce your above snippet to
  use longtable, instead of tabular which is the default.
  

 Looks like your answer is here: 
 http://orgmode.org/manual/Tables-in-LaTeX-export.html

 Sort of. Depends on the Org-mode version, and someone will have to
 chime in on the updated status of various parts of the manual. For 8+,
 I believe the syntax is different:

 #+attr_latex: :environment longtable

 Also, there have been many threads in the past about how to add
 #+attr_latex lines to results output (mostly graphics/files)
 successfully. If you simply take the above and add =#+attr_latex:
 stuff= above the =#+results= line, babel won't recognize it and will
 just create a new results block. If those on this email are already
 well aware of this... my apologies for being redundant, but it causes
 enough confusion that I figured I'd leave another bread crumb trail :)
 Here's an example of a time that came up on the list:
 - http://lists.gnu.org/archive/html/emacs-orgmode/2012-07/msg00237.html


This is no longer the case: Eric S. fixed this a couple of months ago,
so that even an unlabeled #+RESULTS block will get the recomputed
results without creating a new block. The following exports fine to
latex/pdf with current org:

--8---cut here---start-8---

* foo

#+begin_src R :results table :colnames yes :exports results
  read.csv('test.csv')
#+end_src

#+NAME: foo
#+CAPTION: My table
#+ATTR_LATEX: :environment longtable
#+RESULTS:
| X | Variant | Xaxis | N |   mean |   sd |   se |
|---+-+---+---++--+--|
| 1 | line1   |10 | 5 | 111.11 | 9.33 | 3.11 |
| 1 | line1   |20 | 5 | 112.11 | 9.13 | 3.14 |
| 1 | line1   |30 | 5 | 113.11 | 9.43 |  3.1 |
| 1 | line2   |10 | 5 | 101.11 | 8.33 | 2.11 |
| 1 | line2   |20 | 5 | 100.11 | 8.13 | 2.12 |
| 1 | line2   |30 | 5 | 108.11 | 8.03 |  2.1 |


* bar

See Table \ref{foo}.
--8---cut here---end---8---

even satisfying the OP's desire for labeling the table so that the xref
will work (although there may be better methods to xref: I haven't kept
up with the recent discussions on the ML).

Of course, naming the code block should still be considered best
practice IMO.

-- 
Nick




Re: [O] [Bug] #+call does not respect :colnames argument

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

 Eric Schulte writes:
 I just pushed up a fix, I now only get 1 failing test locally, but it is
 related to table alignment so I believe it must be unrelated to this
 commit.

 I confirm the fix.  As to your oither test fail, it doesn't show up for
 me and it most certainly shouldn't show up for you if you started the
 test suite via make test-dirty.  Is that not working for you?


With make test-dirty I get all tests passing as expected.  The table
alignment error was from running the test suite interactively with the
`org-test-run-all-tests' function, so it is probably due to something
specific to my config.

Thanks,



 Regards,
 Achim.

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



Re: [O] Yet another literate programming application

2013-07-29 Thread Alan Schmitt
schulte.e...@gmail.com writes:

 Very cool, thanks for sharing.  I would note, that one nice thing about
 embedded mode is that there is no need for the #+begin/end_src calc
 blocks, rather the formulas may be placed directly in the Org-mode
 file.

Yes, but I was thinking of exporting the result to something nice, so I
wanted to tell org I was in calc mode. In fact, I'm not sure to like how
calc deals with delimiters: it's not liking the #+... if there is no
blank line. I know it's configurable, though.

 Using embedded mode is still fairly awkward for me.  I would benefit
 greatly from some sort of quick reference card explaining the key
 bindings and maybe an easier way to switch to/from embedded mode.

Yes, I basically read through the info page. The useful shortcuts I
picked were:

- C-x * u: update the formula (it's almost C-x * e C-x * e, except it
  will still work if another formula is currently in embedded mode)
- C-x * d: duplicate the formula and enter embedded calc mode
- s = in calc mode: add the nice = thingy

 I'm not clear on how the even/odd example works in calc, could you share
 a link to the specific manual page you're referencing?  I've long felt
 that calc would be a *very* powerful tool, if only I could climb the
 learning curve.

Well, it does not work as such. I don't know how to define mutually
recursive functions in calc, and that was basically my question. (But
then one may then use a real programming language at that point.) The
manual never really defines functions, and it seems that what I want to
do is rewrite things, but I cannot find a way to do it correctly.

Alan



Re: [O] import R data frame into org-mode table

2013-07-29 Thread Cook, Malcolm
-Original Message-
 From: John Hendy [mailto:jw.he...@gmail.com]
 Sent: Monday, July 29, 2013 11:03 AM
 To: Cook, Malcolm
 Cc: Rob Stewart; Andreas Leha; emacs-orgmode@gnu.org
 Subject: Re: [O] import R data frame into org-mode table
 
 On Mon, Jul 29, 2013 at 10:35 AM, Cook, Malcolm m...@stowers.org wrote:
 Hi Andreas,
   
   On 17 July 2013 23:09, Andreas Leha andreas.l...@med.uni-goettingen.de 
  wrote:
   
Definitely there is:
   
--8---cut here---start-8---
#+begin_src R :results table :colnames yes
  read.csv('test.csv')
#+end_src
   
#+results:
| X | Variant | Xaxis | N |   mean |   sd |   se |
|---+-+---+---++--+--|
| 1 | line1   |10 | 5 | 111.11 | 9.33 | 3.11 |
| 1 | line1   |20 | 5 | 112.11 | 9.13 | 3.14 |
| 1 | line1   |30 | 5 | 113.11 | 9.43 |  3.1 |
| 1 | line2   |10 | 5 | 101.11 | 8.33 | 2.11 |
| 1 | line2   |20 | 5 | 100.11 | 8.13 | 2.12 |
| 1 | line2   |30 | 5 | 108.11 | 8.03 |  2.1 |
   
--8---cut here---end---8---
   
   Great. I've gone ahead and done this. There are two additional 
  requirements:
   1) My table needs a caption. Will #+CAPTION: just above the
   #+BEGIN_SRC just work?
 
  Yes
 
  Even better, a label, allowing me to also cross
   reference it.
   2) My table is too long for 1 page. It spans multiple pages
   vertically. According to this StackOverflow answer
   http://stackoverflow.com/a/2896850/1526266 , I should instead use
   longtable, not tabular. Is there a way to coerce your above snippet to
   use longtable, instead of tabular which is the default.
   
 
  Looks like your answer is here: 
  http://orgmode.org/manual/Tables-in-LaTeX-export.html
 
 Sort of. Depends on the Org-mode version, and someone will have to
 chime in on the updated status of various parts of the manual. For 8+,
 I believe the syntax is different:
 
 #+attr_latex: :environment longtable
 
 Also, there have been many threads in the past about how to add
 #+attr_latex lines to results output (mostly graphics/files)
 successfully. If you simply take the above and add =#+attr_latex:
 stuff= above the =#+results= line, babel won't recognize it and will
 just create a new results block. If those on this email are already
 well aware of this... my apologies for being redundant, but it causes
 enough confusion that I figured I'd leave another bread crumb trail :)
 Here's an example of a time that came up on the list:
 - http://lists.gnu.org/archive/html/emacs-orgmode/2012-07/msg00237.html
 
 You need to use any attributes (that includes #+begin/end_center, and
 any #+attr_backend lines) *in combination with* a named source block.
 So the full solution should look something like this:
 
 #+name: export-table
 #+begin_src R :results table :colnames yes
 read.csv('test.csv')
 #+end_src
 
 #+RESULTS: export-table
 #+attr_latex: :environment longtable
 | | |
[Cook, Malcolm] 

Indeed, thanks, and, my worked out example follows using emacs 2.18.9 and 
org-mode version 8.0.6

#+LATEX: \listoftables  

 
#+LaTeX_HEADER: \usepackage{longtable}  

 
#+name: longtabletest   

 
#+CAPTION: test of longtable caption

 
#+begin_src R :results value :colnames yes  

 
data.frame(num=1:260,alpha=rep(LETTERS,10)) 

 
#+end_src   

 


 

[O] ox-html problem exposed by ox-S5

2013-07-29 Thread Eric Schulte
Hi,

While moving to the ox-s5 backend, which is very nice (thanks Rick), I
noticed a bug in ox-html.  The attached patch fixes this problem.

From 07d6c3d1943b2b6fe63ddc107c4c127c9b70b209 Mon Sep 17 00:00:00 2001
From: Eric Schulte schulte.e...@gmail.com
Date: Mon, 29 Jul 2013 15:19:22 -0600
Subject: [PATCH] check html-link-home exists before triming

  Ensure that the :html-link-home property exists before passing it to
  `org-trim' which assumes it's argument is a string.
---
 lisp/ox-html.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 9fc53f1..2522f63 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2598,7 +2598,8 @@ images, set it to:
 DESC is the description part of the link, or the empty string.
 INFO is a plist holding contextual information.  See
 `org-export-data'.
-  (let* ((home (org-trim (plist-get info :html-link-home)))
+  (let* ((home (when (plist-get info :html-link-home)
+		 (org-trim (plist-get info :html-link-home
 	 (use-abs-url (plist-get info :html-link-use-abs-url))
 	 (link-org-files-as-html-maybe
 	  (function
-- 
1.8.3.4


Cheers,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte
PGP fingerprint: FA8D C2C3 E8A0 A749 34CD  9DCF 3C1B 8581 614C A05D


Re: [O] import R data frame into org-mode table

2013-07-29 Thread Nick Dokos
Cook, Malcolm m...@stowers.org writes:


 Indeed, thanks, and, my worked out example follows using emacs 2.18.9 and 
 org-mode version 8.0.6


2.18.9?

 #+LATEX: \listoftables
 #+LaTeX_HEADER: \usepackage{longtable}
 #+name: longtabletest
 #+CAPTION: test of longtable caption
 #+begin_src R :results value :colnames yes
 data.frame(num=1:260,alpha=rep(LETTERS,10))
 #+end_src

 #+RESULTS:
 #+attr_latex: :environment longtable
 | num | alpha |
 |-+---|
 |   1 | A |
 |   2 | B |   
 ...

Does this really produce a table caption for you when you export to
latex? And does the attr_latex line stay there at the top of the table
when the code block is evaluated?  For me, the answers are no and
no. I have to rewrite it as follows in order for it to work:

 #+begin_src R :results value :colnames yes
 data.frame(num=1:260,alpha=rep(LETTERS,10))
 #+end_src

 #+CAPTION: test of longtable caption
 #+attr_latex: :environment longtable
 #+RESULTS:
 | num | alpha |
 |-+---|
 |   1 | A |
 |   2 | B |

-- 
Nick





Re: [O] ox-html problem exposed by ox-S5

2013-07-29 Thread Bastien
Hi Eric,

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

 While moving to the ox-s5 backend, which is very nice (thanks Rick), I
 noticed a bug in ox-html.  The attached patch fixes this problem.

applied, thanks!

-- 
 Bastien



Re: [O] Latest Org Compatible with Emacs 23.3.1

2013-07-29 Thread Nicolas Goaziou
Kenneth Jacker k...@be.cs.appstate.edu writes:

 How did you get around the missing Emacs functions (scroll-up-line and
 scroll-down-line)?  Made/included your own?  ;-)

(scroll-up-line) is the same as (scroll-up 1).


Regards,

-- 
Nicolas Goaziou



[O] [bug?][ob-core] using remove-if

2013-07-29 Thread Rasmus
Hi,

Regarding this commit:

  commit 3142297d69f6063221215757a3ba9c74adcf3e43
  Author: Eric Schulte schulte.e...@gmail.com
  Date:   Fri Jul 26 11:48:51 2013 -0600.

remove-if is introduced in ob-core.el:

(setf (cdr (assoc param params))
  (remove-if (lambda (pair) (equal (car pair) name))
 (cdr (assoc param params
(setf params (remove-if (lambda (pair) (and (equal (car pair) param)
   (null (cdr pair

I personally don't care too much if Org depends on cl, but it breaks
async export since cl is usually not loaded.

Thus, I guess it should (i) either be changed to org-remove-if or
there should be an autoload to remove-if.  I don't feel very
comfortable about messing with ob-core ob-core and I don't know if
org-remove-if is a drop-in replacement of remove-if so I havne't made
a patch.

–Rasmus

-- 
Don't panic!!!




Re: [O] [bug?][ob-core] using remove-if

2013-07-29 Thread Eric Schulte
Rasmus ras...@gmx.us writes:

 Hi,

 Regarding this commit:

   commit 3142297d69f6063221215757a3ba9c74adcf3e43
   Author: Eric Schulte schulte.e...@gmail.com
   Date:   Fri Jul 26 11:48:51 2013 -0600.

 remove-if is introduced in ob-core.el:

   (setf (cdr (assoc param params))
 (remove-if (lambda (pair) (equal (car pair) name))
(cdr (assoc param params
   (setf params (remove-if (lambda (pair) (and (equal (car pair) param)
  (null (cdr pair

 I personally don't care too much if Org depends on cl, but it breaks
 async export since cl is usually not loaded.

 Thus, I guess it should (i) either be changed to org-remove-if or
 there should be an autoload to remove-if.  I don't feel very
 comfortable about messing with ob-core ob-core and I don't know if
 org-remove-if is a drop-in replacement of remove-if so I havne't made
 a patch.

 –Rasmus

Thanks for catching this, I've just pushed up a fix.

To complain to no-one in particular for a second...

  The exclusion of the cl functions from Emacs packages including both
  functions like `remove-if', and basic macros like `flet', has one of
  two possible consequences.  Either (1) authors work around the missing
  functionality by contorting the logic of their code so as to not need
  this functionality, or (2) the function is re-implemented with a
  package specific prefix and often slightly different semantics.  I
  know I've had to do both in my own Org-mode coding, and I believe most
  major packages do both of these [1].

Best,

Footnotes: 
[1]  ,[M-x apropos remove-if RET]
 | Type RET on a type label to view its full documentation.
 | 
 | cl-remove-if
 |   Function: Remove all items satisfying PREDICATE in SEQ.
 |   Properties: autoload
 | cl-remove-if-not
 |   Function: Remove all items not satisfying PREDICATE in SEQ.
 |   Properties: autoload
 | ert--remove-if-not
 |   Function: A reimplementation of `remove-if-not'.
 | gnus-remove-if
 |   Function: Return a copy of SEQUENCE with all items satisfying
 | PREDICATE removed.
 | gnus-remove-if-not
 |   Function: Return a copy of SEQUENCE with all items not satisfying
 | PREDICATE removed.
 | org-remove-if
 |   Function: Remove everything from SEQ that fulfills PREDICATE.
 | org-remove-if-not
 |   Function: Remove everything from SEQ that does not fulfill
 | PREDICATE.
 | recentf-remove-if-non-kept
 |   Function: Remove FILENAME from the recent list, if file is not kept.
 |   Properties: byte-optimizer
 | remove-if
 |   Function: Remove all items satisfying PREDICATE in SEQ.
 | remove-if-not
 |   Function: Remove all items not satisfying PREDICATE in SEQ.
 | widget-remove-if
 |   Function: (not documented)
 `

-- 
Eric Schulte
http://cs.unm.edu/~eschulte
PGP fingerprint: FA8D C2C3 E8A0 A749 34CD  9DCF 3C1B 8581 614C A05D



Re: [O] [bug?][ob-core] using remove-if

2013-07-29 Thread Rasmus
Eric Schulte schulte.e...@gmail.com writes:

 Thanks for catching this, I've just pushed up a fix.

Thanks for the quick fix!  I'll go back to async export :)

 To complain to no-one in particular for a second...

   The exclusion of the cl functions from Emacs packages including both
   functions like `remove-if', and basic macros like `flet', has one of
   two possible consequences.  Either (1) authors work around the missing
   functionality by contorting the logic of their code so as to not need
   this functionality, or (2) the function is re-implemented with a
   package specific prefix and often slightly different semantics.  I
   know I've had to do both in my own Org-mode coding, and I believe most
   major packages do both of these [1].

It does seem a bit silly.  Wasn't work done on making cl-lib faster?
And would that get e.g. remove-if from cl-seq?

Cheers,
Rasmus

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



Re: [O] [bug?][ob-core] using remove-if

2013-07-29 Thread Aaron Ecay
There is light at the end of this tunnel: emacs 24.3 introduced the
cl-lib package, making cl functions canonically available with a ‘cl-’
prefix.  So once emacs 26 is out (and support for emacs 24.[12] is
dropped), org can use the cl- versions

cl-lib is also on GNU ELPA, so org could decide to start using it today
as long as that external dependency is properly handled.

-- 
Aaron Ecay



Re: [O] Export of property key:value

2013-07-29 Thread Edward DeMeulle
Nicolas Goaziou n.goaz...@gmail.com writes:

 You can use a hook (e.g., `org-export-before-processing-hook) to insert
 amount : {{{property(amount)}}} (or with `org-entry-get', you don't
 need the macro in that case) after each property drawer with an amount
 property.

(apologies if this is a double-post, the first didn't seem to have been sent)
Thanks for the info. I took it up as a challenge to finally learn a
little elisp. This is what I have so far, which appears to work as long
as I expand the entire subtree to be exported. I'd appreciate any
criticism since I really don't know if I'm handling things the best
possible way.

(defun ewd/export-properties (backend)
  Export all properties whose names listed in EXPORT_PROPERTIES in the format:
   - name: value after each heading of specified level
   NOTE: 1st value in EXPORT_PROPERTIES is heading level
  (if (org-entry-get (point) EXPORT_PROPERTIES)
  (let* (
 (export_properties (split-string
 (org-entry-get (point) EXPORT_PROPERTIES)  
))
 (export-level (string-to-number (car export_properties)))
 (export-list (cdr export_properties))
 )
(org-map-entries
 (lambda ()
   (next-line)
   (open-line 1)
   (dolist (prop export-list)
 (if (= export-level (car (org-heading-components)))
 (progn (insert -  prop : 
(if (org-entry-get (point) prop)
(org-entry-get (point) prop) N/A))
(newline)

(add-hook 'org-export-before-processing-hook 'ewd/export-properties)