Re: [O] Question re. Bernt's agenda setup

2012-11-16 Thread Alan Schmitt
Viktor Rosenfeld listuse...@gmail.com writes:

 Hi Manish,

 it's Shift-P and you need to bind the function bh/narrow-to-project to
 the keycode. See the code blocks in the following two sections:

 http://doc.norang.ca/org-mode.html#SpeedCommands
 http://doc.norang.ca/org-mode.html#NarrowToSubtree

I managed to make this work, but if I run the command in the agenda I
need to refresh it afterwards (using 'g'). Are you seeing the same
thing?

And I also want to say I have learned a lot implementing the suggestions
in that document.

Alan



Re: [O] Bug: Generation of pdf when using OPTIONS: H: faulty [7.9.2 (release_7.9.2-588-g8fb2cb @ /home/rkrug/.emacs.d/org-mode/lisp/)]

2012-11-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi

Can somebody please confirm if this is a bug or caused by my setup?

Thanks,

Rainer

On 15/11/12 15:03, Rainer M Krug wrote:
 Hi
 
 When exporting the tree below (Linear Mixed Effect Models) as pdf, the some 
 headers are omitted
 when OPTIONS: H: is used. When this option is removed, the export is fine, 
 but as expected the
 fourth level headers are converted to lists, but I would like to have them as 
 headers in the 
 toc. This worked in earlier versions of org, but unfortunately I can not tell 
 you when it
 changed.
 
 I attach the org file, tex and pdf
 
 Cheers,
 
 Rainer
 
 
 #+OPTIONS: toc:5 #+OPTIONS: H:5
 
 * Linear Mixed Effect Models Load the package nlme #+begin_src R # #+end_src
 
 ** Brunia laevis *** Height Clean old =dat.*= objects out #+begin_src R # 
 #+end_src
 
  Define the default models #+begin_src R # #+end_src
 
  Fit a linear model as a baseline #+begin_src R # #+end_src
 
  Fit the lme for different random effects random intercept and slope 
 #+begin_src R # 
 #+end_src
 
 only random intercept #+begin_src R # #+end_src
 
 
 
 Emacs  : GNU Emacs 24.2.1 (i686-pc-linux-gnu, GTK+ Version 2.24.13) of 
 2012-11-06 on dubnium,
 modified by Debian Package: Org-mode version 7.9.2 (release_7.9.2-588-g8fb2cb 
 @
 /home/rkrug/.emacs.d/org-mode/lisp/)
 
 current state: == (setq org-ctrl-c-ctrl-c-hook 
 '(org-babel-hash-at-point
 org-babel-execute-safely-maybe) org-export-latex-packages-alist '(( color 
 t) ( listings
 t)) org-src-fontify-natively t org-plantuml-jar-path 
 /home/rkrug/jar/plantuml.jar 
 org-export-kill-product-buffer-when-displayed t org-export-with-drawers nil 
 org-ellipsis ? ?
 ? org-export-with-tags 'not-in-toc 
 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-cycle-hook '(org-cycle-hide-archived-subtrees
 org-cycle-hide-drawers org-cycle-hide-inline-tasks org-cycle-show-empty-lines 
 org-optimize-window-after-visibility-change) org-agenda-before-write-hook
 '(org-agenda-add-entry-text) org-confirm-babel-evaluate nil 
 org-speed-command-hook
 '(org-speed-command-default-hook org-babel-speed-command-hook) 
 org-src-window-setup
 'current-window org-babel-pre-tangle-hook '(save-buffer) org-occur-hook
 '(org-first-headline-recenter) org-structure-template-alist '((lua 
 #+begin_src lua \n
 ?\n#+end_src src lang=\lua\\n\n/src) (r #+begin_src R 
 ?\n\n#+end_src src
 lang=\R\\n\n/src) (s #+BEGIN_SRC ?\n\n#+END_SRC src 
 lang=\?\\n\n/src) (e
 #+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE example\n?\n/example) (q
 #+BEGIN_QUOTE\n?\n#+END_QUOTE quote\n?\n/quote) (v 
 #+BEGIN_VERSE\n?\n#+END_VERSE
 verse\n?\n/verse) (c #+BEGIN_CENTER\n?\n#+END_CENTER 
 center\n?\n/center) (l
 #+BEGIN_LaTeX\n?\n#+END_LaTeX literal style=\latex\\n?\n/literal) 
 (L #+LaTeX: 
 literal style=\latex\?/literal) (h #+BEGIN_HTML\n?\n#+END_HTML 
 literal
 style=\html\\n?\n/literal) (H #+HTML:  literal 
 style=\html\?/literal) (a
 #+BEGIN_ASCII\n?\n#+END_ASCII) (A #+ASCII: ) (i #+INDEX: ? 
 #+INDEX: ?) (I
 #+INCLUDE: %file ? include file=%file markup=\?\)) org-metaup-hook
 '(org-babel-load-in-session-maybe) org-confirm-elisp-link-function 
 'yes-or-no-p 
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default 
 org-hide-leading-stars t org-capture-templates '((p Problem to be logged 
 in buffer entry 
 (file+headline (buffer-file-name) QUESTIONS) * %?\n- revision :: 
 %(symbol-name
 (vc-working-revision (buffer-file-name (org-capture-get 
 :original-buffer\n- state::
 %(symbol-name (vc-state (buffer-file-name (org-capture-get 
 :original-buffer\n- link ::
 %a \n- author   :: Rainer M Krug, email: rai...@krugs.de) (c Changes to 
 be logged in
 buffer entry (file+headline (buffer-file-name) CHANGES) * %T %? \n- 
 revision ::
 %(symbol-name (vc-working-revision (buffer-file-name (org-capture-get 
 :original-buffer\n-
 state:: %(symbol-name (vc-state (buffer-file-name (org-capture-get 
 :original-buffer\n-
 link :: %a \n- author   :: Rainer M Krug, email: rai...@krugs.de %n) 
 (t TODO to be
 logged in buffer entry (file+headline (buffer-file-name) TODOs) * TODO 
 %?\n- revision ::
 %(symbol-name (vc-working-revision (buffer-file-name (org-capture-get 
 :original-buffer\n-
 state:: %(symbol-name (vc-state (buffer-file-name (org-capture-get 
 :original-buffer\n-
 link :: %a \n- author   :: Rainer M Krug, email: rai...@krugs.de) (T 
 Todo to be logged
 in Notes.org entry (file+headline (concat org-directory /Notes.org) 
 Tasks) * TODO %?\n
 %i\n %T\n %a) (M Misc to be logged in Notes.org entry (file+headline 
 (concat org-directory
 /Notes.org) Misc) * %?\n  %i\n %T\n  %a) (I Info to be logged in 
 Notes.org entry 
 (file+headline (concat org-directory /Notes.org) Information) * %?\n  
 %i\n 

[O] [PATCH] Change fontification order for links

2012-11-16 Thread Christophe Junke
* lisp/org.el (org-set-font-lock-defaults): let footnote fontifications
  be done before other links' fontification. This allows links appearing
  inside footnotes to be both visible and active.

TINYCHANGE
---
 lisp/org.el |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index cfd8651..15b73aa 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5901,13 +5901,13 @@ needs to be inserted at a specific position in the 
font-lock sequence.)
 '(1 'org-special-keyword t)
 '(3 'org-property-value t))
   ;; Links
+  (if (memq 'footnote lk) '(org-activate-footnote-links))
   (if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend)))
   (if (memq 'angle lk) '(org-activate-angle-links (0 'org-link t)))
   (if (memq 'plain lk) '(org-activate-plain-links))
   (if (memq 'bracket lk) '(org-activate-bracket-links (0 'org-link t)))
   (if (memq 'radio lk) '(org-activate-target-links (0 'org-link t)))
   (if (memq 'date lk) '(org-activate-dates (0 'org-date t)))
-  (if (memq 'footnote lk) '(org-activate-footnote-links))
   '(^?%%(.*\\|%%([^\n]*? (0 'org-sexp-date t))
   '(org-hide-wide-columns (0 nil append))
   ;; TODO keyword
--
1.7.9.5



Re: [O] Question re. Bernt's agenda setup

2012-11-16 Thread Viktor Rosenfeld
Alan Schmitt wrote:

 Viktor Rosenfeld listuse...@gmail.com writes:
 
  Hi Manish,
 
  it's Shift-P and you need to bind the function bh/narrow-to-project to
  the keycode. See the code blocks in the following two sections:
 
  http://doc.norang.ca/org-mode.html#SpeedCommands
  http://doc.norang.ca/org-mode.html#NarrowToSubtree
 
 I managed to make this work, but if I run the command in the agenda I
 need to refresh it afterwards (using 'g'). Are you seeing the same
 thing?

Yes, unfortunately. I think I remember that it used to refresh the
agenda automatically. This is above my pay grade, I'm afraid.

Cheers,
Viktor

 
 And I also want to say I have learned a lot implementing the suggestions
 in that document.
 
 Alan
 



[O] sum up variables from different org-mode tables

2012-11-16 Thread Martin Gross
Dear helpers,

I have a big file where I enter incomings and outgoings of book
exchanges with different institutions:

* Institution A
  |   | In  |  # |   € | Out |  # |   € |
  |---+-++-+-++-|
  |   | Title P |  1 |  45 | Title A |  1 |  15 |
  |   | || | Title B |  2 |  28 |
  |---+-++-+-++-|
  | # | |  1 |  45 | |  3 |  43 |
  | ^ | | TE | TEE | | TA | TAE |
  #+TBLFM: 
$TE=vsum(@I..@II)::$TEE=vsum(@I..@II)::$TA=vsum(@I..@II)::$TAE=vsum(@I..@II)

* Institution B
  |   | In | #  |  €   | Out | #   | €   |
  ...
  | # ||  1 |  24  | |  2  | 31  |
  | ^ || TE | TEE  | | TA  | TAE |

Now I would like to get some statistics that consider all institutions
together.  For example summing up the variable TAE from all the
tables in the file to get the very total cost of outgoings.

Is something like that possible?

Thank you very much in advance!

Martin



Re: [O] Question re. Bernt's agenda setup

2012-11-16 Thread Manish
   Hello Bernt and others,
  
   I was picking up tips from Bernt's awesome and famous document at
   http://doc.norang.ca/org-mode.html.  In section 7.1, just between
   the two screenshots, I came across following text:
  
   ,[ excerpt from section 7.1 ]
   | After selecting a project (with P on any task in the agenda) the
   | block agenda changes to show the project and any subprojects in
   | the Projects section. Tasks show project-related tasks that are
   | hidden when not narrowed to a project.
   `
  
   The feature/concept seems very useful to be able to zoom into a
   project of interest but I could't figure out how =P= helps with
   this since it seems to move to previous item while in the ageda
   view.
  
   Can someone (or Bernt) using the setup point me to right direction
   please?

  On Fri, Nov 16, 2012 at 3:12 AM, Viktor Rosenfeld wrote:
   Hi Manish,
  
   it's Shift-P and you need to bind the function bh/narrow-to-project
   to the keycode. See the code blocks in the following two sections:
  
   http://doc.norang.ca/org-mode.html#SpeedCommands
   http://doc.norang.ca/org-mode.html#NarrowToSubtree
  

Thank you!  I should learn to read better, I guess.  By any chance,
would you also know if all the configuration is available in one place,
perhaps a git repo (it's not in org-mode-doc repo) or perhaps a way to
pick out all #+begin_src parts from the .org version?

Cheers,
Manish



Re: [O] Issue when jumping from agenda view to clock line

2012-11-16 Thread Francesco Pizzolante
Hi,

 Here's a small example.

 #+begin_src org
 * My tasks

 ** First task
:LOGBOOK:
CLOCK: [2012-10-22 Mon 13:00]--[2012-10-22 Mon 14:30] =  1:00
CLOCK: [2012-10-23 Tue 13:00]--[2012-10-23 Tue 14:30] =  1:00
CLOCK: [2012-10-24 Wed 13:00]--[2012-10-24 Wed 14:30] =  1:00
:END:
 #+end_src

 In the agenda view (C-c a a) for Wed 24, enable the check view (v c), then
 press ENTER on the log line for First task, you jump to the corresponding
 heading (First task) but it positions the cursor just after the :LOGBOOK:
 keyword and the drawer remains closed.

Just to let you know that I found the issue...

It was coming from the following code I was using (taken from Worg:
http://orgmode.org/worg/org-configs/org-hooks.html):

╭
│   ;; get a compact view during follow mode in the agenda
│ (defun my-compact-follow ()
│   Make the view compact, then show the necessary minimum.
│   (ignore-errors
│ (save-excursion
│   (while (org-up-heading-safe))
│   (hide-subtree)))
│   (let ((org-show-siblings nil)
│ (org-show-hierarchy-above t))
│ (org-reveal))
│   (save-excursion
│ (org-back-to-heading t)
│ (show-children)))
│
│(add-hook 'org-agenda-after-show-hook 'my-compact-follow)
╰

But I don't understand the cause of it.

Thanks,
 Francesco



Re: [O] Question re. Bernt's agenda setup

2012-11-16 Thread Memnon Anon
Manish mailtomanish.sha...@gmail.com writes:

 a way to
 pick out all #+begin_src parts from the .org version?

(org-babel-tangle optional ONLY-THIS-BLOCK TARGET-FILE LANG),
bound to `C-c C-v t' by default.
Not all emacs-lisp blocks are set to :tangle yes, though.

Or use a quick Keyboard macro (info (emacs)Keyboard Macros) .









Re: [O] Bug: Generation of pdf when using OPTIONS: H: faulty [7.9.2 (release_7.9.2-588-g8fb2cb @ /home/rkrug/.emacs.d/org-mode/lisp/)]

2012-11-16 Thread Nicolas Goaziou
Hello,

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

 Can somebody please confirm if this is a bug or caused by my setup?

I'm not sure to understand the problem you seem to encounter. The
generated tex file looks fine. What did you expect in the tex file that
would be missing?


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Generation of pdf when using OPTIONS: H: faulty [7.9.2 (release_7.9.2-588-g8fb2cb @ /home/rkrug/.emacs.d/org-mode/lisp/)]

2012-11-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 16/11/12 15:27, Nicolas Goaziou wrote:
 Hello,
 
 Rainer M Krug r.m.k...@gmail.com writes:
 
 Can somebody please confirm if this is a bug or caused by my setup?
 
 I'm not sure to understand the problem you seem to encounter. The generated 
 tex file looks
 fine. What did you expect in the tex file that would be missing?

Thanks for checking.

in the pdf:

 Fit a linear model as a baseline
is missing


random intercept and slope
is behind ... random effects

The tex file looks fine, but the pdf is missing these.

I just tried it again with manually running the file against pdflatex and it is 
missing as well.
No idea what is wrong in the tex file, as I am just a basic LaTeX user.

Cheers,

Rainer

 
 
 Regards,
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCmUTgACgkQoYgNqgF2egof4gCgiunvbbXEKTeGl5iGER+J725y
npkAoIS59jphvLfRHkKp16D/aDfJg5Qe
=yAYT
-END PGP SIGNATURE-



Re: [O] [PATCH] Separate clocksum format for durations = 1 day

2012-11-16 Thread Toby Cubitt
On Wed, Nov 14, 2012 at 05:20:14PM +0100, Toby Cubitt wrote:
 On Wed, Nov 14, 2012 at 05:09:38PM +0100, Nicolas Goaziou wrote:
  Toby Cubitt ts...@cantab.net writes:
  
   I can easily allow org-time-clocksum-fractional-format to be a list of
   formats. But 1d 3.4h doesn't seem very useful to me. Probably it should
   work a bit differently: format the time as a fractional quantity, using
   the largest time unit which will give a non-zero integer part.
  
   Does that sound reasonable?
  
  That's the idea, yes. Though, it will be the largest time unit _with
  a format string_ which will give a non-zero integer part.
 
 Yes, that's what I meant.
 
   OK, but in this case I think the single-format-string option is still
   useful. It gives users a simpler way of customizing the format if they
   don't want to do anything fancy.
  
  If they don't want to do anything fancy, they use the default value,
  whatever it may be. ;) I don't mind keeping the single format string
  option anyway.
 
 I'll leave it in my patch. If you want to remove it for 8.0, it'll be a
 simple case of deleting some code.
 
   I'll post an updated patch when I get time to make the changes.
  
  Since it's for 8.0, there's no hurry. I'll wait for you to merge the two
  patches and make subsequent changes.

Here's an updated patch. Now both org-time-clocksum-format and
org-time-clocksum-fractional-format can be plists, as discussed.

In the org-time-clocksum-format case, I made the values cons cells which
specify both a format string and a boolean. The latter indicates whether
the time component should always be included in the formatted duration,
even if its value is 0. This is needed for the hours component to
reproduce the current default format, and I figured I might as well make
it general.

I used a somewhat complex customization type in the defcustoms, instead
of a straight plist, in order to produce a better ui for the
customization interface. I'm still not completely satisfied with it.
E.g. it would be nice to get rid of the Cons cell tag entirely, and use
a checkbox for the boolean. But I can't figure out how to do that
(without defining new customization types/widgets, which I don't have the
patience for).

Toby
-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: ts...@cantab.net
web:   www.dr-qubit.org
From 639baf9c942df97e7355f402a9df38e6c9b6ef88 Mon Sep 17 00:00:00 2001
From: Toby S. Cubitt ts...@cantab.net
Date: Sun, 11 Nov 2012 22:20:24 +
Subject: [PATCH] Allow more flexible customization of clocksum format

* lisp/org.el (org-time-clocksum-format, org-time-clocksum-fractional-format):
in addition to a single format string, the clocksum formats can now be
plists specifying separate formats for different time units.

* lisp/org.el (org-minutes-to-clocksum-string): new function to
replace org-minutes-to-hh:mm-string, which converts a number of
minutes to a string according to the customization options.

* lisp/org-colview.el (org-columns-number-to-string): use new
org-minutes-to-clocksum-string function to format clocksum durations.

* lisp/org-clock.el: always call new org-minutes-to-clocksum-string
function when formatting time durations, instead of calling
org-minutes-to-hh:mm-string or passing org-time-clocksum-format
directly to format.
---
 lisp/org-clock.el   |   51 +--
 lisp/org-colview.el |3 +-
 lisp/org.el |  175 +++---
 3 files changed, 183 insertions(+), 46 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 84eb2fd..c768491 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -556,28 +556,23 @@ pointing to it.
 If an effort estimate was defined for the current item, use
 01:30/01:50 format (clocked/estimated).
 If not, show simply the clocked time like 01:50.
-  (let* ((clocked-time (org-clock-get-clocked-time))
-	 (h (floor clocked-time 60))
-	 (m (- clocked-time (* 60 h
+  (let ((clocked-time (org-clock-get-clocked-time)))
 (if org-clock-effort
 	(let* ((effort-in-minutes
 		(org-duration-string-to-minutes org-clock-effort))
-	   (effort-h (floor effort-in-minutes 60))
-	   (effort-m (- effort-in-minutes (* effort-h 60)))
 	   (work-done-str
 		(org-propertize
-		 (format org-time-clocksum-format h m)
+		 (org-minutes-to-clocksum-string clocked-time)
 		 'face (if (and org-clock-task-overrun (not org-clock-task-overrun-text))
 			   'org-mode-line-clock-overrun 'org-mode-line-clock)))
-	   (effort-str (format org-time-clocksum-format effort-h effort-m))
+	   (effort-str (org-minutes-to-clocksum-string effort-in-minutes))
 	   (clockstr (org-propertize
 			  (concat   [%s/ effort-str
    ] ( (replace-regexp-in-string % %% org-clock-heading) ))
 			  'face 'org-mode-line-clock)))
 	  (format clockstr work-done-str))
-  (org-propertize (format
-		   (concat [ org-time-clocksum-format  

Re: [O] sum up variables from different org-mode tables

2012-11-16 Thread Michael Brand
Hi Martin

On Fri, Nov 16, 2012 at 12:33 PM, Martin Gross m-gr...@gmx.net wrote:
 Now I would like to get some statistics that consider all institutions
 together.  For example summing up the variable TAE from all the
 tables in the file to get the very total cost of outgoings.

Below are two approaches to achieve this. For future development I
would like to point out two things:

1) Assignment of empty field: I think that, generally and not only for
   your example, some existing or future format specifier should take
   care to not fill the destination cell with 0 when the source cell
   is empty. The format specifiers E and L how they work now do not
   help in this case. Sometimes I use a workaround like
   $3 = if($1  $2, $1 + $2, string())
   which works only for non-zero numbers.

2) Indirection of remote table name: Although there is a very nice
   formula editor C-c ' (org-table-edit-formulas) which helps a lot in
   this case, in both variants editing of the total formula scales
   badly with the number of tables. A nice solution for variant 2
   would be if
   @2$3..@2$7 = remote(A, @$$#) :: @3$3..@3$7 = remote(B, @$$#)
   could be simplified to
   @I$3..@II$7 = remote($8, @$$#)

Your example with the two approaches:

* Institution A
  #+TBLNAME: A
  |   | In  |  # |   € | Out |  # |   € |
  |---+-++-+-++-|
  |   | Title P |  1 |  45 | Title A |  1 |  15 |
  |   | || | Title B |  2 |  28 |
  |---+-++-+-++-|
  | # | |  1 |  45 | |  3 |  43 |
  | ^ | | TE | TEE | | TA | TAE |
  #+TBLFM: 
$TE=vsum(@I..@II)::$TEE=vsum(@I..@II)::$TA=vsum(@I..@II)::$TAE=vsum(@I..@II)

* Institution B
  #+TBLNAME: B
  |   | In  |  # |   € | Out |  # |   € |
  |---+-++-+-++-|
  |   | Title Q |  1 |  24 | Title C |  2 |  31 |
  |---+-++-+-++-|
  | # | |  1 |  24 | |  2 |  31 |
  | ^ | | TE | TEE | | TA | TAE |
  #+TBLFM: 
$TE=vsum(@I..@II)::$TEE=vsum(@I..@II)::$TA=vsum(@I..@II)::$TAE=vsum(@I..@II)

* total variant 1
  |   | In | #  | €   | Out | #  | €   |
  |---+++-+-++-|
  | # || 2  | 69  | | 5  | 74  |
  | ^ || TE | TEE | | TA | TAE |
  #+TBLFM: $TE = remote(A, $TE) + remote(B, $TE) :: $TEE = remote(A,
$TEE) + remote(B, $TEE) :: $TA = remote(A, $TA) + remote(B, $TA) ::
$TAE = remote(A, $TAE) + remote(B, $TAE)

* total variant 2
  |   | In |  # |   € | Out |  # |   € | institution |
  |---+++-+-++-+-|
  |   ||  1 |  45 |   0 |  3 |  43 | A   |
  |   ||  1 |  24 |   0 |  2 |  31 | B   |
  |---+++-+-++-+-|
  | # ||  2 |  69 | |  5 |  74 | |
  | ^ || TE | TEE | | TA | TAE | |
  #+TBLFM: @2$3..@2$7 = remote(A, @$$#) :: @3$3..@3$7 = remote(B,
@$$#) :: $TE=vsum(@I..@II) :: $TEE=vsum(@I..@II) ::
$TA=vsum(@I..@II) :: $TAE=vsum(@I..@II)

“$$#”: the first “$” is for “column” and “$#” is for the number of the
current column to copy a row column by column, just like the
equivalent “@@#” mentioned in “3.5.1 References in the manual.

Michael



[O] subtree-export limitations

2012-11-16 Thread Philipp Kroos

Hi,

currently the support for subtree export is somewhat limited due to the
fact that individual EXPORT_* options are allowed only once.
I.e., in the following the second latex-header-property will be ignored:

* Some subtree
  :PROPERTIES:
  :LATEX_CLASS: scrartcl
  :EXPORT_OPTIONS: toc:nil
  :EXPORT_LATEX_HEADER: \usepackage[ngerman]{babel}
  :EXPORT_LATEX_HEADER: \usepackage{xcolor}
  :END:

So would be any other EXPORT_OPTIONS-line. The responsible function is
org-export--get-subtree-options, which builds a list of already seen
keywords. The lists members are then ignored if seen again.
Is there any particular reason why this is done?

Sorry if this is documented or discussed somewhere already, I couldn't
find any reference that explains this behaviour.

Best regards,
Philipp



Re: [O] subtree-export limitations

2012-11-16 Thread Alan Schmitt
Philipp Kroos philipp.kr...@t-online.de writes:

 currently the support for subtree export is somewhat limited due to the
 fact that individual EXPORT_* options are allowed only once.
 I.e., in the following the second latex-header-property will be ignored:

 * Some subtree
   :PROPERTIES:
   :LATEX_CLASS: scrartcl
   :EXPORT_OPTIONS: toc:nil
   :EXPORT_LATEX_HEADER: \usepackage[ngerman]{babel}
   :EXPORT_LATEX_HEADER: \usepackage{xcolor}
   :END:

We discussed this recently. A simple workaround is to create a new
export class with the headers you need. Another workaround is to put all
the headres in a very long line.

Alan



Re: [O] Literate programming of interactive proofs?

2012-11-16 Thread Eric Schulte
Alan Schmitt alan.schm...@polytechnique.org writes:

 Hello,

 I want to use org-mode to write a paper about a development in Coq. Coq
 is an interactive proof system, which can be run (among other ways)
 interactively through emacs. The interactive part is very important, as
 doing or maintaining proofs often requires exploring many different
 direction.

 I'm wondering if it's still possible to use org-mode to write such a
 paper.

Yes, this is possible.  See here [1] for a paper demonstrating the use
of Org-mode to support both literate programming and reproducible
research.

 I see two ways of doing it: - either be able to interactively interact
 with Coq from org-mode - or write the development separately, and have
 a way to include parts of the file (for instance identified by special
 markers in some comments) into the final paper.

 Is any of this possible?

Either will be possible with a little bit of work.

In either case I think you will want to implement Org-mode code block
support (see [2]) for Coq.  Code blocks allow Org-mode to interact with
external processes and programming languages, and can be used for simple
things like running external shell commands or more complex cases like
interacting with a persistent R process through ESS.  Interactive use of
code blocks are called sessions in the Org-mode documentation.

Assuming that there exists (or can be easily written) a function which
passes commands to the Coq process and returns results, e.g., something
that would be used to drive an interactive Coq console, lets call this
function `coq-eval' for the purpose of this email.  Then the following
elisp snippet would be sufficient to provide minimal Coq code block
support.

(defun org-babel-execute:coq (body params)
  (coq-eval body))

If you do end up writing any level of support for Coq code blocks please
consider contributing it to Org-mode.

Hope this helps,

 The second option would probably require some custom code, but I don't
 know if it would be very complex.

 Thanks a lot,

 Alan Schmitt



Footnotes: 
[1]  http://www.jstatsoft.org/v46/i03

[2]  http://orgmode.org/manual/Working-With-Source-Code.html

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



Re: [O] Bug? R: Org babel block execution *drastically* slower than in ESS session directly

2012-11-16 Thread Eric Schulte
Andreas Leha andreas.l...@med.uni-goettingen.de writes:

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

 Aloha Aaron,

 Welcome to Org-mode.

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

 2012ko azaroak 13an, John Hendy-ek idatzi zuen:

 [...]
 Crazy. I really wondered if it had something to do with trying to spit
 out the results into the minibuffer. Why is that behavior included?

 “:results silent” just means “silent except for the minibuffer”; IDK
 why.


 [...]

 Just for the record:
 I would also love to see the really-silent results.


Yes, the existing :results silent option still echos the results to
the minibuffer.  It was originally added in the case where one does not
want to change the Org-mode buffer (but would still like to see code
block output).

The attached patch adds a really-silent results header argument.  To
see the impact compare the running time of the following two code
blocks.

#+begin_src sh :results really-silent
  seq 1
#+end_src

#+begin_src sh :results silent
  seq 1
#+end_src

Before such a patch is applied it would need corresponding
documentation, and the really-silent moniker may need to be
reconsidered in favor of something more informative (the main purpose of
this header argument is not silence but is rather avoiding all post
processing), and ideally shorter as well.  These new header arguments
are of no value if they are not easily discover-able and easily
remember-able to help others avoid the same issue that launched this
thread.

Cheers,

From 8ae5b59acdaaa271c797756bfe7f9479e1f9a277 Mon Sep 17 00:00:00 2001
From: Eric Schulte eric.schu...@gmx.com
Date: Fri, 16 Nov 2012 08:40:46 -0700
Subject: [PATCH] really-silent header avoids result post-process

This patch introduces a new header argument which hide all code block
results from Emacs so that they are not processed into Emacs-lisp
objects; a process which may take a great deal of time for large
objects.

* lisp/ob.el (org-babel-common-header-args-w-values): Adding the new
  really-silent header argument.
  (org-babel-execute-src-block): Don't do *any* result processing if the
  really-silent header argument has been specified.
  (org-babel-sha1-hash): Remove the really-silent header argument from
  header arg lists when calculating cache sums.
  (org-babel-insert-result): Flesh out some documentation.
---
 lisp/ob.el | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index 69a5c58..167fe1a 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -421,7 +421,7 @@ then run `org-babel-pop-to-session'.
 (padline	. ((yes no)))
 (results	. ((file list vector table scalar verbatim)
 		   (raw html latex org code pp drawer)
-		   (replace silent append prepend)
+		   (replace silent really-silent append prepend)
 		   (output value)))
 (rownames	. ((no yes)))
 (sep	. :any)
@@ -562,6 +562,8 @@ block.
 		(message executing %s code block%s...
 			 (capitalize lang)
 			 (if (nth 4 info) (format  (%s) (nth 4 info)) ))
+		(if (member really-silent result-params)
+		(message result silenced)
 		(setq result
 		  ((lambda (result)
 			 (if (and (eq (cdr (assoc :result-type params)) 'value)
@@ -581,7 +583,8 @@ block.
 		(org-babel-insert-result
 		 result result-params info new-hash indent lang)
 		(run-hooks 'org-babel-after-execute-hook)
-		result))
+		result
+		)))
 	  (setq call-process-region 'org-babel-call-process-region-original))
 
 (defun org-babel-expand-body:generic (body params optional var-lines)
@@ -1028,7 +1031,8 @@ the current subtree.
 	  (sort (copy-sequence (nth 2 info))
 		(lambda (a b) (string (car a) (car b)
 (let* ((rm (lambda (lst)
-		 (dolist (p '(replace silent append prepend))
+		 (dolist (p '(replace silent really-silent
+			  append prepend))
 		   (setq lst (remove p lst)))
 		 lst))
 	   (norm (lambda (arg)
@@ -1851,7 +1855,10 @@ RESULT-PARAMS can take the following values:
 replace - (default option) insert results after the source block
   replacing any previously inserted results
 
-silent -- no results are inserted
+silent -- no results are inserted into the Org-mode buffer but
+  the results are echoed to the minibuffer and are
+  ingested by Emacs (a potentially time consuming
+  process)
 
 file  the results are interpreted as a file path, and are
   inserted into the buffer using the Org-mode file syntax
-- 
1.8.0


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


Re: [O] subtree-export limitations

2012-11-16 Thread Suvayu Ali
On Fri, Nov 16, 2012 at 04:45:35PM +0100, Philipp Kroos wrote:
 
 So would be any other EXPORT_OPTIONS-line. The responsible function is
 org-export--get-subtree-options, which builds a list of already seen
 keywords. The lists members are then ignored if seen again.
 Is there any particular reason why this is done?
 

Since Alan gave you a workaround, I will try to answer the why.  I
believe the reason behind this behaviour is properties are not designed
to accumulate values.  I believe there is a special case treatment for
certain babel uses; as I'm hazy on the details, you have to look in the
archives from about a year back (my memory tells me September 2011 to
December 2011).  You should look for discussions involving Rainer(?)
and Eric Schulte.

Hope this helps.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] [PATCH] Change fontification order for links

2012-11-16 Thread Nicolas Goaziou
Hello,

Christophe Junke christophe.ju...@inria.fr writes:

 * lisp/org.el (org-set-font-lock-defaults): let footnote fontifications
   be done before other links' fontification. This allows links appearing
   inside footnotes to be both visible and active.

 TINYCHANGE
 ---
  lisp/org.el |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/lisp/org.el b/lisp/org.el
 index cfd8651..15b73aa 100644
 --- a/lisp/org.el
 +++ b/lisp/org.el
 @@ -5901,13 +5901,13 @@ needs to be inserted at a specific position in the 
 font-lock sequence.)
'(1 'org-special-keyword t)
'(3 'org-property-value t))
  ;; Links
 +(if (memq 'footnote lk) '(org-activate-footnote-links))
  (if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend)))
  (if (memq 'angle lk) '(org-activate-angle-links (0 'org-link t)))
  (if (memq 'plain lk) '(org-activate-plain-links))
  (if (memq 'bracket lk) '(org-activate-bracket-links (0 'org-link t)))
  (if (memq 'radio lk) '(org-activate-target-links (0 'org-link t)))
  (if (memq 'date lk) '(org-activate-dates (0 'org-date t)))
 -(if (memq 'footnote lk) '(org-activate-footnote-links))
  '(^?%%(.*\\|%%([^\n]*? (0 'org-sexp-date t))
  '(org-hide-wide-columns (0 nil append))
  ;; TODO keyword
 --
 1.7.9.5

Thank you for your patch.

Unfortunately, for some reason, I cannot apply it on master. Would you
mind updating Org and providing it again (assuming this is the reason
for the error)?


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Generation of pdf when using OPTIONS: H: faulty [7.9.2 (release_7.9.2-588-g8fb2cb @ /home/rkrug/.emacs.d/org-mode/lisp/)]

2012-11-16 Thread Nicolas Goaziou
Rainer M Krug r.m.k...@gmail.com writes:

 in the pdf:

  Fit a linear model as a baseline
 is missing


 random intercept and slope
 is behind ... random effects

 The tex file looks fine, but the pdf is missing these.

 I just tried it again with manually running the file against pdflatex and it 
 is missing as well.
 No idea what is wrong in the tex file, as I am just a basic LaTeX
 user.

What happens if you remove src-blocks? It could be a bug with
lstlistings environments.


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug? R: Org babel block execution *drastically* slower than in ESS session directly

2012-11-16 Thread Andreas Leha
Hi Eric,

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

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

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

 Aloha Aaron,

 Welcome to Org-mode.

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

 2012ko azaroak 13an, John Hendy-ek idatzi zuen:

 [...]
 Crazy. I really wondered if it had something to do with trying to spit
 out the results into the minibuffer. Why is that behavior included?

 “:results silent” just means “silent except for the minibuffer”; IDK
 why.


 [...]

 Just for the record:
 I would also love to see the really-silent results.


 Yes, the existing :results silent option still echos the results to
 the minibuffer.  It was originally added in the case where one does not
 want to change the Org-mode buffer (but would still like to see code
 block output).

 The attached patch adds a really-silent results header argument.  To
 see the impact compare the running time of the following two code
 blocks.

 #+begin_src sh :results really-silent
   seq 1
 #+end_src
 #+begin_src sh :results silent
   seq 1
 #+end_src

 Before such a patch is applied it would need corresponding
 documentation, and the really-silent moniker may need to be
 reconsidered in favor of something more informative (the main purpose of
 this header argument is not silence but is rather avoiding all post
 processing), and ideally shorter as well.  These new header arguments
 are of no value if they are not easily discover-able and easily
 remember-able to help others avoid the same issue that launched this
 thread.

 Cheers,

this is simply great!  Thank a lot.  I just tested and like it a lot!

With respect to the name: I think choosing a new name is hard because it
really should be silent.  What is now silent would better be named
minibuffer or sth. similar.  But since changing that would break quite
some (of my) code, I would suggest simply none for the new
really-silent.

Just my 2ct.

Thanks again.  I'll start using it right now.

Regards,
Andreas




Re: [O] source code disappears

2012-11-16 Thread Neil Best
When I switch to the ELPA version ( Org-mode version 7.9.2
(7.9.2-82-g2aeb28-elpa @ . . . )) this misbehavior is corrected.
HTH.




Re: [O] Bug? R: Org babel block execution *drastically* slower than in ESS session directly

2012-11-16 Thread John Hendy
On Fri, Nov 16, 2012 at 11:47 AM, Andreas Leha 
andreas.l...@med.uni-goettingen.de wrote:

 Hi Eric,

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

  Andreas Leha andreas.l...@med.uni-goettingen.de writes:
 
  t...@tsdye.com (Thomas S. Dye) writes:
 
  Aloha Aaron,
 
  Welcome to Org-mode.
 
  Aaron Ecay aarone...@gmail.com writes:
 
  2012ko azaroak 13an, John Hendy-ek idatzi zuen:
 
  [...]
  Crazy. I really wondered if it had something to do with trying to
 spit
  out the results into the minibuffer. Why is that behavior included?
 
  “:results silent” just means “silent except for the minibuffer”; IDK
  why.
 
 
  [...]
 
  Just for the record:
  I would also love to see the really-silent results.
 
 
  Yes, the existing :results silent option still echos the results to
  the minibuffer.  It was originally added in the case where one does not
  want to change the Org-mode buffer (but would still like to see code
  block output).
 
  The attached patch adds a really-silent results header argument.  To
  see the impact compare the running time of the following two code
  blocks.
 
  #+begin_src sh :results really-silent
seq 1
  #+end_src
  #+begin_src sh :results silent
seq 1
  #+end_src
 
  Before such a patch is applied it would need corresponding
  documentation, and the really-silent moniker may need to be
  reconsidered in favor of something more informative (the main purpose of
  this header argument is not silence but is rather avoiding all post
  processing), and ideally shorter as well.  These new header arguments
  are of no value if they are not easily discover-able and easily
  remember-able to help others avoid the same issue that launched this
  thread.
 
  Cheers,

 this is simply great!  Thank a lot.  I just tested and like it a lot!


I'll have to give this a try.


 With respect to the name: I think choosing a new name is hard because it
 really should be silent.  What is now silent would better be named
 minibuffer or sth. similar.  But since changing that would break quite
 some (of my) code, I would suggest simply none for the new
 really-silent.


I like the none idea. Or another approach would be a variable/in-buffer
setting that defines the meaning of silent? Something like
=org-babel-echo-results-in-minibuffer= or something like that? Though
perhaps folks would like to mix and match silent and none within the same
document.

Thanks for creating the patch, Eric. I'll try shortly.

Best regards,
John



 Just my 2ct.

 Thanks again.  I'll start using it right now.

 Regards,
 Andreas





Re: [O] change the latex header per subtree

2012-11-16 Thread Achim Gratz
Nicolas Goaziou writes:
 I don't get what you are telling me here, sorry.

 You can have \input{my-special-headers-A.tex} somewhere in your class,
 where my-special-headers-A.tex file contains some package collection.

Actually I'd write my own style file and give it appropriate arguments
and options if a fallback to LaTeX's devices is what you're proposing.
This may even be easier, but it introduces a dependency at yet another
place that I currently don't want to deal with.  Thanks for the
suggestion anyway.


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

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] Bug: Generation of pdf when using OPTIONS: H: faulty [7.9.2 (release_7.9.2-588-g8fb2cb @ /home/rkrug/.emacs.d/org-mode/lisp/)]

2012-11-16 Thread Achim Gratz
Nicolas Goaziou writes:
 What happens if you remove src-blocks? It could be a bug with
 lstlistings environments.

I'm not familiar with lstlistings in particular, but like all verbatim
environments it is prone to breakage.  In this particular case it seems
that a \paragraph can't start with a lstlisting environment, there must
be some actual text (a ~ is enough).


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

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] Bug? R: Org babel block execution *drastically* slower than in ESS session directly

2012-11-16 Thread Achim Gratz
Andreas Leha writes:
 I would suggest simply none for the new really-silent.

Yes please, especially since I tried :results none two days ago to
achieve that effect and wondered why it wouldn't work.  :-)


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

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




[O] org-todo does not take into account quasi-todo-keywords

2012-11-16 Thread Samuel Wales
*** COMMENT MAYBE COMMENT MAYBE COMMENT hi

If you change the todo keyword on a commented item, it puts in front.
If you comment an item, it puts in front.

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