Re: [O] [PATCH] Allow org-collector to display heading indentation

2012-03-31 Thread Sebastien Vauban
Hi Nicolas,

Nicolas Girard wrote:
 From eaf9e5f06279069ed1072425fd020d8f0442d04f Mon Sep 17 00:00:00 2001
 From: Nicolas Girard girard.nico...@gmail.com
 Date: Fri, 30 Mar 2012 22:53:13 +0200
 Subject: [PATCH] Allow org-collector to display heading indentation

 ---
  contrib/lisp/org-collector.el |   12 +---
  1 files changed, 9 insertions(+), 3 deletions(-)

 diff --git a/contrib/lisp/org-collector.el b/contrib/lisp/org-collector.el
 index da612e9..2476d62 100644
 --- a/contrib/lisp/org-collector.el
 +++ b/contrib/lisp/org-collector.el
 @@ -121,6 +121,7 @@ preceeding the dblock, then update the contents of
 the dblock.
   (scope (plist-get params :scope))
   (noquote (plist-get params :noquote))
   (colnames (plist-get params :colnames))
 + (indent (plist-get params :indent))
   (content-lines (org-split-string (plist-get params :content) \n))
   id table line pos)
   (save-excursion
 @@ -135,7 +136,7 @@ preceeding the dblock, then update the contents of
 the dblock.
 (setq stringformat (if noquote %s %S))
 (setq table (org-propview-to-table
  (org-propview-collect cols stringformat conds match 
 scope inherit
 -  (if colnames colnames cols)) 
 stringformat))
 +  (if colnames colnames cols) 
 indent) stringformat))
 (widen))
   (setq pos (point))
   (when content-lines
 @@ -171,13 +172,18 @@ variables and values specified in props
(when p (cons n p
inherit

 -(defun org-propview-collect (cols stringformat optional conds match
 scope inherit colnames)
 +(defun org-propview-collect (cols stringformat optional conds match
 scope inherit colnames indent)
(interactive)
;; collect the properties from every header
(let* ((header-props
 (let ((org-trust-scanner-tags t) alst)
   (org-map-entries
 -  (quote (cons (cons ITEM (org-get-heading t))
 +  (quote (cons (cons ITEM
 + (let ((item (org-get-heading t))
 +   (level (- (org-current-level) 1)))
 +   (if (and indent ( level 0))
 +   (format \\%s %s
 +   (make-string level ?- ) item) 
 item)))

You may want to follow the indent convention used for clockview: \__
string.

Have a look at (or reuse?) the function `org-clocktable-indent-string'...

 (org-propview-get-with-inherited inherit)))
match scope)))
;; read property values

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] [PATCH] Time specifications: Allow specifying relative times

2012-03-31 Thread Sebastien Vauban
Hi Ilya,

Ilya Shlyakhter wrote:
 Btw, I couldn't quite understand the exact meaning of :block, :tstart and
 :tend as decribed in the manual.  Is there a better explanation
 somewhere?

The block allows you to specify some chunk which is definable easily:
- yesterday
- lastweek
- thismonth
- 2012-02
- 2012-03-30
- etc.

  #+BEGIN: clocktable :scope (file.org) :block 2012-02
  #+END:

`tstart' and `tend' serve for when you want to specify some range of dates
which is not expressable that way: for example, last Monday (`tstart') to
Wednesday (`tend').

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] About org-babel menu

2012-03-31 Thread Nick Dokos
Torsten Wagner torsten.wag...@gmail.com wrote:

 My menus are hidden too. However,  if I need them for some reasons
 there is some key mouse combo.  Can't remember exactly. Shift right
 click or C- right click.. something along this.  The menu will pop up
 as a context menu close to the mouse cursor  location. Be aware there
 is a customization menu too.
 
 Just in case you look for a quick way to use the menu.
 

Thanks for the useful hint.

One possible gotcha: in my case, C-mouse3 is undefined, even though
the docs say it should be. I tried emacs -q and emacs -Q as well, just
in case, my init somehow clobbers it: undefined there as well.  So I
have to bind it somehow:

   (global-set-key [C-mouse-3] 'mouse-popup-menubar-stuff)

does not seem to work for me, but

   (global-set-key [mouse-3] 'mouse-popup-menubar-stuff)

does.

GNU Emacs 24.0.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.4) of 
2012-01-24

That's good enough I guess but I was wondering if anybody else has these
problems.

Nick



Re: [O] Feature request for noweb mode that strips references on export

2012-03-31 Thread Sean O'Halpin
On Fri, Mar 30, 2012 at 5:37 PM, Nick Dokos nicholas.do...@hp.com wrote:
 This may have nothing to do with anything (it may even be an artifact of
 mailer misbehavior) but is this supposed to be boilerplate? These
 are supposed to be ASCII chars, so if you are using some sort of extended
 charset, try changing them and see if that works.

 Nick

I've customized =org-babel-noweb-wrap-start= and
=org-babel-noweb-wrap-end= to use guillemets rather than angle
brackets. The noweb stuff is working. It's the lack of the results output
when using strip-export that is bugging me.



Re: [O] Feature request for noweb mode that strips references on export

2012-03-31 Thread Sean O'Halpin
On Fri, Mar 30, 2012 at 5:39 PM, Daimrod daim...@gmail.com wrote:
 If you don't want to export boilerplate you've to use :exports none in
 it.

 #+name: boilerplate
 #+begin_src ruby :exports none
 def hello
  Hello World
 end
 #+end_src

 Use it

 #+name: example
 #+begin_src ruby :exports both :noweb strip-export
 boilerplate

 hello
 #+end_src

Thanks but that's not my problem. When I use :exports both I get the
code but not the results output in my exported HTML.
Do you get the Hello World output? If so, it looks like I'll have to
debug my configuration.



Re: [O] Feature request for noweb mode that strips references on export

2012-03-31 Thread Daimrod
Sean O'Halpin sean.ohal...@gmail.com writes:

 On Fri, Mar 30, 2012 at 5:39 PM, Daimrod daim...@gmail.com wrote:
 If you don't want to export boilerplate you've to use :exports none in
 it.

 #+name: boilerplate
 #+begin_src ruby :exports none
 def hello
  Hello World
 end
 #+end_src

 Use it

 #+name: example
 #+begin_src ruby :exports both :noweb strip-export
 boilerplate

 hello
 #+end_src

 Thanks but that's not my problem. When I use :exports both I get the
 code but not the results output in my exported HTML.
 Do you get the Hello World output? If so, it looks like I'll have to
 debug my configuration.

No, you're right, I have to execute evaluate the code manually to
produce

#+RESULTS: example
: Hello World

and then it's exported but only if the code isn't evaluated during the
export. It looks like there is a bug with in the ruby part because the
following code works as expected.

--
* Title
#+name: boilerplate
#+begin_src emacs-lisp :exports none
  (defun hello ()
Hello World)
#+end_src

Use it

#+name: example
#+begin_src emacs-lisp :exports both :noweb strip-export
  boilerplate
  
  (hello)
#+end_src
--

It exports to

--
1 Title

Use it

(hello)

Hello World
--




Re: [O] About org-babel menu

2012-03-31 Thread Bastien
Hi Thorsten,

I'm interested in having a menu for Babel.

What I need is (1) the list of functions and contexts in which this menu
should appear and (2) the list of items for such a menu.  When we have
this, we can think of context-aware mouse-menu deeper, adapted to what
is already available in the global menu.

If someone wants to put a stab at (1) and (2), let's go !  Would be a
nice addition for Org 7.9.

Thanks,

-- 
 Bastien



Re: [O] [PATCH] Testing: Corrected the command to run batch tests given in testing/README

2012-03-31 Thread Bastien
Ilya Shlyakhter ilya_...@alum.mit.edu writes:

 Added some details for how to run the test suite in batch mode.

Applied against master -- thanks!

-- 
 Bastien



Re: [O] org-mobile: Strange #+TODO: in index.org

2012-03-31 Thread Bastien
Hi Moritz,

Moritz Ulrich ulrich.mor...@googlemail.com writes:

 On Thu, Mar 29, 2012 at 12:51, Bastien b...@gnu.org wrote:
 Hi Ulrich,

 It's Moritz, everyone confuses this ;-) (No hard feelings)

Sorry for that! 

 Can you check if this patch against master fixes the problem for you?

 Sadly it causes a bunch of problems: MobileOrg and MobileOrg-NG
 doesn't seem to recognize #+TYP_TODO: lines. With this patch applied,
 MobileOrg doesn't recognize any TODO keyword and therefore fails to
 parse them correctly. Looks like a bug in the MobileOrg projects.

Mhh.. so I guess we (=you!) should live with it right now.  Perhaps 
adding the #+TODO across sync'ed files is the solution?

All best,

-- 
 Bastien



Re: [O] odt-Export and #+CAPTION: [reference text]{caption text}

2012-03-31 Thread Bastien
Jambunathan K kjambunat...@gmail.com writes:

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

 I have applied my patch to the hotfix branch.

Thanks for the diligent action taken Jambunathan.

-- 
 Bastien



Re: [O] [PATCH] Separate file time from its tasks times

2012-03-31 Thread Bastien
Hi Sébastien,

Sebastien Vauban wxhgmqzgw...@spammotel.com writes:

 Sebastien Vauban wrote:
 2012-03-30  Sebastien Vauban  wxhgmqzgw...@spammotel.com

  * org-clock.el (org-clocktable-write-default): Make the sum
  appear visually correct by not mixing the total time per file
  and sub-totals.

 This can be best understood with an example...

Mhh.. I understand.  While your patch makes the display more consistent
in terms of hierarchy, I feel it doesn't help readability *that* much.

Could send other before/after examples with various clocktables configs?

I'm also interested in hearing others opinions on this.

Thanks!

-- 
 Bastien



Re: [O] [PATCH] Deleting properties: Fixed bug that left blank lines after, deleting properties

2012-03-31 Thread Bastien
Ilya Shlyakhter ilya_...@alum.mit.edu writes:

 Patch for a bug that left blank lines in property drawer after
 org-delete-property-globally.

Applied in the hotfix-7.8.06 branch, thanks!

-- 
 Bastien



Re: [O] Bug: Tag Completion Not Prompting for all tags

2012-03-31 Thread Bastien
Hi Mike,

Mike McLean mike.mcl...@pobox.com writes:

 Bastien

 I can verify that this has fixed the problem with tag completion not
 prompting for all tags. I see that commit
 647396464d563634b980127673cf61769663407e has added a wrapper 
 (append that combines buffer-tags with (mapcar 'car table).

 This has, however, exposed a new bug and conflict
 with org-completion-use-ido that I can minimally reproduce below.

This is now fixed, thanks!

-- 
 Bastien



[O] Org release 7.8.07 (BUGFIX-only release)

2012-03-31 Thread Bastien
Hi all,

I have just released Org 7.8.07 -- a BUGFIX-only release.

This is the version that will be merged into Emacs' trunk
by tomorrow.  Please report critical bugs using URGENT
in the subject line.

Thanks all for your help!

  http://orgmode.org/org-7.8.07.zip
  http://orgmode.org/org-7.8.07.tar.gz
  http://orgmode.org/org-mode-download.html

Enjoy,

-- 
 Bastien



Re: [O] About org-babel menu

2012-03-31 Thread Yagnesh Raghava Yakkala
Bastien b...@gnu.org writes:

 Hi Thorsten,

 I'm interested in having a menu for Babel.

 What I need is (1) the list of functions and contexts in which this menu
 should appear and (2) the list of items for such a menu.  When we have
 this, we can think of context-aware mouse-menu deeper, adapted to what
 is already available in the global menu.

 If someone wants to put a stab at (1) and (2), let's go !  Would be a
 nice addition for Org 7.9.

I will try and report back soon.

IMO babel can have its own main menu just like OrgTbl. (with a name ob or
something).

PS: Even I don't use menus. Just thinking of learning more about org babel

-- 
YYR




[O] Feature request: setq org-agenda-follow-indirect 'parent

2012-03-31 Thread Nicolas Girard
Hi all,

when browsing my TODO items in the agenda, I wish I could display then
in an indirect buffer.
But as I structure my stuff, displaying the tree with a TODO item as
root is often useless.

Indeed, within my PROJECT items, I differentiate between TODO and
support (notes, references) children ; for instance
#+BEGIN_SRC org
  ,* PROJECT My project
  ,** References
  ,*** Ref 1
  ,*** Ref 2
  ,** Notes
  ,*** Note 1
  ,*** Note 2
  ,** TODO Todo item 1
  ,** TODO Todo item 2
#+END_SRC

In this example, in order to work on, or even decide anything about
Todo item 1, chances are that I'd also need to see the contents of
the References and Notes items ; so the tree I'd need to see in
the indirect buffer should have the *parent* of Todo item 1 as root,
instead of Todo item 1 itself.

It seems rather easy to achieve, since `org-agenda-do-context-action'
calls `org-agenda-tree-to-indirect-buffer', which is supposed to deal
with this case when called with a numerical prefix argument ; so I did
give it a try but couldn't get it to work properly :-(

Cheers,
Nicolas



Re: [O] Org release 7.8.07 (BUGFIX-only release)

2012-03-31 Thread Achim Gratz
Bastien writes:
 This is the version that will be merged into Emacs' trunk
 by tomorrow.

Please tag the release on maint so that Git reports the correct version.

  Please report critical bugs using URGENT
 in the subject line.

All tests (except for R which I can't run due to lack of ESS) are clean
on openSUSE/Tumbleweed with both Emacs 23.4 and 24.0.94.

 Thanks all for your help!

I'm still getting these complaints about unprefixed / global variables
w/ latest Emacs24 from trunk and fresh pull from master:

In toplevel form:
org.el:4871:1:Warning: global/dynamic var `date' lacks a prefix

In toplevel form:
org-agenda.el:95:1:Warning: global/dynamic var `date' lacks a prefix

In toplevel form:
org-bbdb.el:122:1:Warning: global/dynamic var `date' lacks a prefix
org-bbdb.el:123:1:Warning: global/dynamic var `name' lacks a prefix

In toplevel form:
org-remember.el:280:1:Warning: global/dynamic var `annotation' lacks a prefix
org-remember.el:281:1:Warning: global/dynamic var `initial' lacks a prefix


There is something going on in org-compat that I don't understand at all
(note that find-library is not called at that poit at all, so there must
be some macro expansion at work).  This is also in Emacs23:

In org-find-library-name:
org-compat.el:341:14:Warning: find-library called with 3 arguments, but
accepts only 1


Lastly, there's a function that has been obsoleted with Emacs24, so it
should probably get a shim in org-compat to refer to one or the other
definition based on Emacs version in a with-no-error form.

In org-indent-mode:
org-indent.el:212:11:Warning: `buffer-substring-filters' is an obsolete
variable (as of 24.1); use `filter-buffer-substring-functions' instead.
org-indent.el:213:12:Warning: `buffer-substring-filters' is an obsolete
variable (as of 24.1); use `filter-buffer-substring-functions' instead.
org-indent.el:213:12:Warning: `buffer-substring-filters' is an obsolete
variable (as of 24.1); use `filter-buffer-substring-functions' instead.


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

Waldorf MIDI Implementation  additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs




Re: [O] [babwel] Simplify graph generation and copying?

2012-03-31 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 30/03/12 21:04, Andreas Leha wrote:
 Rainer M Krug r.m.k...@gmail.com writes:
 
 Hi
 
 I do the following to create a graph in R and then convert / copy / do other 
 stuff with it in
 the bash shell:
 
 #+header: :results graphics #+header: :file Test.pdf #+header: :width 4 
 #+header: :height 8 
 #+header: :pointsize 8 #+begin_src R plot(runif(100)) #+end_src
 
 #+BEGIN_SRC sh :session shell cp Test.pdf Test2.pdf #+END_SRC
 
 
 Is there a way of automatically giving the ffile name from the :file 
 parameter tio the second
 code block, so that I just have to change the :file argument when I want a 
 different name for
 the graph?
 
 Thanks,
 
 Rainer
 
 
 Hi Rainer,
 
 I am not aware of any possibility to pass the :file parameter from one code 
 block to another.
 But for your use case, the file name is also the return value of the R code 
 block.  So, you can
 do:

Looks absolutely perfect. Thanks a lot,

Rainer

 
 #+name: mypdfplot #+header: :results graphics #+header: :file Test.pdf 
 #+header: :width 4 
 #+header: :height 8 #+header: :pointsize 8 #+begin_src R plot(runif(100)) 
 #+end_src
 
 
 #+BEGIN_SRC sh :session shell :var mypdf=mypdfplot() cp $mypdf Test2.pdf 
 #+END_SRC
 
 Best, Andreas
 
 


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk93B/gACgkQoYgNqgF2egrQXACeIJpeUNeTCa9amYfs8YI1Nv4F
USkAn0xY0CnVHIqALy+h7rpuE19Mhjcz
=wQVz
-END PGP SIGNATURE-



Re: [O] Feature request for noweb mode that strips references on export

2012-03-31 Thread Nick Dokos
Sean O'Halpin sean.ohal...@gmail.com wrote:

 On Fri, Mar 30, 2012 at 5:39 PM, Daimrod daim...@gmail.com wrote:
  If you don't want to export boilerplate you've to use :exports none in
  it.
 
  #+name: boilerplate
  #+begin_src ruby :exports none
  def hello
   Hello World
  end
  #+end_src
 
  Use it
 
  #+name: example
  #+begin_src ruby :exports both :noweb strip-export
  boilerplate
 
  hello
  #+end_src
 
 Thanks but that's not my problem. When I use :exports both I get the
 code but not the results output in my exported HTML.
 Do you get the Hello World output? If so, it looks like I'll have to
 debug my configuration.
 

Now that I've tried it, I can reproduce it: the final results disappear
on export.

Nick




Re: [O] Babel vs. Doxygen?

2012-03-31 Thread Eric Schulte
Michael Hannon jm_han...@yahoo.com writes:

 Greetings.  I just ran across an article about Doxygen [1], and I'm trying to
 understand if there's any intersection between Doxygen/Roxygen and Org mode
 Babel, both of which seem to have literate programming as a goal.  Any
 thoughts about this?  Thanks.

 -- Mike


Inline API documentation tools can be thought of as a very simple form
of literate programming.  These tools are addressed in the paper on code
block behavior in Org-mode.  See http://www.jstatsoft.org/v46/i03

Best,

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



Re: [O] [PATCH] link descriptions in :file results of src blocks

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

 Hi all,

 this small patch adds :filelinkdescr to the list of possible header
 arguments for babel source blocks.
 Its intented functionality is to allow source blocks to return links to
 files with description.

 Two small examples:

 ,[ example1 ]
 | #+begin_src R :results graphics :file test.png :filelinkdescr here
 |   plot(1:10)
 | #+end_src
 | 
 | #+results:
 | [[file:test.png][here]]
 `

 ,[ example2 ]
 | #+begin_src R :results graphics :file test2.png :filelinkdescr
 |   plot(1:10)
 | #+end_src
 | 
 | #+results:
 | [[file:test2.png][test2.png]]
 `

 If used with value (here in the example1) that value will become the
 description.  If used without value (as in example2), the description is
 taken from either the :file header argument or the results of the code block
 evaluation (in that order).

 Have not done much testing yet, though.

 Regards,
 Andreas


Hi Andreas,

I would like to apply this patch, however I have some questions about
the use of the :file argument and the result itself to fill in the
description if the :filelinkdescr header argument is left blank.  Also,
I would suggest that :file-desc is a better name for this header
argument.

In my opinion using the :file argument as a description changes (or at
least adds to) the meaning of the :file header argument.  Is there a
significant benefit to this behavior?  If not I'd prefer that an empty
:file-desc header argument have no effect.

Thanks for this patch, which I think adds nice functionality and which I
would like to apply -- although I'll likely want to make the changes
above after application.

Cheers,



 From 698570cb9938ee1f4dd1472cb13b32d08d108cbb Mon Sep 17 00:00:00 2001
 From: Andreas Leha andr...@lehas.net
 Date: Tue, 27 Mar 2012 10:33:32 +0200
 Subject: [PATCH] new source block header argument :filelinkdescr

 ---
  lisp/ob.el |   10 +-
  1 files changed, 9 insertions(+), 1 deletions(-)

 diff --git a/lisp/ob.el b/lisp/ob.el
 index d27a394..0efef3e 100644
 --- a/lisp/ob.el
 +++ b/lisp/ob.el
 @@ -400,6 +400,7 @@ then run `org-babel-pop-to-session'.
  (eval. ((never query)))
  (exports . ((code results both none)))
  (file. :any)
 +(filelinkdescr . :any)
  (hlines  . ((no yes)))
  (mkdirp  . ((yes no)))
  (no-expand)
 @@ -1833,7 +1834,14 @@ code  the results are extracted in the syntax of 
 the source
(progn
  (setq result (org-babel-clean-text-properties result))
  (when (member file result-params)
 -  (setq result (org-babel-result-to-file result
 +   (progn (when (assoc :filelinkdescr (nth 2 info))
 +(let ((filelinkdescr (or (cdr (assoc :filelinkdescr (nth 2 
 info)))
 + (cdr (assoc :file (nth 2 info)))
 + result)))
 +  (when filelinkdescr
 +(setq result
 +  (list result filelinkdescr)
 +  (setq result (org-babel-result-to-file result)
  (unless (listp result) (setq result (format %S result
(if (and result-params (member silent result-params))
(progn

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



Re: [O] URGENT Bug with exporting org source block

2012-03-31 Thread Eric Schulte
Truong Nghiem truong.ngh...@gmail.com writes:

 I'm using orgmode release Org 7.8.06.  When I export an org source
 block (i.e. a source code block in the org language):

 #+BEGIN_SRC org :exports code
   ,#+srcname: name
   ,#+begin_src language switches header arguments
   ,  body
   ,#+end_src
 #+END_SRC

 the last source line is not exported.  The output, in both PDF and
 HTML, becomes:

 #+srcname: name
 #+begin_src language switches header arguments
   body

 Notice that the line #+end_src is not present.
 --
 Truong Nghiem


Hi Truong,

Thanks for reporting this problem.  The issue lies somewhere later in
the export process and is not related to the Babel expansion of the code
block.  To see this your example code may be placed in an org-mode file,
and the code block export expansion may be run by evaluating the
following elisp snippet.

  (let ((org-current-export-file /path/to/file.org))
(org-export-blocks-preprocess))

Hopefully someone more familiar with the export process can try to pin
down this behavior.  This would be a good fix to put in before the
upcoming Emacs merge.

Best,

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



Re: [O] Feature request for noweb mode that strips references on export

2012-03-31 Thread Eric Schulte
Nick Dokos nicholas.do...@hp.com writes:

 Sean O'Halpin sean.ohal...@gmail.com wrote:

 On Fri, Mar 30, 2012 at 5:39 PM, Daimrod daim...@gmail.com wrote:
  If you don't want to export boilerplate you've to use :exports none in
  it.
 
  #+name: boilerplate
  #+begin_src ruby :exports none
  def hello
   Hello World
  end
  #+end_src
 
  Use it
 
  #+name: example
  #+begin_src ruby :exports both :noweb strip-export
  boilerplate
 
  hello
  #+end_src
 
 Thanks but that's not my problem. When I use :exports both I get the
 code but not the results output in my exported HTML.
 Do you get the Hello World output? If so, it looks like I'll have to
 debug my configuration.
 

 Now that I've tried it, I can reproduce it: the final results disappear
 on export.

 Nick



Thanks for bringing this problem to light.  I've just pushed up a fix.

Cheers,

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



Re: [O] URGENT Org Babel C/C++

2012-03-31 Thread Eric Schulte
Daimrod daim...@gmail.com writes:

 Eric Schulte eric.schu...@gmx.com writes:

 Applied, Thanks!

 Daimrod daim...@gmail.com writes:

 Hi,

 I've made a small patch to ob-C.el so it now includes the current
 directory to the list of directories to be searched for header files.
 Without this, I cannot include a local header file because the
 compilation happens in /tmp and thus gcc or g++ doesn't search for
 header files in the directory I currently work.

 diff --git a/lisp/ob-C.el b/lisp/ob-C.el
 index f1525aa..4f33fc4 100644
 --- a/lisp/ob-C.el
 +++ b/lisp/ob-C.el
 @@ -96,15 +96,14 @@ or `org-babel-execute:C++'.
   (progn
 (with-temp-file tmp-src-file (insert full-body))
 (org-babel-eval
 -(format %s -o %s %s %s -I \%s\
 +(format %s -o %s %s %s
  (cond
   ((equal org-babel-c-variant 'c) org-babel-C-compiler)
   ((equal org-babel-c-variant 'cpp) org-babel-C++-compiler))
  (org-babel-process-file-name tmp-bin-file)
  (mapconcat 'identity
 (if (listp flags) flags (list flags))  )
 -(org-babel-process-file-name tmp-src-file)
 -(file-name-directory (expand-file-name 
 (buffer-file-name 
 +(org-babel-process-file-name tmp-src-file)) 
  ((lambda (results)
 (org-babel-reassemble-table
 (if (member vector (cdr (assoc :result-params params)))

 Hum, I'm quite embarrassed, this doesn't work when the block is executed
 during an export. I didn't track it down yet, but (buffer-file-name)
 returns nil during the export probably because the buffer changes.


I've reverted this commit, I should have been more cautious in its
application.  I've reverted this commit in both the hotfix-7.8.06 branch
and the master branch.


 A workaround would be to use the :flags header argument though it's a
 bit tedious because it doesn't seem possible to eval elisp during the
 export.

 i.e.

 #+BEGIN_SRC cpp :flags -I (file-name-directory (buffer-file-name))
 ...
 #+END_SRC

I don't believe the above statement is true, for example the following
code block evaluates its header argument on export.

Example of code eval during export.

#+headers: :exports results
#+begin_src emacs-lisp :var this=(file-name-directory (buffer-file-name))
  this
#+end_src

Best,

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


Re: [O] URGENT Bug with exporting org source block

2012-03-31 Thread Eric Schulte
Eric Schulte eric.schu...@gmx.com writes:

 Truong Nghiem truong.ngh...@gmail.com writes:

 I'm using orgmode release Org 7.8.06.  When I export an org source
 block (i.e. a source code block in the org language):

 #+BEGIN_SRC org :exports code
   ,#+srcname: name
   ,#+begin_src language switches header arguments
   ,  body
   ,#+end_src
 #+END_SRC

 the last source line is not exported.  The output, in both PDF and
 HTML, becomes:

 #+srcname: name
 #+begin_src language switches header arguments
   body

 Notice that the line #+end_src is not present.
 --
 Truong Nghiem


 Hi Truong,

 Thanks for reporting this problem.  The issue lies somewhere later in
 the export process and is not related to the Babel expansion of the code
 block.  To see this your example code may be placed in an org-mode file,
 and the code block export expansion may be run by evaluating the
 following elisp snippet.

   (let ((org-current-export-file /path/to/file.org))
 (org-export-blocks-preprocess))

 Hopefully someone more familiar with the export process can try to pin
 down this behavior.  This would be a good fix to put in before the
 upcoming Emacs merge.

 Best,

I've just pushed up a fix for this bug.  Best,

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



Re: [O] Org release 7.8.07 (BUGFIX-only release)

2012-03-31 Thread Eric Schulte
Bastien b...@gnu.org writes:

 Hi all,

 I have just released Org 7.8.07 -- a BUGFIX-only release.

 This is the version that will be merged into Emacs' trunk
 by tomorrow.  Please report critical bugs using URGENT
 in the subject line.

 Thanks all for your help!

   http://orgmode.org/org-7.8.07.zip
   http://orgmode.org/org-7.8.07.tar.gz
   http://orgmode.org/org-mode-download.html

 Enjoy,

Hi Bastien,

I've pushed two bug fixes up to the hotfix-7.8.06 branch this morning.
These should both be included in the code merged with Emacs.  I've
marked the emails related to these bugs as URGENT.

Cheers,

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



Re: [O] Org release 7.8.07 (BUGFIX-only release)

2012-03-31 Thread Eric Schulte
Eric Schulte eric.schu...@gmx.com writes:

 Bastien b...@gnu.org writes:

 Hi all,

 I have just released Org 7.8.07 -- a BUGFIX-only release.

 This is the version that will be merged into Emacs' trunk
 by tomorrow.  Please report critical bugs using URGENT
 in the subject line.

 Thanks all for your help!

   http://orgmode.org/org-7.8.07.zip
   http://orgmode.org/org-7.8.07.tar.gz
   http://orgmode.org/org-mode-download.html

 Enjoy,

 Hi Bastien,

 I've pushed two bug fixes up to the hotfix-7.8.06 branch this morning.
   ^
 three
 
 These should both be included in the code merged with Emacs.  I've
 marked the emails related to these bugs as URGENT.

 Cheers,

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



Re: [O] org-mime-htmlize: visual representation (thunderbird)

2012-03-31 Thread Eric Schulte
Uwe Brauer o...@mat.ucm.es writes:

 Hello

 Now that the bug in org-mime-htmlize is fixed, I would like
 to comment on the visual representation. Most likely this
 has to do with the mml package.

 When I write the following message 
 Integral


 $$\int fdx=0$$
 And


 \begin{equation} 
 \sum_{\alpha} 
 \end{equation}

 and apply org-preview-latex-fragment and then
 org-mime-htmlize and send this message to gmail. 
 The 'gmail-reader' displays them fine.

 However thunderbird does not and I apply the resulting eml 
 file below (I presume a screenshot is not appropriated)


This sounds like a thunderbird bug -- not properly displaying multi-part
messages.


 Now tunderbird itself has an extension (latex-it) which does
 something similar to org-mime-htmlize, it sends latex math
 as png. However there are better* displayed, I attach the
 relevant eml file below.


The difference between org-mime-htmlize and latex-it is that the former
converts each formulas to its own png image, while the later converts
the entire message to one large pdf file which is then attached as a
single image.


 Could org-mime-htmlize use the structure of latex-it?


The ability to convert the entire message to one monolithic image
(through latex and pdf) could certainly be added as an export option
(patches welcome), but I would not want this behavior to be the default,
as sending messages as large images is not (to my mind at least) a
desirable option.

Best,


 Thanks

 Uwe Brauer 

 Attachments: first org, then latex-it


 From: Uwe Brauer o...@mat.ucm.es
 Subject: test-org-mime
 To: Uwe Brauer oub.oub@gmail.com
 Date: Tue, 27 Mar 2012 12:55:48 +0200 (4 days, 6 hours, 13 minutes ago)
 Reply-To: Uwe Brauer o...@mat.ucm.es

 Integral 

 $$\int fdx=0$$ 
 And

 \begin{equation}
 \sum_{\alpha}
 \end{equation}


 --


 From: Uwe Brauer oub.oub@gmail.com
 Subject: test latex
 To: Uwe Brauer oub.oub@gmail.com
 Date: Tue, 27 Mar 2012 12:43:30 +0200 (4 days, 6 hours, 26 minutes ago)

\documentclass{article} \usepackage[utf8x]{inputenc} \pagestyle{empty}
\begin{document} Integral $$\int f dx=0$$ And \begin{equation}
\sum_{\alpha} \end{equation} \end{document}
 --


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



Re: [O] is there a way to have =var_name= in table

2012-03-31 Thread Carsten Dominik

On 31.3.2012, at 21:24, Stephen J. Barr wrote:

 Dear org-mode list,
 
 Quick and easy question:
 
 I want to make a document that has a table where one column has
 variables and another column has descriptions.
 
 E.g.
 
 | VAR NAMES | DESC   |
 |---+|
 | =var1=| this is the first var  |
 | =var2=| this is the second var |
 |   ||
 |---+|
 However, pressing [TAB] after writing =var1= causes #ERROR to show up.
 How do I make this work the way I am intending? :)


| VAR NAMES | DESC   |
|---+|
| ~var1~| this is the first var  |
| ~var2~| this is the second var |
|   ||
|---+|

- Carsten




Re: [O] [PATCH] link descriptions in :file results of src blocks

2012-03-31 Thread Andreas Leha
Eric Schulte eric.schu...@gmx.com writes:

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

 Hi all,

 this small patch adds :filelinkdescr to the list of possible header
 arguments for babel source blocks.
 Its intented functionality is to allow source blocks to return links to
 files with description.

 Two small examples:

 ,[ example1 ]
 | #+begin_src R :results graphics :file test.png :filelinkdescr here
 |   plot(1:10)
 | #+end_src
 | 
 | #+results:
 | [[file:test.png][here]]
 `

 ,[ example2 ]
 | #+begin_src R :results graphics :file test2.png :filelinkdescr
 |   plot(1:10)
 | #+end_src
 | 
 | #+results:
 | [[file:test2.png][test2.png]]
 `

 If used with value (here in the example1) that value will become the
 description.  If used without value (as in example2), the description is
 taken from either the :file header argument or the results of the code block
 evaluation (in that order).

 Have not done much testing yet, though.

 Regards,
 Andreas


 Hi Andreas,

 I would like to apply this patch, however I have some questions about
 the use of the :file argument and the result itself to fill in the
 description if the :filelinkdescr header argument is left blank.  Also,
 I would suggest that :file-desc is a better name for this header
 argument.

Hi Eric,

thanks for considering this patch.  Feel free to change the term to
anything more appropriate.


 In my opinion using the :file argument as a description changes (or at
 least adds to) the meaning of the :file header argument.  Is there a
 significant benefit to this behavior?  If not I'd prefer that an empty
 :file-desc header argument have no effect.

My original use case was indeed making a code block to
produce [[file.pdf][file.pdf]] instead of [[file.pdf]] (see
http://permalink.gmane.org/gmane.emacs.orgmode/53941).  So, if you
remove the possibility to specify an empty :file-desc, for me that would
mean to give the file name twice, as in
: #+begin_src R :results graphics :file test2.png :file-desc test2.png
which would be avoidable with my proposed behaviour.

I could live with that, though I'd still prefer not to have to type more
than necessary...

Regards,
Andreas



 Thanks for this patch, which I think adds nice functionality and which I
 would like to apply -- although I'll likely want to make the changes
 above after application.

 Cheers,






 From 698570cb9938ee1f4dd1472cb13b32d08d108cbb Mon Sep 17 00:00:00 2001
 From: Andreas Leha andr...@lehas.net
 Date: Tue, 27 Mar 2012 10:33:32 +0200
 Subject: [PATCH] new source block header argument :filelinkdescr

 ---
  lisp/ob.el |   10 +-
  1 files changed, 9 insertions(+), 1 deletions(-)

 diff --git a/lisp/ob.el b/lisp/ob.el
 index d27a394..0efef3e 100644
 --- a/lisp/ob.el
 +++ b/lisp/ob.el
 @@ -400,6 +400,7 @@ then run `org-babel-pop-to-session'.
  (eval   . ((never query)))
  (exports. ((code results both none)))
  (file   . :any)
 +(filelinkdescr . :any)
  (hlines . ((no yes)))
  (mkdirp . ((yes no)))
  (no-expand)
 @@ -1833,7 +1834,14 @@ code  the results are extracted in the syntax of 
 the source
(progn
  (setq result (org-babel-clean-text-properties result))
  (when (member file result-params)
 -  (setq result (org-babel-result-to-file result
 +  (progn (when (assoc :filelinkdescr (nth 2 info))
 +   (let ((filelinkdescr (or (cdr (assoc :filelinkdescr (nth 2 
 info)))
 +(cdr (assoc :file (nth 2 info)))
 +result)))
 + (when filelinkdescr
 +   (setq result
 + (list result filelinkdescr)
 + (setq result (org-babel-result-to-file result)
  (unless (listp result) (setq result (format %S result
(if (and result-params (member silent result-params))
(progn




Re: [O] [PATCH] Support hour in repeated task cookie

2012-03-31 Thread Takafumi Arakaki
No comments? No one wants to have +3h in SCHEDULED?

--
Takafumi



Re: [O] [PATCH] link descriptions in :file results of src blocks

2012-03-31 Thread Eric Schulte
[...]
 I would like to apply this patch, however I have some questions about
 the use of the :file argument and the result itself to fill in the
 description if the :filelinkdescr header argument is left blank.  Also,
 I would suggest that :file-desc is a better name for this header
 argument.

 Hi Eric,

 thanks for considering this patch.  Feel free to change the term to
 anything more appropriate.


 In my opinion using the :file argument as a description changes (or at
 least adds to) the meaning of the :file header argument.  Is there a
 significant benefit to this behavior?  If not I'd prefer that an empty
 :file-desc header argument have no effect.

 My original use case was indeed making a code block to
 produce [[file.pdf][file.pdf]] instead of [[file.pdf]] (see
 http://permalink.gmane.org/gmane.emacs.orgmode/53941).  So, if you
 remove the possibility to specify an empty :file-desc, for me that would
 mean to give the file name twice, as in
 : #+begin_src R :results graphics :file test2.png :file-desc test2.png
 which would be avoidable with my proposed behaviour.

 I could live with that, though I'd still prefer not to have to type more
 than necessary...


Makes sense, I've just pushed up a solution which builds on your initial
patch by

1. changing :filelinkdescr to :file-desc

2. when an empty :file-desc header argument is specified it's value is
   set to the value of the file path resulting in
   [[file.pdf][file.pdf]]

3. adding documentation and a test case

Please let me know if this misses any part of your intended use case.

Thanks for the contribution!

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



[O] Python code block hangs with :session if python-mode is loaded

2012-03-31 Thread Richard Stanton
I have python-mode (latest version from Launchpad) set up to handle python 
editing in Emacs.

Using orgmode, the following code block runs fine if Ipress C-c C-c, producing 
the (correct) output shown:

#+begin_src python :results output
print %d + %d = %d % (2, 3, 2+3)
2**5
#+end_src

#+RESULTS:
: 2 + 3 = 5

If I do not have (require 'python-mode) in my init.el, the following also works 
fine:

#+begin_src python :results output :session
print %d + %d = %d % (2, 3, 2+3)
2**5
#+end_src

#+RESULTS:
: 2 + 3 = 5
: 32

However, if (require 'python-mode) is in my init.el file, pressing C-c C-c in 
the second code block causes Emacs to hang with the message Executing python 
code block. I can get out  by pressing C-g, but it never returns otherwise.





[O] [patch] Re: meaning of body-only in org-export-as-html

2012-03-31 Thread Chris Gray
Hi Myles,

Sorry I missed your email for so long.

On Thu, 22 Mar 2012 14:51:29 +, Myles English mylesengl...@gmail.com 
wrote:
 
 Hi Chris,
 
  On Fri, 16 Mar 2012 16:33:22 -0600, Chris Gray said:
 
Hello, I am using org-export-as-html with the body-only parameter
set to t in the org plugin for ikiwiki that I'm working on.  It
works almost perfectly, but I recently had a user point out that
it's not possible to get a table of contents, even when one is
explicitly asked for in the #+OPTIONS line of the org file.
 
Since the table of contents is part of the body (at least in the
sense that it is between the body tags), I found this surprising.
So would it cause problems to change the line
 
(if (and org-export-with-toc (not body-only)) ...)
 
to
 
(if org-export-with-toc ...)
 
in org-export-as-html?
 
 I see one problem in that it would be then be inconsistent with
 org-export-as-ascii which considers the TOC to be part of the header.  I
 would like to be able to export just the TOC (as ascii, and I understand
 a new ascii exporter has been written lately).  The same thing for the
 html exporter would presumably solve your problem too because then you
 could export TOC+body (as html)?

The thing is, the docstring is not consistent with the code.  It would
make my life easier if the code was changed to match the docstring, but
I would also be okay if the opposite happened.

I am also looking forward to the new exporter being ready, but I guess
this small issue should be fixed in the current exporter until it is.

I have attached the patch that I suggested for the HTML exporter.

Cheers,
Chris

From 9f91361e8c8cd7047acf0260bff2ae81e72fcc93 Mon Sep 17 00:00:00 2001
From: Chris Gray chrismg...@gmail.com
Date: Sat, 31 Mar 2012 16:35:04 -0600
Subject: [PATCH] Bring the meaning of body-only in org-export-as-html closer
 to docs

The docstring for org-export-as-html says When BODY-ONLY is set,
don't produce the file header and footer, simply return the content of
body.../body, without even the body tags themselves.  However, it
currently also inhibits the generation of the table of contents,
regardless if one is asked for by the user in the #+OPTIONS line of
the file.  This patch fixes that (i.e. allows for toc generation if it
is requested).
---
 lisp/org-html.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-html.el b/lisp/org-html.el
index 2de2ea9..cb785f3 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -1402,7 +1402,7 @@ PUB-DIR is set, use this as the publishing directory.
 		\nh1 class=\title\ title /h1\n))
 
   ;; insert body
-  (if (and org-export-with-toc (not body-only))
+  (if org-export-with-toc
 	  (progn
 	(push (format h%d%s/h%d\n
 			  org-export-html-toplevel-hlevel
-- 
1.7.9



Re: [O] [PATCH] Allow org-collector to display heading indentation

2012-03-31 Thread Nicolas Girard
2012/3/31 Sebastien Vauban wxhgmqzgw...@spammotel.com:

 You may want to follow the indent convention used for clockview: \__
 string.

 Have a look at (or reuse?) the function `org-clocktable-indent-string'...


Hi Sébastien,
fair enough ; not that I like underscores much better but it makes
sense for the indentation in both tables to be similar.
I've rewritten my code in this respect.

Cheers,
Nicolas



[O] [PATCH 1/2] Simplify org-clocktable-indent-string.

2012-03-31 Thread Nicolas Girard
---
 lisp/org-clock.el |6 +-
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 591f59c..be66ce6 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2342,11 +2342,7 @@ from the dynamic block definition.
 (defun org-clocktable-indent-string (level)
   (if (= level 1)
   
-(let ((str \\__))
-  (while ( level 2)
-   (setq level (1- level)
- str (concat str ___)))
-  (concat str  
+(concat \\ (make-string (* 2 (1- level)) ?_ )  )))
 
 (defun org-clocktable-steps (params)
   Step through the range to make a number of clock tables.
-- 
1.7.8.rc1




[O] [PATCH 2/2] Allow org-collector to display heading indentation by passing ':indent t' to the propview block.

2012-03-31 Thread Nicolas Girard
---
 contrib/lisp/org-collector.el |   22 +-
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/contrib/lisp/org-collector.el b/contrib/lisp/org-collector.el
index da612e9..2f5e598 100644
--- a/contrib/lisp/org-collector.el
+++ b/contrib/lisp/org-collector.el
@@ -91,6 +91,7 @@
 
 ;;; Code:
 (require 'org)
+(require 'org-clock)
 (require 'org-table)
 
 (defvar org-propview-default-value 0
@@ -98,6 +99,11 @@
 value is calculated either through lack of required variables for
 a column, or through the generation of an error.)
 
+(defvar org-propview-indent-function 'org-clocktable-indent-string
+  A function called with the heading level. Should return a
+string which will be concatenated to the ITEM property when
+':indent t' is passed to the propview block.)
+
 (defun and-rest (list)
   (if (listp list)
   (if ( (length list) 1)
@@ -121,6 +127,7 @@ preceeding the dblock, then update the contents of the 
dblock.
(scope (plist-get params :scope))
(noquote (plist-get params :noquote))
(colnames (plist-get params :colnames))
+   (indent (plist-get params :indent))
(content-lines (org-split-string (plist-get params :content) \n))
id table line pos)
(save-excursion
@@ -134,8 +141,8 @@ preceeding the dblock, then update the contents of the 
dblock.
  (org-narrow-to-subtree)
  (setq stringformat (if noquote %s %S))
  (setq table (org-propview-to-table
-  (org-propview-collect cols stringformat conds match 
scope inherit 
-(if colnames colnames cols)) 
stringformat))
+  (org-propview-collect cols stringformat conds match 
scope inherit
+(if colnames colnames cols) 
indent) stringformat))
  (widen))
(setq pos (point))
(when content-lines
@@ -171,14 +178,19 @@ variables and values specified in props
 (when p (cons n p
 inherit
 
-(defun org-propview-collect (cols stringformat optional conds match scope 
inherit colnames)
+(defun org-propview-collect (cols stringformat optional conds match scope 
inherit colnames indent)
   (interactive)
   ;; collect the properties from every header
   (let* ((header-props
  (let ((org-trust-scanner-tags t) alst)
(org-map-entries
-(quote (cons (cons ITEM (org-get-heading t))
- (org-propview-get-with-inherited inherit)))
+(quote
+ (cons (cons ITEM
+ (let ((item (org-get-heading t))
+   (level (org-current-level)))
+   (concat
+(funcall org-propview-indent-function level) 
item)))
+  (org-propview-get-with-inherited inherit)))
 match scope)))
 ;; read property values
 (header-props
-- 
1.7.8.rc1