[O] Logbook drawer entries make editing very slow

2013-02-20 Thread Marcel van der Boom
Hi,

I'm using habit-style items a lot in my 'org' routine. A typical entry
would look like this:

#+BEGIN_SRC org
*** TODO Do something daily 
SCHEDULED: 2013-02-20 wo .+1d
:LOGBOOK:
- State DONE   from TODO   [2013-02-19 di 14:01]
- State DONE   from TODO   [2013-02-17 zo 12:39]
...
[lots of entries here]
...
- State DONE   from TODO   [2010-02-25 Thu 13:51]
- State DONE   from TODO   [2010-02-10 Wed 15:19]
:END:
:PROPERTIES:
:STYLE: habit
:LAST_REPEAT: [2013-02-19 di 14:01]
:CREATED: 2011-03-25 vr 12:33
:END:
...Some description...
#+END

I have all habits in a file habits.org which is part of the
'org-agenda-files' list.

When editing entries in the habits.org file, for example changing the
header, emacs CPU using goes to 100% and every keystroke takes 5-10
seconds.  

Apparently the long list of logbook entries is making
org-mode do a lot of work.  If I remove the logbook entries from a
header, editing it becomes fast again 

I've run elp-instrument-package and the top lines in the results were:
(while entering some text in the heading)

Function name   Call Count  Elapsed Time  Average Time
--
org-self-insert-command 24  102.20533396  4.258817
org-indent-refresh-maybe96  102.19307239  1.0645111708
org-indent-add-properties   96  102.14709837  1.0640322747
org-at-item-p   49728   99.277038295  0.0019964011
org-list-in-valid-context-p 48768   98.348947434  0.0020166696
org-in-block-p  48768   98.188771636  0.0020133852
org-fix-tags-on-the-fly 24  76.427716178  3.1844881740
org-align-tags-here 24  76.427226749  3.1844677812
org-between-regexps-p   438912  74.150505545  0.0001689416
org-at-regexp-p 438912  3.2884631479  7.492...e-06
org-list-item-body-column   48768   1.3817966130  2.833...e-05
org-item-re 49728   0.1814685910  3.649...e-06
org-get-indentation 960 0.1036291090  0.0001079469

Is there anything I can do to improve performance. If possible I'd
like to keep the logbook entries in the same file as the habits.

Thanks,

marcel
-- 
Marcel van der Boom  -- http://hsdev.com/mvdb.vcf
HS-Development BV-- http://www.hsdev.com
We use bitcoin!  -- http://bitcoin.org



Re: [O] latex-export of first-column-starting emphasis broken

2013-02-20 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 16-01-13 20:50, Nick Dokos wrote:
 Marijn hk...@gentoo.org wrote:
 
 While visiting a file with just these two lines:
 
 * S /s ()/
 
 export to latex: C-c C-e p.
 
 Resulting tex file fails to compile due to the presence of:
 
 \emph{s ()\}
 
 instead of
 
 \emph{s ()}
 
 If you add a space to the beginning of the second line, then it
 works as expected. I am using this work-around for now. I'm using
 emacs-24.2

I think the problem was that I was using the org-mode that's included
with emacs-24.2 (version 6 something?). Using a more recent external
version I also cannot reproduce the problem.

Thank to you both for testing and sorry for the noise.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlEkirUACgkQp/VmCx0OL2zOWwCfXIflOHqgF4Fe4cwtWrDRtHCn
cwAAnRdRhAy79MylqKN8K58IwNW5F0+o
=XXjb
-END PGP SIGNATURE-



Re: [O] org-capture, datetree, and tags

2013-02-20 Thread Tim Burt
Jeffrey Brent McBeth mcb...@broggs.org writes:

 I'm trying to capture into a datetree using org-capture, but if my tree has a 
 tag on it (in particular noexport), then it creates a new datetree instead of 
 using the one I have.
 Example .emacs:
 (global-set-key \C-cc 'org-capture)
 (setq org-capture-templates
   '((t Test plain (file+datetree ~/Test.org)
   %^{Greeting} World
 I'm going to work this time)))

 Example Test.org:

 * 2013   
 :noexport:
 ** 2013-02 February
 *** 2013-02-19 Tuesday
 Hello World
 I'm going to work this time

 So, based on the above, if I type C-cct Silly C-cc, I'll get this:

 * 2013   
 :noexport:
 ** 2013-02 February
 *** 2013-02-19 Tuesday
 Hello World
 I'm going to work this time
 * 2013
 ** 2013-02 February
 *** 2013-02-19 Tuesday
 Silly World
 I'm going to work this time

 Thanks for your attention,
  Jeffrey McBeth

I can confirm both the behavior and a usecase for a tagged datetree.  

In org-datetree.el the function org-datetree-find-year-create searches for
the year on a headline and will not match content with anything beyond the
fourth digit.
: (defun org-datetree-find-year-create (year)
:   (let ((re ^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)$)
:   match)

In this particular case the tag in question is :noexport: with white space
fore (and maybe aft), and the following change to the regular expression
was tested with success.
: (defun org-datetree-find-year-create (year)
:   (let ((re ^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)[ \t]+:noexport:[ \t]*$)
:   match)
Of course this only matches the specific tag in this example *and* only
matches a datetree with this tag. The regular expression needs to be
improved to include a valid tag set as optional.  


-- 
Tim Burt
www.rketburt.org
It is healthful to every sane man to utter the art within him; -- GK 
Chesterton



Re: [O] org-capture, datetree, and tags

2013-02-20 Thread Jeffrey Brent McBeth
On Tue, Feb 19, 2013 at 07:25:29AM -0500, Jeffrey Brent McBeth wrote:
 I'm trying to capture into a datetree using org-capture, but if my tree has a 
 tag on it (in particular noexport), then it creates a new datetree instead of 
 using the one I have.

I have verified that this still occurs under latest (7.9.3e-920-gce79e pulled 
5:50am EST) with emacs 24.1.1 (Ubuntu packaged).  Are my expectations wrong 
that it should be inserting into the original tree, and there is perhaps 
another way to tag a heirarchy to not be exported that I should be using?  If 
this is a bug, is there additional information I need to supply to assist in 
the debugging?  Am I asking in the right place?

Thanks for your attention,
 Jeffrey McBeth

Example .emacs:
(global-set-key \C-cc 'org-capture)
(setq org-capture-templates
'((t Test plain (file+datetree ~/Test.org)
   %^{Greeting} World
   I'm going to work this time)))

Example Test.org:
* 2013 :noexport:
** 2013-02 February
*** 2013-02-19 Tuesday
Hello World
I'm going to work this time

So, based on the above, if I type C-cct Silly C-cc, I'll get this:

* 2013 :noexport:
** 2013-02 February
*** 2013-02-19 Tuesday
Hello World
I'm going to work this time
* 2013
** 2013-02 February
*** 2013-02-19 Tuesday
Silly World
I'm going to work this time



Re: [O] Showing only subprojects in the agenda

2013-02-20 Thread Bernt Hansen
Tim wiskey5al...@gmail.com writes:

 At Tue, 19 Feb 2013 18:56:13 -0500,
 Bernt Hansen wrote:
 
 Wiskey 5 Alpha wiskey5al...@gmail.com writes:
 
      I'm sure this is not as complicated as i am making it out to be, but i 
  have tried every option i can think of.
 
 You should be able to achieve what you are looking for with a custom
 agenda skip function.  I have skip functions to show (or skip) projects
 in my setup and you should be able to adapt some of that for your needs.
 
 Thanks Bernt, I guess it /is/ that complicated.  I will take a look but I
 am not much of an elisp programmer yet

 -Tim

If all of your projects are normally at level 2 will this work?

C-c a m LEVEL=2/!TODO RET

If that works then you can define an agenda as

--8---cut here---start-8---
(setq org-agenda-custom-commands
  (quote ((p Projects tags-todo LEVEL=2/!TODO
   ((org-agenda-overriding-header Projects)
(org-agenda-sorting-strategy
 '(category-keep)))
--8---cut here---end---8---

Bernt




[O] Typo in info documentation for =org-agenda-to-appt= [7.9.3e (7.9.3e-elpa @ /Users/sean/.emacs.d/elpa/org-20130204/)]

2013-02-20 Thread Allred, Sean
Pardon the copypasta, I've yet to muddle my way through configuring Gmail
and Gnus.  The 'bug' is just a documentation typo.

From: Sean Allred s...@dhcp-892bd3ca.ucd.ie
To: emacs-orgmode@gnu.org
Subject: Bug: Typo in info documentation for =org-agenda-to-appt= [7.9.3e
(7.9.3e-elpa @ /Users/sean/.emacs.d/elpa/org-20130204/)]
Date: Wed, 20 Feb 2013 12:26:01 +
Message-ID: m1bobfmasm@dhcp-892bd3ca.ucd.ie
--text follows this line--

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

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

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


Use =grep -lr If an entry as a APPT_WARNTIME *= on the directory in
which org-mode is installed.  These strings should read If an entry
/has/ a APPT_WARNTIME, etc.

Emacs  : GNU Emacs 24.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2012-08-27 on bob.porkrind.org
Package: Org-mode version 7.9.3e (7.9.3e-elpa @
/Users/sean/.emacs.d/elpa/org-20130204/)

current state:
==
(setq
 org-export-preprocess-final-hook '((lambda nil
 (replace-string  --\n  -- \n))
)
 org-export-preprocess-before-selecting-backend-code-hook
'(org-beamer-select-beamer-code)
 org-tab-first-hook '(org-hide-block-toggle-maybe
  org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook
  org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-export-preprocess-before-normalizing-links-hook
'(org-remove-file-link-modifiers)
 org-log-done 'note
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
   org-beamer-auto-fragile-frames
   org-beamer-place-default-actions-for-lists)
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-default-notes-file ~/Dropbox/org/notes.org
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook org-show-block-all
append local]
   5]
 #[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook
org-babel-show-result-all append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
  org-babel-execute-safely-maybe)
 org-directory ~/Dropbox/org
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-export-blocks '((src org-babel-exp-src-block nil)
 (export-comment org-export-blocks-format-comment t)
 (ditaa org-export-blocks-format-ditaa nil)
 (dot org-export-blocks-format-dot nil))
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-export-interblocks '((src org-babel-exp-non-block-elements))
 org-modules '(org-bbdb org-bibtex org-docview org-gnus org-info org-jsinfo
   org-habit org-irc org-mew org-mhe org-rmail org-vm org-wl
   org-w3m)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-agenda-files /Users/sean/Dropbox/.emacs.d/org-agenda-files.list
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )


-- 
Sean Allred


Re: [O] [new exporter] Guides on what incompatibilities to watch for?

2013-02-20 Thread Eric S Fraga
Gunnar Wolf gw...@gwolf.org writes:

 Hi,

 I'm not very specific in this mail, but am wondering…

 I have some nontrivial documents written in Org-mode. My main use case
 for Org is mostly to author texts, rather than using its time-tracking
 features. I fear that with the new exporter, several of my documents'
 features will no longer work or -worse- be interpretted differently,
 having a negative impact in my output.

Don't worry too much.  I had the same worry because although I do use
the time tracking (GTD) feature of org extensively, the majority of the
time I am using org is for writing.  Although there are some changes you
will need to make to your documents, the number of changes will depend
on the export target(s) and your use of figures and tables, say.  Others
in this thread have already pointed you to the docs that are available.

You don't actually say what the export target(s) you use is/are.  In my
case, most of my export to latex/pdf documents required minimal changes
and only to figure attributes basically.  My beamer slides required more
significant changes but, even here, the impact was much less dramatic
than I had expected and worried about!  And, quite importantly, the
beamer exporter is now more logical, in my opinion.

Don't panic (TM)! ;-)

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org 7.9.3e-1140-g272ca4




[O] New exporter - variable name

2013-02-20 Thread itmejl

Hi!

Switching from old to new exporter.

Using 7.9.3e and Emacs 24.2 on win7.

Question about variables and name on equivalent vaiables in new exporter.

Are there new equivalents variables for old variables
org-odt-styles-dir, org-export-odt-styles-file and those for schema-dir?

Thanks in advance and for orgmode.

/



Re: [O] New exporter - variable name

2013-02-20 Thread Suvayu Ali
On Wed, Feb 20, 2013 at 03:24:48PM +0100, itmejl wrote:
 
 Hi!
 
 Switching from old to new exporter.
 
 Using 7.9.3e and Emacs 24.2 on win7.
 
 Question about variables and name on equivalent vaiables in new exporter.
 
 Are there new equivalents variables for old variables
 org-odt-styles-dir, org-export-odt-styles-file and those for schema-dir?

http://orgmode.org/worg/org-faq.html#new-exporter-switch 

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] footnotes export verbatim

2013-02-20 Thread Nicolas Goaziou
Hello,

Samuel Wales samolog...@gmail.com writes:

 * footnotes fail
 asdfasdf.[fn::one

 two.]

Inline footnotes, like any inline object, cannot contain blank lines.


Regards,

-- 
Nicolas Goaziou



Re: [O] org-export-babel-evaluate and :exports none

2013-02-20 Thread Nicolas Goaziou
Hello,

Achim Gratz strom...@nexgo.de writes:

 Nicolas Goaziou writes:
 I confirm the problem. It is coming from
 12d592b73223f3b0628e10f0f627447b1a312203. I reverted it.

 Doesn't this throw the baby out with the bathtub?  If anything that's an
 indication that the evaluation and the exporting of a block should be
 independently controllable.  So either org-babel-exp-process-buffer is
 not the correct function to call or it needs to take
 org-export-babel-evaluate into account.

I'm just starting over because that wasn't a correct solution. I'm not
even sure about what bug this patch fixed.

Anyway, it isn't org-export-babel-evaluate's job to tell when to
evaluate a source code block. It may be org-babel-exp-process-buffer's.
I asked the author of that patch to provide more information about the
context so I can get a clue.

 BTW, the function org-export-execute-babel-code is called before it is
 being defined.  Not sure why this doesn't give a warning.

Why should it? It's not a macro, after all.


Regards,

-- 
Nicolas Goaziou



Re: [O] [PATH] [NEW EXPORTER] two slide backends for contrib

2013-02-20 Thread Bastien
Hi Rick,

Rick Frankel r...@rickster.com writes:

 Attached are:

- ox-deck.el
- ox-s5.el

 Which, respectively, provide deck.js and s5 backends for the new
 exporter. I would be happy for these to be included in contrib. Note
 that I have already signed the FSF assignment documents, so they can
 be safely included in the core if so desired.

Added to contrib/, thanks a lot!  

I modified the Copyright line to tell that the copyright is your own,
you don't need to assign copyright to the FSF for code in contrib/.

If you have time, please mention those packages in Worg:
  http://orgmode.org/worg/org-contrib/

(Just send me your public key to get push access to Worg.)

All best,

-- 
 Bastien



Re: [O] Typo in info documentation for =org-agenda-to-appt= [7.9.3e (7.9.3e-elpa @ /Users/sean/.emacs.d/elpa/org-20130204/)]

2013-02-20 Thread Bastien
Hi Sean,

Allred, Sean seall...@smcm.edu writes:

 Pardon the copypasta, I've yet to muddle my way through configuring
 Gmail and Gnus.  The 'bug' is just a documentation typo.

Fixed, thanks.

-- 
 Bastien



Re: [O] tags pdfs vs. html

2013-02-20 Thread Bastien
Hi,

m k yat...@gmail.com writes:

 I am new to org-mode. When I place a tag :New: at the end of a
 line...when I export to html, the text new is visible highlighted in
 blue. However, when I export to pdf, the text :New: is there. How can
 I make the pdf display the same formatting as the html? 

The display of the tags is different because HTML and LaTeX are
different.  There use to be `org-export-latex-tag-markup' which
told what markup to use for the LaTeX tag, we could revive it.

Nicolas, what do you think?

 Also, if I want the highlighting to be in yellow, how can I make that
 change?

In the CSS, modify the class tag.

HTH,

-- 
 Bastien



Re: [O] emphasis changes filling

2013-02-20 Thread Bastien
Samuel Wales samolog...@gmail.com writes:

 The -- is treated as if it were part of the word *but:

 ===
 that level might have a completely unrelated disease)
 -- *but we know better after you progress*.  As you get more
 ===

 Set fill column to 60.

 Without emphasis, the -- ends up at eol.

Fixed, thanks!

-- 
 Bastien



Re: [O] Small docstring update

2013-02-20 Thread Bastien
Hi Stephen,

Stephen Eglen s.j.eg...@damtp.cam.ac.uk writes:

 Attached is a suggested rewording of the docstring for
 org-agenda-prefix-format.

Applied, thanks.

-- 
 Bastien



Re: [O] [TEXINFO] Link bug

2013-02-20 Thread Jonathan Leech-Pepin
Hello,

On 16 February 2013 11:19, Thomas S. Dye t...@tsdye.com wrote:

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

  Now, both the links are broken :(
 
  This is good news: the problem is now consistent ;)
 
  Anyway, these links export fine to LaTeX, HTML and ASCII, which means
  the problem now resides in ox-texinfo.el.
 

 Thanks Nicolas.  I'll wait for Jonathan to tweak ox-texinfo.


I've applied Nicolas' patch.  From testing the ECM it fixes the issue.

Regards,

--
Jon

 All the best,
 Tom

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



Re: [O] tags pdfs vs. html

2013-02-20 Thread Nicolas Goaziou
Hello,

Bastien b...@altern.org writes:

 m k yat...@gmail.com writes:

 I am new to org-mode. When I place a tag :New: at the end of a
 line...when I export to html, the text new is visible highlighted in
 blue. However, when I export to pdf, the text :New: is there. How can
 I make the pdf display the same formatting as the html? 

 The display of the tags is different because HTML and LaTeX are
 different.  There use to be `org-export-latex-tag-markup' which
 told what markup to use for the LaTeX tag, we could revive it.

 Nicolas, what do you think?

There are already two ways to configure tags in latex back-end:
`org-latex-format-headline-function' (which is easy to use) and headline
filters.

If you think the request is common enough to justify a dedicated
variable, go ahead (or I can do it, if you don't want to). Though, as
far as I'm concerned, I'm not convinced it is useful here.


Regards,

-- 
Nicolas Goaziou



Re: [O] footnotes export verbatim

2013-02-20 Thread Samuel Wales
On 2/20/13, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Inline footnotes, like any inline object, cannot contain blank lines.

I found that they worked fine in the old exporters for HTML and ASCII.

In my view, this is a regression.

Samuel

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

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is no hope without action.



Re: [O] footnotes export verbatim

2013-02-20 Thread Nicolas Goaziou
Samuel Wales samolog...@gmail.com writes:

 On 2/20/13, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Inline footnotes, like any inline object, cannot contain blank lines.

 I found that they worked fine in the old exporters for HTML and ASCII.

 In my view, this is a regression.

But it is not.

If you look at Org documentation, you will see that:

  Paragraphs are separated by at least one empty line.

In other words: Paragraphs cannot contain an empty line. As inline
footnote references may belong to a paragraph, they cannot either.

It was merely a side-effect of the previous exporter, not an intended
feature.


Regards,

-- 
Nicolas Goaziou



Re: [O] Statistics in Org-Tables

2013-02-20 Thread JBash
Rodolfo,

I think this is what you're looking for.

http://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.html

Hope this helps.

Jerry


On Wed, Feb 20, 2013 at 11:47 AM, Rodolfo Aramayo raram...@gmail.comwrote:

 Simple question: What is the best way to configure/find out how to
 calculate Median, Standard Deviation in an org-table?
 Thanks
 --Rodolfo




Re: [O] Statistics in Org-Tables

2013-02-20 Thread Rodolfo Aramayo
Thanks Jerry, but actually I was looking for where to find definitions of:
Median
Standard Deviation, etc

If I say:

@11$13=Median@3..@10

Org-mode prints into the corresponding cell:

Median [41, 103.5, 75.5, 101, 87.5, 111.5, 116.5, 89.5]

Which is not what I want. I want the actual Median...

Thanks

--Rodolfo


On Wed, Feb 20, 2013 at 12:04 PM, JBash bashve...@gmail.com wrote:
 Rodolfo,

 I think this is what you're looking for.

 http://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.html

 Hope this helps.

 Jerry


 On Wed, Feb 20, 2013 at 11:47 AM, Rodolfo Aramayo raram...@gmail.com
 wrote:

 Simple question: What is the best way to configure/find out how to
 calculate Median, Standard Deviation in an org-table?
 Thanks
 --Rodolfo





[O] Warning with latest git pull

2013-02-20 Thread Thomas S. Dye
Aloha all,

Here is a warning I don't remember seeing before, posted here in case it
is useful information:

Compiling /Users/dk/.emacs.d/src/org-mode/lisp/org.el...

In org-current-time:
org.el:5341:16:Warning: `time-to-seconds' is an obsolete function (as of
21.1); use `float-time' instead.
org.el:5342:12:Warning: `time-to-seconds' is an obsolete function (as of
21.1); use `float-time' instead.

All the best,
Tom
-- 
T.S. Dye  Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



Re: [O] Statistics in Org-Tables

2013-02-20 Thread Nick Dokos
Rodolfo Aramayo raram...@gmail.com wrote:

 Simple question: What is the best way to configure/find out how to
 calculate Median, Standard Deviation in an org-table?

There are calc functions to compute these things, but the layout of your
table will of course influence the formulas. Here's a simple example
that calculates the statistics for the second column - it uses the
@I..@II range reference notation to get the numbers between the first
and second separators and the @ (@, @, etc.) notation to refer to
the last (last minus one, last minus two, etc.) row:

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

* mean, median, stdev

|  i | x |
|+---|
|  1 | 3 |
|  2 | 1 |
|  3 | 1 |
|  4 | 2 |
|  5 | 1 |
|  6 | 3 |
|  7 | 4 |
|  8 | 1 |
|  9 | 1 |
|+---|
|   mean | 1.889 |
| median | 1 |
|   sdev | 1.167 |
|sum |17 |
#+TBLFM: @$2=vsum(@I..@II) :: @$2=vmean(@I..@II) :: 
@$2=vmedian(@I..@II) :: @$2=vsdev(@I..@II)
--8---cut here---end---8---

More details about such references are in the Org manual:

(info (org) References)

More details about the calc functions are in the Calc manual:

(info (calc) Single-variable statistics)

Nick





Re: [O] [TEXINFO] Link bug

2013-02-20 Thread Nicolas Goaziou
t...@tsdye.com (Thomas S. Dye) writes:


 With this patch, links to TEXINFO_MENU_TITLE properties are no longer
 created.  If the problem looks difficult, I can work on an ECM.

It should be fixed. Between patch writing and its application, a change
in property syntax was introduced.


Regards,

-- 
Nicolas Goaziou



[O] need: custom agenda for last 7 days

2013-02-20 Thread Subhan Tindall
I have a question regarding a custom agenda report.  I've found the
variable org-agenda-span to set the number of days shown.  But, I
can't seem to some up with a way to make it start in the past.
IE I want to see all agenda items for today and the previous 6 days.
Also, can someone point me at a good tutorial for customized agendas
including all option variables  what they do? I can't seem to put my
fingers on one.
Thanks!
Subhan
'(org-agenda-custom-commands (quote ((w Weekly Logs agenda 
((org-agenda-span 8))


-- 
Subhan Michael Tindall | Software Developer
| s...@rentrakmail.com
RENTRAK | www.rentrak.com | NASDAQ: RENT



Re: [O] [BUG, LaTeX] LATEX_CLASS_OPTIONS don't always work

2013-02-20 Thread Nicolas Goaziou
Hello,

Michael Strey mst...@strey.biz writes:

 This is a minor issue.

 The replacement of LaTeX class options by

 #+LATEX_CLASS_OPTIONS: [ngerman]

 doesn't work if the documentclass definition in org-latex-classes
 consists of more than one line.

 I used such a definition in my Koma-script letters:

 \documentclass[%
 fontsize=11pt,%
 strey_consult,%
 c4envelope,  % optional
 ]{scrlttr2}

 For such a definition the replacement doesn't work.

 If I reduce the LaTeX expression to one line, everything is fine.

 I tracked down the issue to the regular expression in 

 (if class-options
 (replace-regexp-in-string
  ^[ \t]*documentclass\\(\\[.*?\\]\\)
  class-options header t nil 1)
  header)

 Here I gave up for today.

Thank you for the detailed report. It should be fixed.


Regards,

-- 
Nicolas Goaziou



[O] org-meta-return

2013-02-20 Thread 42 147

Invaluable command, but often I want to insert a new headline at point
that is one level down; i.e.:

*** topic_1

[COMMAND]

 subtopic

As an expansion to:

*** topic_1

M-RET

*** topic_2




Re: [O] org-meta-return

2013-02-20 Thread Suvayu Ali
On Wed, Feb 20, 2013 at 02:32:16PM -0500, 42 147 wrote:
 
 Invaluable command, but often I want to insert a new headline at point
 that is one level down; i.e.:
 
 *** topic_1
 
 [COMMAND]
 
  subtopic

M-RET M-right

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] footnotes export verbatim

2013-02-20 Thread Samuel Wales
Is there some filter I can use to get the old behavior back?

It is important to me that inline footnotes be able to do what other
footnotes do.

I will have to go back to the old version of Org.



Re: [O] footnotes export verbatim

2013-02-20 Thread Nicolas Goaziou
Samuel Wales samolog...@gmail.com writes:

 Is there some filter I can use to get the old behavior back?

No, that's impossible. You see an inline footnote where there are in
fact two paragraphs.

 It is important to me that inline footnotes be able to do what other
 footnotes do.

Note that blank lines are also impossible in other footnotes.  According
to the manual, which was effective for the previous exporter:

  The basic syntax is similar to the one used by `footnote.el', i.e.
  a footnote is defined in a paragraph that is started by a footnote
  marker in square brackets in column 0, no indentation allowed. If you
  need a paragraph break inside a footnote, use the LaTeX idiom `\par'.

Since a paragraph break is a blank line, blank lines were not allowed in
regular footnotes either.


Regards,

-- 
Nicolas Goaziou



Re: [O] footnotes export verbatim

2013-02-20 Thread Samuel Wales
On 2/20/13, Nicolas Goaziou n.goaz...@gmail.com wrote:
   The basic syntax is similar to the one used by `footnote.el', i.e.
   a footnote is defined in a paragraph that is started by a footnote
   marker in square brackets in column 0, no indentation allowed. If you
   need a paragraph break inside a footnote, use the LaTeX idiom `\par'.

I am aware of that, but blank lines were allowed after a while.  One
issue was filling.

Even \par fails to work now.  :(



Re: [O] org-meta-return

2013-02-20 Thread 42 147
 M-RET M-right

Appreciate the reply, but that's worse than what I was doing. M-right
is not anywhere close to my high frequency areas of finger activity.
I've changed all such keybindings.

I notice that C-M-RET is undefined. If anyone wants to add the
functionality as described in my original post, and bind it to that key
chord, I would be grateful; in the meantime, I'll create a macro /
interactive defun to do the same.


Re: [O] org-meta-return

2013-02-20 Thread Jonathan Leech-Pepin
Hello

On 20 February 2013 16:17, 42 147 aeus...@gmail.com wrote:

  M-RET M-right

 Appreciate the reply, but that's worse than what I was doing. M-right
 is not anywhere close to my high frequency areas of finger activity.
 I've changed all such keybindings.


You can also use TAB on an empty headline to cycle through the various
levels:
+1 level, -1 level, -2..n levels (until it reaches the top level *), and
then back
to the level it was created at.

Regards,

Jon

I notice that C-M-RET is undefined. If anyone wants to add the
 functionality as described in my original post, and bind it to that key
 chord, I would be grateful; in the meantime, I'll create a macro /
 interactive defun to do the same.




Re: [O] org-meta-return

2013-02-20 Thread Suvayu Ali
On Wed, Feb 20, 2013 at 04:17:48PM -0500, 42 147 wrote:
 
 I notice that C-M-RET is undefined. If anyone wants to add the
 functionality as described in my original post, and bind it to that key
 chord, I would be grateful; in the meantime, I'll create a macro /
 interactive defun to do the same.

Jon's suggestion is pretty good, but you can also do

  (org-defkey org-mode-map (kbd C-M-RET) 'my-interactive-defun)

where my-interactive-defun does what you want.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] [TEXINFO] Link bug

2013-02-20 Thread Thomas S. Dye
Jonathan Leech-Pepin jonathan.leechpe...@gmail.com writes:

 Hello,

 On 16 February 2013 11:19, Thomas S. Dye t...@tsdye.com wrote:

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

  Now, both the links are broken :(
 
  This is good news: the problem is now consistent ;)
 
  Anyway, these links export fine to LaTeX, HTML and ASCII, which means
  the problem now resides in ox-texinfo.el.
 

 Thanks Nicolas.  I'll wait for Jonathan to tweak ox-texinfo.


 I've applied Nicolas' patch.  From testing the ECM it fixes the issue.


With this patch, links to TEXINFO_MENU_TITLE properties are no longer
created.  If the problem looks difficult, I can work on an ECM.

All the best,
Tom

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



Re: [O] org-bullets extension

2013-02-20 Thread E Sabof
In any case, I've updated org-bullets to use compose-region. You can get it
from here:

https://github.com/sabof/org-bullets

Evgeni


On Wed, Feb 13, 2013 at 7:40 AM, E Sabof esa...@gmail.com wrote:

 I tend to agree. It might also be better to enable it by default. At the
 same time I'm not very familiar with org code base, so I'm probably not the
 best person to do it.

 Btw, the current version of org-bullets makes it possible to use a
 separate face for the bullets. It might make sense to implement that as
 well.

 Evgeni


 On Mon, Feb 11, 2013 at 5:38 PM, Bastien b...@altern.org wrote:

 E Sabof esa...@gmail.com writes:

  What is the current status of the package? Was it accepted? Was it
  superseded?

 org-bullets.el is in the contrib/ directory.

  If it wasn't superseded, I might spend some time re-implementing it.

 I think it would be nice to adapt Jambunathan's solution for Org's
 core: something like a `org-replace-leading-stars' that, when non-nil,
 would be used as the char/string for compose-region.  Then users could
 turn this on/off using #+STARTUP.

 What do you think?

 --
  Bastien





Re: [O] org-meta-return

2013-02-20 Thread Nick Dokos
42 147 aeus...@gmail.com wrote:

  M-RET M-right
 
 Appreciate the reply, but that's worse than what I was doing. M-right
 is not anywhere close to my high frequency areas of finger activity
 I've changed all such keybindings.
 

In all three keyboards I use regularly, right is fairly close to RET
(and to the right Control key): I can reach it fairly easily with my
right pinky, same as with RET - it does require a bigger stretch for
the full-size keyboards than it does on the laptop keyboard - although
I'm a sufficiently bad typist that I often have to resort to looking at
the keyboard in such situations, in which case I use my right index
finger (for RET as well as right or other arrow key).

That's not too bad because it's not as if this is a frequent activity
for me. Org's standard keymaps also use arrow keys fairly heavily, so
changing all of them sounds like a lot of work: I've tried swimming
against such tides before, but invariably I have given up exhausted,
gone back to the standard keymap and lived a much happier life.

Of course, these things are *highly* personal preferences, and you might
have a lower tolerance for pain than I have, but I have to ask: where
exactly is your right key relative to RET? How far 

 I notice that C-M-RET is undefined. If anyone wants to add the
 functionality as described in my original post, and bind it to that key
 chord, I would be grateful; in the meantime, I'll create a macro /
 interactive defun to do the same.
 

If, despite my warnings, you still want to proceed, you can do something
like this (lightly tested) - add it to the end of your .emacs:

--8---cut here---start-8---
(defun my-org-control-meta-return ()
   Assume we are in headline context: open a new headline one level
   below the current one.
   (interactive)
   (org-insert-heading)
   (org-metaright))

(defun my-org-mode-hook ()
   (define-key org-mode-map (org-key [(control meta return)]) 
'my-org-control-meta-return))

(add-hook 'org-mode-hook (function my-org-mode-hook))
--8---cut here---end---8---

Although I use some org facilities above (org-key in particular), this
is a general process which you might want to add to your arsenal of
emacs techniques:

o Define a hook (a function of no arguments) and add it to the mode's
  hook. When the mode is loaded, it runs its mode hook as the last thing
  it does.

o The hook (re)defines a key in some keymap (org-mode-map above),
  binding a function of your choosing to the key. It can of course do
  other things as well (or in place of redefining keys).

o Finally, write the function that's to be bound to the key. This is
  absolutely at your discretion: make it do whatever you want it to do
  when you press that key.

Note however that org-meta-return checks the context that it is called
from and does the Right Thing (tm). my-org-control-meta-return just
assumes it's at a headline context and proceeds blindly, e.g. if you do
C-M-RET in a table, you'll probably mess up the table.  Making it
bullet-proof is left as an exercise for the interested reader.

Read more about hooks at

 (info (emacs) Hooks)

Nick



Re: [O] org-meta-return

2013-02-20 Thread W. Greenhouse
Nick Dokos nicholas.do...@hp.com writes:

 That's not too bad because it's not as if this is a frequent activity
 for me. Org's standard keymaps also use arrow keys fairly heavily, so
 changing all of them sounds like a lot of work: I've tried swimming
 against such tides before, but invariably I have given up exhausted,
 gone back to the standard keymap and lived a much happier life.

Nick's post was a great overview of how to customize keymaps in Emacs
(and why one might not want to do so).  Just wanted to add that we have
two or three nearly complete alternate binding sets for org already:
(info (org) TTY keys) and the speed commands (listed in the variable
`org-speed-commands-default'.  The TTY keys in particular, although
lengthy, are pretty good at keeping one's hands on the keyboard (for
those of us who are serious touch typists and know what they're doing,
i.e. not myself).

-- 
Regards,
WGG




Re: [O] org-meta-return

2013-02-20 Thread 42 147
 You can also use TAB on an empty headline to cycle through the various
 levels: +1 level, -1 level, -2..n levels (until it reaches the top level
 *), and then back to the level it was created at.

Good to know, but I ended up with a simple defun and org-mode-hook. Will
probably add what you said to my arsenal, however.

My hands might be smaller than average, or, at least, smaller than yours.
To reach right I must shift my entire arm to the right and
downward. To reach RET no such movement is necessary. Maybe a slight
turn of the wrist to the right.

 Of course, these things are *highly* personal preferences, and you might
 have a lower tolerance for pain than I have, but I have to ask: where
 exactly is your right key relative to RET?

Warning, digression:

I'm ultra cautious about finger / wrist strain. Even if I feel slight
discomfort from a keybinding, I will change it to be more ergonomic and
strain-free. Practically every basic Emacs movement command has been
rebound for optimum comfort as a QWERTY typist.

Many of the default Emacs keybindings are notational, not positional. For
example, C-p and C-n. I've made them all positional. C-p / C-] are now
paired together for previous-line / next-line. C-q / C-e for
beginning-of-line / end-of-line. From a positional standpoint, C-p / C-n
makes absolutely no sense.


2013/2/20 Nick Dokos nicholas.do...@hp.com

 42 147 aeus...@gmail.com wrote:

   M-RET M-right
 
  Appreciate the reply, but that's worse than what I was doing. M-right
  is not anywhere close to my high frequency areas of finger activity
  I've changed all such keybindings.
 

 In all three keyboards I use regularly, right is fairly close to RET
 (and to the right Control key): I can reach it fairly easily with my
 right pinky, same as with RET - it does require a bigger stretch for
 the full-size keyboards than it does on the laptop keyboard - although
 I'm a sufficiently bad typist that I often have to resort to looking at
 the keyboard in such situations, in which case I use my right index
 finger (for RET as well as right or other arrow key).

 That's not too bad because it's not as if this is a frequent activity
 for me. Org's standard keymaps also use arrow keys fairly heavily, so
 changing all of them sounds like a lot of work: I've tried swimming
 against such tides before, but invariably I have given up exhausted,
 gone back to the standard keymap and lived a much happier life.

 Of course, these things are *highly* personal preferences, and you might
 have a lower tolerance for pain than I have, but I have to ask: where
 exactly is your right key relative to RET? How far

  I notice that C-M-RET is undefined. If anyone wants to add the
  functionality as described in my original post, and bind it to that key
  chord, I would be grateful; in the meantime, I'll create a macro /
  interactive defun to do the same.
 

 If, despite my warnings, you still want to proceed, you can do something
 like this (lightly tested) - add it to the end of your .emacs:

 --8---cut here---start-8---
 (defun my-org-control-meta-return ()
Assume we are in headline context: open a new headline one level
below the current one.
(interactive)
(org-insert-heading)
(org-metaright))

 (defun my-org-mode-hook ()
(define-key org-mode-map (org-key [(control meta return)])
 'my-org-control-meta-return))

 (add-hook 'org-mode-hook (function my-org-mode-hook))
 --8---cut here---end---8---

 Although I use some org facilities above (org-key in particular), this
 is a general process which you might want to add to your arsenal of
 emacs techniques:

 o Define a hook (a function of no arguments) and add it to the mode's
   hook. When the mode is loaded, it runs its mode hook as the last thing
   it does.

 o The hook (re)defines a key in some keymap (org-mode-map above),
   binding a function of your choosing to the key. It can of course do
   other things as well (or in place of redefining keys).

 o Finally, write the function that's to be bound to the key. This is
   absolutely at your discretion: make it do whatever you want it to do
   when you press that key.

 Note however that org-meta-return checks the context that it is called
 from and does the Right Thing (tm). my-org-control-meta-return just
 assumes it's at a headline context and proceeds blindly, e.g. if you do
 C-M-RET in a table, you'll probably mess up the table.  Making it
 bullet-proof is left as an exercise for the interested reader.

 Read more about hooks at

  (info (emacs) Hooks)

 Nick



Re: [O] New feature: export an agenda to an Org file

2013-02-20 Thread Robert Eckl
Bastien b...@altern.org writes:

 Hi all,

 I've committed a feature that allows you to export your agenda buffer
 to an Org file.  It will create a new file containing the headlines of
 the agenda.  The headlines do not contain any children they may have.

 Please try the feature extensively before Org 8.0.

 In an agenda buffer C-x C-w test.org RET


I'm not sure, is it intended?

Inherited Tags are not taken.

   #+begin_src org
 * Projekt XYZ :foo:
 ** TODO Action
   SCHEDULED: 2013-02-21 Do
   #+end_src

In the agenda, the tag :foo: is inherited to the TODO Action, not in the
exported file. 

Thanks,

Robert



Re: [O] org-meta-return

2013-02-20 Thread Nick Dokos
[Warning: off-topic]

42 147 aeus...@gmail.com wrote:

 My hands might be smaller than average, or, at least, smaller than yours.
 To reach right I must shift my entire arm to the right and
 downward. To reach RET no such movement is necessary. Maybe a slight
 turn of the wrist to the right.
 

I doubt my hands are bigger than yours: I have to do exactly what you
describe (at least on the bigger keyboards). It's just not as big a deal
for me as it is for you.

  Of course, these things are *highly* personal preferences, and you might
  have a lower tolerance for pain than I have, but I have to ask: where
  exactly is your right key relative to RET?
 
 Warning, digression:
 
 I'm ultra cautious about finger / wrist strain. Even if I feel slight
 discomfort from a keybinding, I will change it to be more ergonomic and
 strain-free. Practically every basic Emacs movement command has been
 rebound for optimum comfort as a QWERTY typist.
 
 Many of the default Emacs keybindings are notational, not positional. For
 example, C-p and C-n. I've made them all positional. C-p / C-] are now
 paired together for previous-line / next-line. C-q / C-e for
 beginning-of-line / end-of-line. From a positional standpoint, C-p / C-n
 makes absolutely no sense.
 

Agreed - they are only mnemonically significant. And I think you are
right in taking precautions. As I said, I'm a sufficiently bad typist
so that all these sins have not bitten me (at least not yet - and they
are rapidly running out of time).

Have you tried a Dvorak keyboard? My son uses a QWERTY keyboard, mapped
in software to Dvorak - he learnt to touch type on one by switching
all the keycaps, although he didn't need the crutch
after a while, so his second keyboard has all the keycaps in the
standard places - they just produce different characters than what the
keycaps say. This had two advantages for him: the Dvorak placement
which reduces strain (supposedly at least), and the fact that I
couldn't say to him Move over and let me drive for a while. I tried
a couple of times and I can still hear his laughter... I suspect
that unless one is an experienced Dvorak typist, it is a better security
device than many passwords :-)

I'm not sure a Dvorak keyboard would help with emacs chords though.
Another possibility is one of the funky Kinesis keyboards: a colleague
would wax ecstatic about his, but he was not an emacs user. And they
are too expensive to buy one just to try it out.

I'd be interested if somebody has tried either a Dvorak keyboard or
a Kinesis one with emacs - but this is way off-topic by now, so maybe
not.

Nick





Re: [O] [TEXINFO] Link bug

2013-02-20 Thread Thomas S. Dye
Nicolas Goaziou n.goaz...@gmail.com writes:

 t...@tsdye.com (Thomas S. Dye) writes:


 With this patch, links to TEXINFO_MENU_TITLE properties are no longer
 created.  If the problem looks difficult, I can work on an ECM.

 It should be fixed. Between patch writing and its application, a change
 in property syntax was introduced.

Yes, that works nicely.  Thanks!

All the best,
Tom
-- 
T.S. Dye  Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



Re: [O] org-meta-return

2013-02-20 Thread Suvayu Ali
On Wed, Feb 20, 2013 at 07:11:38PM -0500, Nick Dokos wrote:
 [Warning: off-topic]
 
 42 147 aeus...@gmail.com wrote:
 
  My hands might be smaller than average, or, at least, smaller than yours.
  To reach right I must shift my entire arm to the right and
  downward. To reach RET no such movement is necessary. Maybe a slight
  turn of the wrist to the right.
  
 
 I doubt my hands are bigger than yours: I have to do exactly what you
 describe (at least on the bigger keyboards). It's just not as big a deal
 for me as it is for you.

I do not see anyone mention pressing complicated key combinations with
both hands.  I usually press control or meta keys with my left, and
character or arrow keys with my right.  But maybe that is easier for me
since I use a pointing device sparingly.

-- 
Suvayu

Open source is the future. It sets us free.



[O] [texinfo] Bug(?) in detailed node listing

2013-02-20 Thread Thomas S. Dye
Aloha all,

I can't figure out how to get the detailed node listing formatted
correctly, so I want to call this a bug.  An example shows the problem:

* Hacking::How to hack your way around
* MobileOrg::  Viewing and capture on a mobile device
* History and Acknowledgments::How Org came into being

 --- The Detailed Node Listing ---

Introduction

* Summary::  Brief summary of what \
Org-mode does
* Installation:: How to install a downl\
oaded version of Org-mode

Help?

All the best,
Tom

-- 
T.S. Dye  Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



Re: [O] org-meta-return

2013-02-20 Thread Nick Dokos
Suvayu Ali fatkasuvayu+li...@gmail.com wrote:

 On Wed, Feb 20, 2013 at 07:11:38PM -0500, Nick Dokos wrote:
  [Warning: off-topic]
  
  42 147 aeus...@gmail.com wrote:
  
   My hands might be smaller than average, or, at least, smaller than yours.
   To reach right I must shift my entire arm to the right and
   downward. To reach RET no such movement is necessary. Maybe a slight
   turn of the wrist to the right.
   
  
  I doubt my hands are bigger than yours: I have to do exactly what you
  describe (at least on the bigger keyboards). It's just not as big a deal
  for me as it is for you.
 
 I do not see anyone mention pressing complicated key combinations with
 both hands.  I usually press control or meta keys with my left, and
 character or arrow keys with my right.  But maybe that is easier for me
 since I use a pointing device sparingly.
 

I hope everybody does that. I use both the left and right control keys depending
on where the controlled key is: C-whatever is always a two-hand operation for 
me.
M-x is not however (they are close enough so that left thumb and index can do 
the
job): both right and left Alt keys are mapped to meta so there is no reason it 
couldn't
be other than habit. But I probably should get out of the habit.

C-M-whatever is also a two handed operation except for C-M-x: left pinky, thumb 
and index
do the job, but again I should probably get out of that habit.

Nick





[O] Need some clever macro help

2013-02-20 Thread Thomas S. Dye
Aloha all,

I can't get the following macro to work:

- {{{kbd(/)}}} ~org-agenda-filter-by-tag~ ::

Here is its definition:

#+MACRO: markup @@info:@$1{@@$2@@info:}@@
#+MACRO: kbd {{{markup(kbd,$1)}}}

Any ideas?

All the best,
Tom
-- 
T.S. Dye  Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



Re: [O] Need some clever macro help

2013-02-20 Thread Thomas S. Dye
t...@tsdye.com (Thomas S. Dye) writes:

 Aloha all,

 I can't get the following macro to work:

 - {{{kbd(/)}}} ~org-agenda-filter-by-tag~ ::

 Here is its definition:

 #+MACRO: markup @@info:@$1{@@$2@@info:}@@
 #+MACRO: kbd {{{markup(kbd,$1)}}}


Sorry, I mean to say I can't get it to work when the argument is '/'.
The macro works otherwise.

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] `org-drill' broken in recent commits git commits

2013-02-20 Thread York Zhao
Hi Bastien,

I have figured out that I could press S-arrow to change the date when being
asked to input a date after selected '2'. I found that if I change it to a
future date I will not be asked for this question in the current drill session
because the scheduled date has been set to a future date; however, changing to a
date before the current datehas no effect. The question is why asking me to
choose a date? It was not behaving like this and I don't think there is any
changes in `org-drill', in other words, it looks like that recent changes in
`org-mode' (not `org-drill') affected the behavior of `org-drill'.

But anyways, this is no longer a big problem and it is tolerable. Thank you very
much for the help.

York


On Wed, Feb 20, 2013 at 1:11 AM, Bastien b...@altern.org wrote:
 Hi York,

 well, I did try org-drill.el to see if there was no trivial error
 triggered by a recent change in Org's master, but found none.

 Paul, can you understand/reproduce/fix York's problem?

 Best,

 --
  Bastien



[O] [PATCH 3/5] ob-R: change the file extension for tikz figures

2013-02-20 Thread Aaron Ecay
Because figures are included for export for a link, it is not desirable
to have R-generated tikz figures have the extension .tex.  Links to .tex
files should (and currently are) inserted as a hyperlink in the LaTeX
output.  Links to .tikz files should be \input so that they draw as
graphics.  (A following patch implements this functionality.)

This could also allow other backends (e.g. HTML) to compile .tikz files
to images for inclusion, while retaining links to .tex files as links.
---
 lisp/ob-R.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index 8db0853..9875f81 100644
--- a/lisp/ob-R.el
+++ b/lisp/ob-R.el
@@ -237,7 +237,7 @@ current code buffer.
 '((:bmp . bmp)
   (:jpg . jpeg)
   (:jpeg . jpeg)
-  (:tex . tikz)
+  (:tikz . tikz)
   (:tiff . tiff)
   (:png . png)
   (:svg . svg)
-- 
1.8.1.4




[O] [RFC] [PATCH] conditional use of latex packages

2013-02-20 Thread Aaron Ecay
Hello,

The current way that org handles LaTeX packages for export isn’t
optimal.  The org-latex-(default-)packages-alist variables define a set
of packages that are loaded always.  If a user wants to use advanced
functionality (booktabs for nicer table export, listings or minted for
nicer source code), s/he has to add the packages to these variables
manually.  And a package like longtables is imported into every
document, slowing down compilation even when it is not used.

The attached patches (specifically 1, 2, and 5) introduce a mechanism to
load certain packages only when needed.  It is possible to customize
these packages by specifying options to be passed to their \usepackage
(only inserted if needed to properly export the document), as well as
arbitrary code to place in the document’s preamble if the package is
used.

The other patches in the series (3, 4) fix the latex exporter’s handling
of tikz image files, as generated by R’s tikzDevice function.
Currently, a link to the file containing the graphics code is inserted.
The proper behavior is to \input the file; the source code therein is
compiled into a graph by LaTeX as it compiles the document.  (Tikz is a
very expensive latex package to load; the ability to load tikz only when
necessary motivated the optional packages mechanism.)

I think these patches need more testing, but I wanted to send them along
for feedback.  If it is not desired to change the status quo
wrt. packages like booktabs and minted (must be manually added), and
wrapfig and longtable (will always be used even if not needed), it would
be possible to accept only patches 1, 3, and 4.  (But obviously I think
the other patches are a marked improvement.)

With luck, the patches will be sent as replies to this message with git
send-email.

Thanks,
Aaron

PS I’ve sent away for the copyright assignment forms from the FSF...




[O] [PATCH 4/5] ox-latex: Treat tikz files as images

2013-02-20 Thread Aaron Ecay
Unlike other image types, they should be \input into the document –
LaTeX converts the tikz source code into the image as part of the
document’s compilation.
---
 lisp/ox-latex.el | 22 +-
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 100de1d..8027ce7 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -505,7 +505,7 @@ order to reproduce the default set-up:
   :type 'string)
 
 (defcustom org-latex-inline-image-rules
-  '((file . \\.\\(pdf\\|jpeg\\|jpg\\|png\\|ps\\|eps\\)\\'))
+  '((file . \\.\\(pdf\\|jpeg\\|jpg\\|png\\|ps\\|eps\\|tikz\\)\\'))
   Rules characterizing image files that can be inlined into LaTeX.
 
 A rule consists in an association whose key is the type of link
@@ -1797,6 +1797,7 @@ used as a communication channel.
 (path (let ((raw-path (org-element-property :path link)))
 (if (not (file-name-absolute-p raw-path)) raw-path
   (expand-file-name raw-path
+(filetype (file-name-extension path))
 (caption (org-latex--caption/label-string parent info))
 ;; Retrieve latex attributes from the element around.
 (attr (org-export-read-attribute :attr_latex parent))
@@ -1824,22 +1825,25 @@ used as a communication channel.
  ((org-string-nw-p opt) (format [%s] opt))
  ((eq float 'float) [width=0.7\\textwidth])
  ((eq float 'wrap) [width=0.48\\textwidth])
- (t )
+ (t 
+(image-code (if (equal filetype tikz)
+(format \\input{%s} path)
+  (format \\includegraphics%s{%s} options path
 ;; Return proper string, depending on FLOAT.
 (case float
   (wrap (format \\begin{wrapfigure}%s
 \\centering
-%s\\includegraphics%s{%s}
-%s\\end{wrapfigure} placement comment-include options path caption))
+%s%s
+%s\\end{wrapfigure} placement comment-include image-code caption))
   (multicolumn (format \\begin{figure*}%s
 \\centering
-%s\\includegraphics%s{%s}
-%s\\end{figure*} placement comment-include options path caption))
+%s%s
+%s\\end{figure*} placement comment-include image-code caption))
   (figure (format \\begin{figure}%s
 \\centering
-%s\\includegraphics%s{%s}
-%s\\end{figure} placement comment-include options path caption))
-  (t (format \\includegraphics%s{%s} options path)
+%s%s
+%s\\end{figure} placement comment-include image-code caption))
+  (t image-code
 
 (defun org-latex-link (link desc info)
   Transcode a LINK object from Org to LaTeX.
-- 
1.8.1.4




[O] [PATCH 1/5] ox-latex: add optional-packages machinery

2013-02-20 Thread Aaron Ecay
This code allows latex packages to be inserted into the output document
only if they are needed.  The function ‘org-latex--use-package’ is
provided for code to signal that it wants a package inserted into the
output.  The ‘org-latex-optional-packages-options-alist’ variable allows
optionally loaded packages to be customized.  It contains slots for
options to be passed to the \usepackage line, as well as arbitrary code
to be inserted into the preamble.

Code to use this mechanism is in followup patches.
---
 lisp/ox-latex.el | 57 +---
 1 file changed, 54 insertions(+), 3 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 9d5b5c5..9895028 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -418,6 +418,22 @@ toc:nil option, not to those generated with #+TOC keyword.
   :group 'org-export-latex
   :type 'boolean)
 
+(defcustom org-latex-optional-package-options-alist nil
+  An alist of options for packages which will be loaded if needed.
+
+The format is a list of triples of (PACKAGE-NAME PACKAGE-OPTIONS
+PREAMBLE-CODE).  The PACKAGE-OPTIONS will be passed as options to
+the \\usepackage command.  The PREAMBLE-CODE will be inserted in
+the preamble of the resulting document (before any LaTeX_HEADER
+lines).
+
+Either of the values may be omitted (nil).
+  :group 'org-export-latex
+  :type '(repeat
+ (list
+  (string :tag Package name)
+  (string :tag Package options)
+  (string :tag Preamble code
 
  Headline
 
@@ -1087,6 +1103,11 @@ just outside of it.
  (funcall search-refs element))
))
 
+(defun org-latex--use-package (info package)
+  (let ((optional-packages (plist-get info :latex-optional-packages)))
+(plist-put info :latex-optional-packages
+  (add-to-list 'optional-packages package
+
 
 
 ;;; Template
@@ -1110,7 +1131,8 @@ holding export options.
 (if (not class-options) header
   (replace-regexp-in-string
^[ \t]*documentclass\\(\\(\\[.*\\]\\)?\\)
-   class-options header t nil 1)
+   class-options header t nil 1
+  (optional-packages (plist-get info :latex-optional-packages)))
  (if (not document-class-string)
  (user-error Unknown LaTeX class `%s' class)
(org-latex-guess-babel-language
@@ -1118,8 +1140,13 @@ holding export options.
  (org-splice-latex-header
   document-class-string
   org-latex-default-packages-alist
-  org-latex-packages-alist nil
-  (plist-get info :latex-header-extra)))
+  (org-latex-add-optional-packages
+   optional-packages
+   org-latex-packages-alist)
+  nil
+  (org-latex-add-optional-package-preambles
+   optional-packages
+   (plist-get info :latex-header-extra
 info)
  ;; Possibly limit depth for headline numbering.
  (let ((sec-num (plist-get info :section-numbers)))
@@ -1183,6 +1210,30 @@ holding export options.
  ;; Document end.
  \\end{document})))
 
+(defun org-latex-add-optional-packages (optional-packages packages)
+  (if (not optional-packages)
+  packages
+(append packages
+   (mapcar
+(lambda (pkg)
+  (list (or (cadr (assoc pkg 
org-latex-optional-package-options-alist)) )
+pkg
+nil))
+optional-packages
+
+(defun org-latex-add-optional-package-preambles (optional-packages preamble)
+  (if (not optional-packages)
+  preamble
+(concat
+ (mapconcat
+  #'identity
+  (delq nil
+   (mapcar (lambda (pkg)
+ (nth 2 (assoc pkg 
org-latex-optional-package-options-alist)))
+   optional-packages))
+  \n)
+ \n preamble)))
+
 
 
 ;;; Transcode Functions
-- 
1.8.1.4




[O] [PATCH 5/5] ox-latex: Convert the image inclusion code to use optional packages

2013-02-20 Thread Aaron Ecay
Eliminate unconditional use of wrapfig and graphicx packages.  Also
allows loading the (large, expensive) tikz package only when tikz
graphics are present.
---
 lisp/org.el  | 2 --
 lisp/ox-latex.el | 5 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index d3506d1..4f10959 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3752,9 +3752,7 @@ header, or they will be appended.
   '((AUTO inputenc  t)
 (T1   fontenc   t)
 ( fixltx2e  nil)
-( graphicx  t)
 ( float nil)
-( wrapfig   nil)
 ( soul  t)
 ( textcomp  t)
 ( marvosym  t)
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 8027ce7..4889911 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1829,6 +1829,11 @@ used as a communication channel.
 (image-code (if (equal filetype tikz)
 (format \\input{%s} path)
   (format \\includegraphics%s{%s} options path
+(if (equal filetype tikz)
+   (org-latex--use-package info tikz)
+  (org-latex--use-package info graphicx))
+(when (eq float 'wrap)
+  (org-latex--use-package info wrapfig))
 ;; Return proper string, depending on FLOAT.
 (case float
   (wrap (format \\begin{wrapfigure}%s
-- 
1.8.1.4




[O] [PATCH 2/5] ox-latex: convert source code and table export to use optional packages

2013-02-20 Thread Aaron Ecay
This eliminates the unconditional use of longtable in
‘org-latex-default-packages-alist,’ and also allows the use of listings,
minted, and booktabs packages to be simplified (users no longer need to
add them to ‘org-latex-packages-alist’; they are automatically imported
if needed).
---
 lisp/org.el  |  1 -
 lisp/ox-latex.el | 47 +++
 2 files changed, 19 insertions(+), 29 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 1d83aa4..d3506d1 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3753,7 +3753,6 @@ header, or they will be appended.
 (T1   fontenc   t)
 ( fixltx2e  nil)
 ( graphicx  t)
-( longtable nil)
 ( float nil)
 ( wrapfig   nil)
 ( soul  t)
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 9895028..100de1d 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -569,10 +569,8 @@ When modifying this variable, it may be useful to change
 
 (defcustom org-latex-tables-booktabs nil
   When non-nil, display tables in a formal \booktabs\ style.
-This option assumes that the \booktabs\ package is properly
-loaded in the header of the document.  This value can be ignored
-locally with \:booktabs t\ and \:booktabs nil\ LaTeX
-attributes.
+This value can be ignored locally with \:booktabs t\ and
+\:booktabs nil\ LaTeX attributes.
   :group 'org-export-latex
   :type 'boolean)
 
@@ -688,29 +686,9 @@ in order to mimic default behaviour:
 
 (defcustom org-latex-listings nil
   Non-nil means export source code using the listings package.
-This package will fontify source code, possibly even with color.
-If you want to use this, you also need to make LaTeX use the
-listings package, and if you want to have color, the color
-package.  Just add these to `org-latex-packages-alist', for
-example using customize, or with something like:
-
-  \(require 'ox-latex)
-  \(add-to-list 'org-latex-packages-alist '\(\\ \listings\))
-  \(add-to-list 'org-latex-packages-alist '\(\\ \color\))
-
-Alternatively,
-
-  \(setq org-latex-listings 'minted)
-
-causes source code to be exported using the minted package as
-opposed to listings.  If you want to use minted, you need to add
-the minted package to `org-latex-packages-alist', for example
-using customize, or with
-
-  \(require 'ox-latex)
-  \(add-to-list 'org-latex-packages-alist '\(\\ \minted\))
-
-In addition, it is necessary to install pygments
+This package will fontify source code, possibly even with color,
+using the minted or listings LaTeX packages.  If you want to use
+minted, it is necessary to install pygments
 \(http://pygments.org), and to configure the variable
 `org-latex-pdf-process' so that the -shell-escape option is
 passed to pdflatex.
@@ -1621,6 +1599,7 @@ contextual information.
   (concat \\verb separator code separator))
  ;; Use minted package.
  ((eq org-latex-listings 'minted)
+  (org-latex--use-package info minted)
   (let* ((org-lang (org-element-property :language inline-src-block))
 (mint-lang (or (cadr (assq (intern org-lang)
org-latex-minted-langs))
@@ -1633,6 +1612,8 @@ contextual information.
separator code separator)))
  ;; Use listings package.
  (t
+  (org-latex--use-package info listings)
+  (org-latex--use-package info color)
   ;; Maybe translate language's name.
   (let* ((org-lang (org-element-property :language inline-src-block))
 (lst-lang (or (cadr (assq (intern org-lang)
@@ -2169,6 +2150,7 @@ contextual information.
   custom-env))
;; Case 3.  Use minted package.
((eq org-latex-listings 'minted)
+   (org-latex--use-package info minted)
(let ((float-env
   (when (or label caption)
 (format \\begin{listing}[H]\n%%s\n%s\\end{listing}
@@ -2208,6 +2190,8 @@ contextual information.
  (if float-env (format float-env body) body)))
;; Case 4.  Use listings package.
(t
+   (org-latex--use-package info listings)
+   (org-latex--use-package info color)
(let ((lst-lang
   (or (cadr (assq (intern lang) org-latex-listings-langs)) lang))
  (caption-str
@@ -2436,7 +2420,14 @@ This function assumes TABLE has `org' as its `:type' 
property and
 (placement (or (plist-get attr :placement)
(format [%s] org-latex-default-figure-position)))
 (centerp (if (plist-member attr :center) (plist-get attr :center)
-   org-latex-tables-centered)))
+   org-latex-tables-centered))
+(booktabsp (if (plist-member attr :booktabs)
+ (plist-get attr :booktabs)
+   org-latex-tables-booktabs)))
+(when (equal longtable table-env)
+  (org-latex--use-package info longtable))
+(when booktabsp
+  (org-latex--use-package info booktabs))
 ;; Prepare the