[O] Re: org-publish not publishing changed files

2011-03-22 Thread Aidan Gauland
Nick Dokos  hp.com> writes:
> > How can I get the timestamps in a more human-readable format?  I keep
> > having this problem (and no symlinks involved) and keep having to wipe
> > the timestamps directory (a royal nuisance).
> 
> Doesn't the prefix argument work? C-u C-c C-e followed by F or P or X or E
> should republish whatever you specified (file, current project, some project
> or all projects resp.), no matter what the cache says.

Yes it does.  Sorry, I should have worded that differently.  I meant
that I have been repeatedly wiping ~/.org-timestamps/ in hopes that it
will not get screwed up again and think none of my files have changed,
and never re-publishes changed files (after an initial org-publish
operation).  I think I have run into a bug in org-mode and I really
want to track it down, so I thought the best place to start would be
to look at what the timestamps are (in a human-readable format).

--Aidan





Re: [O] "Tag hierarchy" idea

2011-03-22 Thread Christian Moe

Hi,

There was some discussion of tag hierarchies in this thread:

http://thread.gmane.org/gmane.emacs.orgmode/31882

It was largely inconclusive, except that it would be hard to 
implement. Noone took the ball and ran with it, but then noone came up 
with a strong use case or specification, either. Anyway, I recommend a 
look at that thread before continuing it here.


Yours,
Christian

On 3/22/11 12:09 AM, John Tait wrote:

Hi all

This is my first post. First, I'd like to thank all the org-mode
developers for a great tool.

I'm a technical editor. I am facinated by the pros and cons of
structured documents with regard to their ease of use and power. I
think that they are probably far too restrictive and cumbersome
(looking at you, DITA) for the average technical document.
Nevertheless, the idea of modular documents is an appealing one to me.
I like conditional text features (e.g. in LyX).

In org-mode, I really really love selective export (include/exclude
tags) and using #+INCLUDE: for including other files. This gives me
enormous flexibility, with zero DITA pain.

May I propose an additional feature? I haven't seen anything like it
published anywhere, though maybe I am using the incorrect search
terms. (I am getting enormous vertigo and time-travel sickness reading
up on Lisp, XML, DITA, etc.)

It's a pretty basic idea, but I hope you can take a moment to weigh up
its potential.

We could assign tags to hierarchies of other tags.


#+TAG-NEST: (colour(red green blue))
#+TAG-NEST: (type(colour size))
#+TAG-NEST: (car(type price))

or maybe like this. I'd leave it up to someone with actual programming
experience and a logical mind (my productive programming was PASCAL in
1991) to suggest a rigorous system that makes sense.

#+TAG-NEST: colour > red:green:blue
#+TAG-NEST: type > colour:size
#+TAG-NEST: car > type:price

The point of this would be that selecting, say, "colour" as a tag
would bring along "red", "green", and "blue" along with it. The tag
"type" would bring "colour", "red", "green", "blue" and "size" with it.

The power of this would be that hierarchies could be adjusted and
manipulated as necessary.

Since there is no one definitive way to tag real world objects and
ideas into nice nested boxes (thanks, AI research), we could adjust
any tag hierarchies to suit experience and changing priorities. Even
hierarchies could just be thrown away without affecting existing tags
too much, since tagged headings could just be selected/excluded as usual.

This way, we can use concept hierarchies as the disposable
conveniences that they are, without getting locked into them. Looking
at stuff like XSLT transformation for XML, that'd be worth avoiding.

Maybe there is some logical lispy reason why this couldn't work, but I
hope this is worthy of your consideration.

John

--

While I am here (sorry), I couldn't get #+FILETAGS: to work in
org-version 7.4.

For example, if I export a file (to html) File1.org  with
"#+EXPORT_EXCLUDE_TAGS: john", and then I include File2.org, I can see
File2.org included as part the export of File1 as expected. If I then
set "#+FILETAGS: :john:" in File2, I'd expect File2 to now be
excluded, but it still appears. If I then tag a File2 heading as say
"* Heading :john:", then it won't appear in the File1 export, as
expected. Am I missing something?






[O] Re: org-src-fontify-natively makes things very, very slow

2011-03-22 Thread Ulf Stegemann
Hi Sébastien, Eric,

I'm experiencing the same performance problems with recent org-mode.  My
observations are ...

Sébastien Vauban  wrote:

> Eric S Fraga wrote:
>>
>> From these timings, the font locking doesn't seem to be the issue but maybe
>> the overlays are. However, commenting out the code that Sébastien Vauban
>> indicated:
>>
>>> Maybe this is (partly?) due to the overlay I added:
>>>
>>> #+begin_src emacs-lisp
>>> (overlay-put (make-overlay beg1 block-end)
>>>  'face 'org-block-background))
>>> #+end_src
>
> See http://patchwork.newartisans.com/patch/581/ for a full diff. You can see I
> only add *one* overlay: for the background face.
>
>> (well, commenting out the whole condition that includes this code) makes no
>> difference at all.

That's true. It does not make any difference performance-wise.

>> So, I turned off =org-src-fontify-natively= and things are back to
>> normal: next-line is as fast as previous-line.  I can put up without the
>> fontification so this is what I am doing now.

It's true that setting `org-src-fontify-natively' to nil boosts
performance but it's only half the story.  Editing something inside
blocks also has a significant negative influence on display performance.
Removing things like `#+BEGIN_letter' / `#+END_letter' from the file
gets things back to normal for me.

Ulf





Re: [O] org table calc and lisp for hh:mm timetable

2011-03-22 Thread Christian Moe

Hi,

If we're not just looking for a neat workaround for some special cases 
anymore, but looking at making org-tables aware of time-like strings 
by default, a better strategy than to convert them into integers might 
be to translate them into Calc time format and back again.


After all, Calc and hence the Org spreadsheet already handles time 
arithmetic perfectly well, it's just that it would be nice to have 
this functionality with the extra option to enter and display times as 
=12:45= rather than =12@ 45'= or =12h 45m=.


(Personally, I can live with a =12h 45m= format, which is already a 
Calc option: info:calc#HMS%20Forms, info:calc#HMS%20Formats.)


Consider this:

| Departure  | Travel time | Arrival|
|+-+|
| [2011-03-22 Tue 23:15] | 7@ 05'  | <2011-03-23 Wed 06:20> |
#+TBLFM: $3=<$1>+$2

With Calc, you can add a HMS time to a date-time and get the resulting 
date-time. However, Calc apparently interprets integers as days, not 
minutes or seconds. So if you convert 7:05 to an integer (425) and add 
it to a date-time, you get a date about one year and two months ahead. 
(Converting 7:05 to the integer 0.295139 days would work... but with 
rounding problems.)


The Org spreadsheet already allows us to give the date-time as an 
Org-style timestamp rather than in the Calc date format by using the 
angle brackets in the formula. The solution would be similar option 
for time-like strings, so we could write the travel time above as 
=7:05=, and so the result below would be returned as =7:05=.


| Arrival| Departure  | Travel time |
|++-|
| <2011-03-23 Wed 06:20> | [2011-03-22 Tue 23:15] | 7@ 5' 0"|
#+TBLFM: $3=time(<$1>-<$2>)

Yours,
Christian




On 3/22/11 5:40 AM, Eric Schulte wrote:


While this topic is raised, would it make sense for Org-mode table
formula to automatically parse any time-like string into time units
(i.e., base sixty).  That would be the easiest for most users, and (I
imagine) would rarely result in surprising and unexpected behavior.



So, I took a shot at folding this into org-table.el, the resulting patch
is attached.  I'm not sure if this sort of automatic interpretation of
time-like strings into integers is a good idea, or if this is the best
implementation (I'm not incredibly familiar with Org's table handling)
but after a couple of simple tests the patch does seem to work.  For
example the following...

| 2:30 | 2 | 75 |
#+TBLFM: $3=$1/$2

It may make sense to also include functionality for converting the
result back into a time string, e.g.

#+begin_src emacs-lisp
   (defun org-time-seconds-to-string (secs)
 "Convert a number of seconds to a time string."
 (cond ((>= secs 3600) (format-seconds "%h:%.2m:%.2s" secs))
   ((>= secs 60) (format-seconds "%m:%.2s" secs))
   (t (format-seconds "%s" secs
#+end_src

| 2:30 | 2 | 1:15 |
#+TBLFM: $3='(org-time-seconds-to-string (/ (string-to-number $1) 
(string-to-number $2)))

While the above is cumbersome, there may be a simpler syntax or
convention -- e.g., whenever one of the inputs is a time string then the
results are displayed as a time string.  Not sure what the best option
is here, but thought this patch may spur some good suggestions.

Best -- Eric






Re: [O] publishing org-mode to google docs

2011-03-22 Thread Bastien
Hi Daniel,

Daniel Mahler  writes:

> What is the best way to publishh org-mode outlines to google docs.

Export your Org file in HTML, then import the HTML in Google Docs.

Or wait till the ODT exporter is integrated into Org-mode and work 
from that.

Best,

PS: for such big problems/questions, it's always useful to try to 
tell us what you tried, what documentation you read, and where you 
are stuck -- it gives you better chances to have a useful answer.

-- 
 Bastien



[O] [Accepted] [O, 1/3] Replace recursive implementation with an iterative one

2011-03-22 Thread Bastien Guerry
Patch 707 (http://patchwork.newartisans.com/patch/707/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3C1300720268-9375-2-git-send-email-christian.egli%40alumni.ethz.ch%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O,1/3] Replace recursive implementation with an iterative one
> Date: Mon, 21 Mar 2011 20:11:06 -
> From: Christian Egli 
> X-Patchwork-Id: 707
> Message-Id: <1300720268-9375-2-git-send-email-christian.e...@alumni.ethz.ch>
> To: emacs-orgmode@gnu.org
> Cc: Christian Egli 
> 
> From: Christian Egli 
> 
> * org-taskjuggler.el (org-taskjuggler-assign-resource-ids): Replace
> recursive implementation with an iterative one.
> 
> That way we can avoid to have ask users to increase
> `max-lisp-eval-depth'.
> 
> ---
> lisp/org-taskjuggler.el |   16 +++-
>  1 files changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el
> index 9c88f5d..279f46d 100644
> --- a/lisp/org-taskjuggler.el
> +++ b/lisp/org-taskjuggler.el
> @@ -418,15 +418,13 @@ deeper), then it's not a leaf."
>  (defun org-taskjuggler-assign-resource-ids (resources)
>"Given a list of resources return the same list, assigning a
>  unique id to each resource."
> -  (cond
> -   ((null resources) nil)
> -   (t
> -(let* ((resource (car resources))
> -(unique-id (org-taskjuggler-get-unique-id resource unique-ids)))
> -  (push (cons "unique-id" unique-id) resource)
> -  (cons resource
> - (org-taskjuggler-assign-resource-ids (cdr resources)
> -  (cons unique-id 
> unique-ids)))
> +  (let (unique-ids new-list)
> +(dolist (resource resources new-list)
> +  (let ((unique-id (org-taskjuggler-get-unique-id resource unique-ids)))
> + (push (cons "unique-id" unique-id) resource)
> + (push unique-id unique-ids)
> + (push resource new-list)))
> +(nreverse new-list)))
>  
>  (defun org-taskjuggler-resolve-dependencies (tasks)
>(let ((previous-level 0)
> 



[O] [Accepted] [O, 1/3] Replace recursive implementation with an iterative one

2011-03-22 Thread Bastien Guerry
Patch 707 (http://patchwork.newartisans.com/patch/707/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3C1300720268-9375-2-git-send-email-christian.egli%40alumni.ethz.ch%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O,1/3] Replace recursive implementation with an iterative one
> Date: Mon, 21 Mar 2011 20:11:06 -
> From: Christian Egli 
> X-Patchwork-Id: 707
> Message-Id: <1300720268-9375-2-git-send-email-christian.e...@alumni.ethz.ch>
> To: emacs-orgmode@gnu.org
> Cc: Christian Egli 
> 
> From: Christian Egli 
> 
> * org-taskjuggler.el (org-taskjuggler-assign-resource-ids): Replace
> recursive implementation with an iterative one.
> 
> That way we can avoid to have ask users to increase
> `max-lisp-eval-depth'.
> 
> ---
> lisp/org-taskjuggler.el |   16 +++-
>  1 files changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el
> index 9c88f5d..279f46d 100644
> --- a/lisp/org-taskjuggler.el
> +++ b/lisp/org-taskjuggler.el
> @@ -418,15 +418,13 @@ deeper), then it's not a leaf."
>  (defun org-taskjuggler-assign-resource-ids (resources)
>"Given a list of resources return the same list, assigning a
>  unique id to each resource."
> -  (cond
> -   ((null resources) nil)
> -   (t
> -(let* ((resource (car resources))
> -(unique-id (org-taskjuggler-get-unique-id resource unique-ids)))
> -  (push (cons "unique-id" unique-id) resource)
> -  (cons resource
> - (org-taskjuggler-assign-resource-ids (cdr resources)
> -  (cons unique-id 
> unique-ids)))
> +  (let (unique-ids new-list)
> +(dolist (resource resources new-list)
> +  (let ((unique-id (org-taskjuggler-get-unique-id resource unique-ids)))
> + (push (cons "unique-id" unique-id) resource)
> + (push unique-id unique-ids)
> + (push resource new-list)))
> +(nreverse new-list)))
>  
>  (defun org-taskjuggler-resolve-dependencies (tasks)
>(let ((previous-level 0)
> 



[O] [Accepted] [O,2/3] Fix allocations handling for tj3

2011-03-22 Thread Bastien Guerry
Patch 708 (http://patchwork.newartisans.com/patch/708/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3C1300720268-9375-3-git-send-email-christian.egli%40alumni.ethz.ch%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O,2/3] Fix allocations handling for tj3
> Date: Mon, 21 Mar 2011 20:11:07 -
> From: Christian Egli 
> X-Patchwork-Id: 708
> Message-Id: <1300720268-9375-3-git-send-email-christian.e...@alumni.ethz.ch>
> To: emacs-orgmode@gnu.org
> Cc: Christian Egli 
> 
> From: Christian Egli 
> 
> * org-taskjuggler.el (org-taskjuggler-open-task): Only emit a "purge
> allocations" statement if we are not targeting tj3.
> 
> ---
> lisp/org-taskjuggler.el |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el
> index 279f46d..bcf2c45 100644
> --- a/lisp/org-taskjuggler.el
> +++ b/lisp/org-taskjuggler.el
> @@ -660,8 +660,8 @@ org-mode priority string."
> (format " depends %s\n" previous-sibling)
>   (and depends (format " depends %s\n" depends)))
>(and allocate (format " purge %s\n allocate %s\n"
> - (or (and (org-taskjuggler-targeting-tj3-p) 
> "allocations")
> - "allocate")
> + (or (and (org-taskjuggler-targeting-tj3-p) 
> "allocate")
> + "allocations")
>   allocate))
>(and complete (format " complete %s\n" complete))
>(and effort (format " effort %s\n" effort))
> 



[O] [Accepted] [O,3/3] Fix a typo in the commentary.

2011-03-22 Thread Bastien Guerry
Patch 706 (http://patchwork.newartisans.com/patch/706/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3C1300720268-9375-4-git-send-email-christian.egli%40alumni.ethz.ch%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O,3/3] Fix a typo in the commentary.
> Date: Mon, 21 Mar 2011 20:11:08 -
> From: Christian Egli 
> X-Patchwork-Id: 706
> Message-Id: <1300720268-9375-4-git-send-email-christian.e...@alumni.ethz.ch>
> To: emacs-orgmode@gnu.org
> Cc: Christian Egli 
> 
> From: Christian Egli 
> 
> * org-taskjuggler.el: Fix a typo in the commentary.
> 
> ---
> lisp/org-taskjuggler.el |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el
> index bcf2c45..f891634 100644
> --- a/lisp/org-taskjuggler.el
> +++ b/lisp/org-taskjuggler.el
> @@ -144,7 +144,7 @@
>  ;;   - Look at org-file-properties, org-global-properties and
>  ;; org-global-properties-fixed
>  ;;   - What about property inheritance and org-property-inherit-p?
> -;;   - Use TYP_TODO as an way to assign resources
> +;;   - Use TYPE_TODO as an way to assign resources
>  ;;   - Make sure multiple dependency definitions (i.e. BLOCKER on
>  ;; previous-sibling and on a specific task_id) in multiple
>  ;; attributes are properly exported.
> 



[Accepted] [O] Tiny docstring fix in org-footnote.el

2011-03-22 Thread Bastien Guerry
Patch 699 (http://patchwork.newartisans.com/patch/699/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3CAANLkTimwvM19SrZhMiebE390MZP6%3Dym497oVFz5a4RJ6%40mail.gmail.com%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O] Tiny docstring fix in org-footnote.el
> Date: Fri, 18 Mar 2011 16:44:44 -
> From: Puneeth Chaganti 
> X-Patchwork-Id: 699
> Message-Id: 
> To: emacs-orgmode 
> 
> Hi,
> 
> A tiny docstring fix in org-footnote.el
> 
> 
> diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
> index 9dbd6be..90147d2 100644
> --- a/lisp/org-footnote.el
> +++ b/lisp/org-footnote.el
> @@ -160,7 +160,7 @@ If yes, return the beginning position, the label, and the 
> definition, if local."
>  (defun org-footnote-at-definition-p ()
>"Is the cursor at a footnote definition.
>  This matches only pure definitions like [1] or [fn:name] at the beginning
> -of a line.  It does not a references like [fn:name:definition], where the
> +of a line.  It does not match references like [fn:name:definition], where the
>  footnote text is included and defined locally.
>  The return value will be nil if not at a footnote definition, and a list
>  with start and label of the footnote if there is a definition at point."
> 



Re: [O] [PATCH 0/3] Small fixes to taskjuggler export

2011-03-22 Thread Bastien
Hi Christian,

Christian Egli  writes:

> Here are some more small fixes to taskjuggler export

I've applied them -- thanks!

-- 
 Bastien



Re: [O] How to reuse page keywords for LaTeX with pdfkeywords and hyperref package?

2011-03-22 Thread Bastien
Hi Mikhail,

"Mikhail Titov"  writes:

> I would like to be able to have same keywords for both HTML and PDF
> output. I was a bit surprised that it is not there yet. I’m not a lisp
> user:( Could someone suggest what needs to be done to use
> org-export-page-keywords to set the value of pdfkeywords option of hyperref
> LaTeX package?

This is not possible right now.  You can do it manually by removing
hyperref from the `org-export-latex-default-packages-alist' variable,
and by adding such a header in your org file:

#+LATEX_HEADER: \usepackage[dvips, bookmarks, colorlinks=false,
   pdftitle={An example PDF file from LaTeX}, pdfauthor={Diego Santa
   Cruz}, pdfsubject={From LaTeX to PDF}, pdfkeywords={PDF, LaTeX,
hyperlinks, hyperref}]{hyperref} 

But your request makes sense, I might implement it someday.

Best,

-- 
 Bastien



Re: [O] Re: Completing with anything

2011-03-22 Thread Aankhen
On Mon, Mar 21, 2011 at 22:34, Julien Danjou  wrote:
> On Mon, Mar 21 2011, Stefan Monnier wrote:
>
>> As Tassilo mentions, maybe we could have a post-completion step that can
>> perform some kind of expansion/replacement/cleanup once a valid
>> completion is selected.  I'm not sure what that would look like in terms
>> of code and API, but if someone wants to try it out a propose a patch to
>> start a discussion, maybe we could add such a thing.
>
> Or maybe an upper layer mixing abbrev and completion? Trying one at
> first, the other one after. This could be useful for message-mode for
> example, since you probably wants to use both.

Isn’t this what hippie-expand does?



Re: [O] org table calc and lisp for hh:mm timetable

2011-03-22 Thread Carsten Dominik

On 22.3.2011, at 05:40, Eric Schulte wrote:

>> 
>> While this topic is raised, would it make sense for Org-mode table
>> formula to automatically parse any time-like string into time units
>> (i.e., base sixty).  That would be the easiest for most users, and (I
>> imagine) would rarely result in surprising and unexpected behavior.
>> 
> 
> So, I took a shot at folding this into org-table.el, the resulting patch
> is attached.  I'm not sure if this sort of automatic interpretation of
> time-like strings into integers is a good idea, or if this is the best
> implementation (I'm not incredibly familiar with Org's table handling)
> but after a couple of simple tests the patch does seem to work.  For
> example the following...
> 
> | 2:30 | 2 | 75 |
> #+TBLFM: $3=$1/$2

I think it might be a bit bold to turn this on by default.
How about introducing another flag for the formula to turn
on time string processing like this? 

- Carsten

> 
> It may make sense to also include functionality for converting the
> result back into a time string, e.g.
> 
> #+begin_src emacs-lisp
>  (defun org-time-seconds-to-string (secs)
>"Convert a number of seconds to a time string."
>(cond ((>= secs 3600) (format-seconds "%h:%.2m:%.2s" secs))
>  ((>= secs 60) (format-seconds "%m:%.2s" secs))
>  (t (format-seconds "%s" secs
> #+end_src
> 
> | 2:30 | 2 | 1:15 |
> #+TBLFM: $3='(org-time-seconds-to-string (/ (string-to-number $1) 
> (string-to-number $2)))
> 
> While the above is cumbersome, there may be a simpler syntax or
> convention -- e.g., whenever one of the inputs is a time string then the
> results are displayed as a time string.  Not sure what the best option
> is here, but thought this patch may spur some good suggestions.
> 
> Best -- Eric
> 
> From 76b416013ee4c9a492c8ddced57727215165c298 Mon Sep 17 00:00:00 2001
> From: Eric Schulte 
> Date: Mon, 21 Mar 2011 19:43:19 -0600
> Subject: [PATCH] org-table: convert times to integers on table formula 
> evaluation
> 
> * lisp/org-table.el (org-table-to-time): If cell contents look like a
>  time string, then converts to an integer.
>  (org-table-eval-formula): Convert times to integers on table formula
>  evaluation.
> ---
> lisp/org-table.el |   26 ++
> 1 files changed, 22 insertions(+), 4 deletions(-)
> 
> diff --git a/lisp/org-table.el b/lisp/org-table.el
> index 3573032..3674b53 100644
> --- a/lisp/org-table.el
> +++ b/lisp/org-table.el
> @@ -2273,6 +2273,21 @@ of the new mark."
> (cons var (cons value modes)))
>   modes)
> 
> +(defun org-table-to-time (s)
> +  "Convert cell to numerical time if contents look like a time string."
> +  (cond
> +   ((and (stringp s)
> +  (string-match "\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\)" s))
> +(let ((hour (string-to-number (match-string 1 s)))
> +   (min (string-to-number (match-string 2 s)))
> +   (sec (string-to-number (match-string 3 s
> +  (+ (* hour 3600) (* min 60) sec)))
> +   ((and (stringp s)
> +  (string-match "\\([0-9]+\\):\\([0-9]+\\)" s))
> +(let ((min (string-to-number (match-string 1 s)))
> +   (sec (string-to-number (match-string 2 s
> +  (+ (* min 60) sec)
> +
> (defun org-table-eval-formula (&optional arg equation
>suppress-align suppress-const
>suppress-store suppress-analysis)
> @@ -2369,10 +2384,13 @@ not overwrite the stored one."
> (setq formula (org-table-formula-substitute-names formula)))
>   (setq orig (or (get-text-property 1 :orig-formula formula) "?"))
>   (while (> ndown 0)
> - (setq fields (org-split-string
> -   (org-no-properties
> -(buffer-substring (point-at-bol) (point-at-eol)))
> -   " *| *"))
> + (setq fields (mapcar (lambda (cell)
> +(let ((time (org-table-to-time cell)))
> +  (if time (number-to-string time) cell)))
> +  (org-split-string
> +   (org-no-properties
> +(buffer-substring (point-at-bol) (point-at-eol)))
> +   " *| *")))
>   (if (eq numbers t)
>   (setq fields (mapcar
> (lambda (x) (number-to-string (string-to-number x)))
> -- 
> 1.7.1
> 




[O] Org-mode T-Shirts with small logo

2011-03-22 Thread Carsten Dominik
Hi everyone,

at FOSDEM, someone asked me if T-Shirts with a *small*
icon like I am wearing it some photos are available.
I have talked to my fried hoe made the T-Shirt design,
and these small-icon T-Shirts are now in the European Shop:

http://orgmode.spreadshirt.de/

Cheers

- Carsten




Re: [O] Re: Completing with anything

2011-03-22 Thread Tassilo Horn
Aankhen  writes:

Hi Aankhen,

>> Or maybe an upper layer mixing abbrev and completion? Trying one at
>> first, the other one after. This could be useful for message-mode for
>> example, since you probably wants to use both.
>
> Isn’t this what hippie-expand does?

Oh, yes, it seems so.  For example, there is the possible expansion (not
completion) function:

,[ C-h f try-expand-all-abbrevs RET ]
| try-expand-all-abbrevs is a compiled Lisp function in `hippie-exp.el'.
| 
| (try-expand-all-abbrevs OLD)
| 
| Try to expand word before point according to all abbrev tables.
| The argument OLD has to be nil the first call of this function, and t
| for subsequent calls (for further possible expansions of the same
| string).  It returns t if a new expansion is found, nil otherwise.
`

The OLD arg in hippie-expansion functions also handles the case of
cycling thru possible expansions, where an expansion erases the text
that was expanded.

So Julien, maybe you want a `try-expand-org-contact' function, and add
that to `hippie-expand-try-functions-list', and bind `hippie-expand' to
some key.

Bye,
Tassilo



Re: [O] Re: Completing with anything

2011-03-22 Thread Julien Danjou
On Tue, Mar 22 2011, Tassilo Horn wrote:

> So Julien, maybe you want a `try-expand-org-contact' function, and add
> that to `hippie-expand-try-functions-list', and bind `hippie-expand' to
> some key.

I want to integrate into message-mode. So I don't want to bind any key,
nor rebind . :)

-- 
Julien Danjou
❱ http://julien.danjou.info


pgpwGcV8qLyTq.pgp
Description: PGP signature


[O] unnumbered subsections in latex export

2011-03-22 Thread Suvayu Ali
Hi Orgers,

I was wondering whether there is some way to export the attached org
file to latex such that headlines beyond level 2 (3 and onwards) can
be exported as unnumbered subsections or subsubsections like this,
\subsection*{}, instead of enclosing them within itemize.

The file uses the following options header:

#+OPTIONS:   H:2 num:t toc:t ::t |:t ^:t -:t f:t *:t <:nil

-- 
Suvayu

Open source is the future. It sets us free.
#+TITLE: A path breaking discovery
#+AUTHOR:Suvayu Ali
#+DATE:  <2011-03-22 Tue>
#+OPTIONS:   H:2 num:t toc:t ::t |:t ^:t -:t f:t *:t <:nil
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:nil pri:nil tags:nil


* Chapter One

** Background

*** The Standard Model

Its a thing of beauty!

*** Symmetry gauge group

The SM symmetry gauge group is $SU(3) \times SU(2) \times U(1)$.

** Some section

   With some discoveries


[O] Re: unnumbered subsections in latex export

2011-03-22 Thread Sébastien Vauban
Hi Suvayu,

Suvayu Ali wrote:
> Hi Orgers,
>
> I was wondering whether there is some way to export the attached org
> file to latex such that headlines beyond level 2 (3 and onwards) can
> be exported as unnumbered subsections or subsubsections like this,
> \subsection*{}, instead of enclosing them within itemize.
>
> The file uses the following options header:
>
> #+OPTIONS:   H:2 num:t toc:t ::t |:t ^:t -:t f:t *:t <:nil

Using H:3 num:2?  Untested... But that should do the work.

Best regards,
  Seb

-- 
Sébastien Vauban




Re: [O] Re: Completing with anything

2011-03-22 Thread Tassilo Horn
Julien Danjou  writes:

>> So Julien, maybe you want a `try-expand-org-contact' function, and
>> add that to `hippie-expand-try-functions-list', and bind
>> `hippie-expand' to some key.
>
> I want to integrate into message-mode. So I don't want to bind any
> key, nor rebind . :)

Ok, I see.  But at least the functionality is already there.  The task
of embedding that into a good, non-obtrusive, always-working user
interface is left as a task to the developer. :-P

IMHO, hippie-expand is a pretty nice feature with a good interface, both
from a user as well as developer view.  I would not object to rebinding
M-/ from `dabbrev-expand' to `hippie-expand', and make the default value
of `hippie-expand-try-functions-list' '(dabbrev-expand).  But that's
just me...

Bye,
Tassilo



Re: [O] Re: unnumbered subsections in latex export

2011-03-22 Thread Suvayu Ali
Hi Sébastien,

On Tue, 22 Mar 2011 13:20:29 +0100
Sébastien Vauban  wrote:
> >
> > I was wondering whether there is some way to export the attached org
> > file to latex such that headlines beyond level 2 (3 and onwards) can
> > be exported as unnumbered subsections or subsubsections like this,
> > \subsection*{}, instead of enclosing them within itemize.
> >
> > The file uses the following options header:
> >
> > #+OPTIONS:   H:2 num:t toc:t ::t |:t ^:t -:t f:t *:t <:nil
> 
> Using H:3 num:2?  Untested... But that should do the work.
> 

That didn't work. It exports the same as the following options

#+OPTIONS:   H:3 num:t toc:t ::t |:t ^:t -:t f:t *:t <:nil

I think the num option is a boolean. The manual says the following:

 num:   turn on/off section-numbers

Would it be a worthwhile feature request to allow numbers for that
option? Then one could have finer control on the numbering.

> Best regards,
>   Seb
> 

Thanks,

-- 
Suvayu

Open source is the future. It sets us free.



[O] Re: unnumbered subsections in latex export

2011-03-22 Thread Sébastien Vauban
Hi Suvayu,

Suvayu Ali wrote:
> On Tue, 22 Mar 2011 13:20:29 +0100
> Sébastien Vauban  wrote:
>> >
>> > I was wondering whether there is some way to export the attached org file
>> > to latex such that headlines beyond level 2 (3 and onwards) can be
>> > exported as unnumbered subsections or subsubsections like this,
>> > \subsection*{}, instead of enclosing them within itemize.
>> >
>> > The file uses the following options header:
>> >
>> > #+OPTIONS:   H:2 num:t toc:t ::t |:t ^:t -:t f:t *:t <:nil
>> 
>> Using H:3 num:2? Untested... But that should do the work.
>
> That didn't work. It exports the same as the following options
>
> #+OPTIONS:   H:3 num:t toc:t ::t |:t ^:t -:t f:t *:t <:nil
>
> I think the num option is a boolean. The manual says the following:
>
>  num:   turn on/off section-numbers

You're right. I mixed that usage with what's possible for `toc':

--8<---cut here---start->8---
 H: set the number of headline levels for export
 num:   turn on/off section-numbers
 toc:   turn on/off table of contents, or set level limit (integer)
--8<---cut here---end--->8---

> Would it be a worthwhile feature request to allow numbers for that
> option? Then one could have finer control on the numbering.

I think that'd be a good addition.

Best regards,
  Seb

-- 
Sébastien Vauban




[O] beamer code and auctex

2011-03-22 Thread Andrea Crotti
I'm trying to put some nicely colored code in my org-beamer
presentation.

On one machine I have minted but it's not found and the other is not
installed, but I guess that's a latex problem.
With lstlisting it kind of work but the font is way too big and not very
nice, but I'll try again maybe to see if I can get it better...

The problem is that I use auctex for latex files, and the first time it
asks a value for the tex-master file.

Isn't it possible to disable this and why does it asks since I'm using
pdflatex directly, right?

Thanks,
Andrea



[O] Re: Completing with anything

2011-03-22 Thread Dimitri Fontaine
Stefan Monnier  writes:
> As Tassilo mentions, maybe we could have a post-completion step that can
> perform some kind of expansion/replacement/cleanup once a valid
> completion is selected.  I'm not sure what that would look like in terms
> of code and API, but if someone wants to try it out a propose a patch to
> start a discussion, maybe we could add such a thing.

That looks a lot like  (info "(emacs) Mail Aliases").

In particular see mailabbrev.el and the functions
mail-abbrev-insert-alias and mail-abbrev-complete-alias.

Also (add-hook 'message-mode-hook 'mail-abbrevs-setup).

Regards,
-- 
dim



[O] Org babel with multiple linked segments of source code

2011-03-22 Thread Nicholas Patrick
I'm trying to figure out how to minimize the overhead with using babel to
write some segments of code.  I find myself writing short segments of a set
of functionality, then writing a collector source block which is referred to
later on in the code... e.g.

*
#+srcname: test1
#+begin_src clojure :tangle test1.clj :exports none :noweb yes
blah
<>
blah
#+end_src

#+srcname: test2
#+begin_src clojure
foo
#+end_src

#+srcname: test2
#+begin_src clojure
bar
#+end_src
*
I'd like to see
blah
foo
bar
blah

but I see
blah
foo
blah

What I'd like to see is a single srcname for the code that just concatenates
the two different sections when it is referred by <>.
That way I don't have to come up with different names and collectors and so
on and so forth.  Maybe I'm just not doing "literate programming" right, but
when I'm hacking stuff together, I'd like to minimize the housekeeping.
e.g.

Is there a way to do this?


Re: [O] "Tag hierarchy" idea

2011-03-22 Thread John Tait
Thanks for your replies.

I'm using org-mode both as an organiser and also as a way of composing
modular documents with conditional text (controlled by both tags and
#+INCLUDE).

The problem I am trying to solve is one I encounter in my day job.
Basically, I am sitting on top on hundreds of legacy Word documents, each
filled with technical requirements aimed at different audiences. Each
document can itself be aimed at different people and contain various
subjects. This is a typical legacy document problem. It is horrible.

Occasionally, we have to update vast amounts of this stuff as a batch, to
reflect organisational change or other initiative. It is a manual slog.

I am naturally drawn to dealing with this via some kind of structured
document solution. This main problem here is that the information is
inherently unstructured. It awas never written with structure in mind. It is
impossible to impose a structure upon it without starting again.

Attempts by management to enter all this stuff into the IBM DOORS
requirements "database" have been so far been of only "limited success".

We still get asked to produce tailored, filtered summarised information.
These requests usually aren't satisfactorily resolved because a mountain
of crumbling Word documents isn't a good starting point.

That's the problem. Structured documents are an ideal, but totally
impractical.

Examples of requests might be:

  -- show me all the (railway) level crossing requirements in one place.
  -- show all everything to do with track patrolling.
 -- show all everything to do with track patrolling that a track patroller
needs to see (no process or other office stuff).
 -- show me everything a Senior Engineer needs to know about this.

etc.

So there is a certain concept hierarchy beginning to form, but one that is
fluid and maybe only needed once.

I don't want to apply lots of tags only to have to add fresh tags later if
ideas change. On the other hand, some tags would be pretty stable
(:level-crossings:), especially if I was to use an abstraction (":M123:") in
place, so I could change the definition of the tags slightly without
altering the tag. (The definition of ":M123:" could, say, change from "Level
crossing" to "Level crossing and road--rail access points".)

(I used to work for Derwent Patents, applying concept tags to patents for
help with patent searches, so this actually works.)

The power of a tag hierarchy could be that I could alter and create
groups for export very easily. It hard to come up with concrete examples for
something that is just an idea but I will try.

Say there are tags called :level-crossing: and :road--rail-access:  If I
could have a meta tag called ":access: that  I could assign :level-crossing:
and :road--rail-access:  to, I could just use a single tag.

Later, I could add ":gates:" to ":access:." and include those.

Later, I could have a new meta tag called :roads:, and include
":level-crossing:" and "road-bridge".

Then I could have a meta tag called ":patrol:", and include tags for
":level-crossing:" and ":patroller:".

I hope I am illustrating this well enough. The point is that adding
individual tags to headings could be complimented by grouping them under top
level tags. The top level tags could be added to heading as well for maximum
flexibility.

This would provide awesome control and flexibility!

Thanks for your time!

John




On Tue, Mar 22, 2011 at 8:27 AM, Christian Moe wrote:

> Hi,
>
> There was some discussion of tag hierarchies in this thread:
>
> http://thread.gmane.org/gmane.emacs.orgmode/31882
>
> It was largely inconclusive, except that it would be hard to implement.
> Noone took the ball and ran with it, but then noone came up with a strong
> use case or specification, either. Anyway, I recommend a look at that thread
> before continuing it here.
>
> Yours,
> Christian
>
>
> On 3/22/11 12:09 AM, John Tait wrote:
>
>> Hi all
>>
>> This is my first post. First, I'd like to thank all the org-mode
>> developers for a great tool.
>>
>> I'm a technical editor. I am facinated by the pros and cons of
>> structured documents with regard to their ease of use and power. I
>> think that they are probably far too restrictive and cumbersome
>> (looking at you, DITA) for the average technical document.
>> Nevertheless, the idea of modular documents is an appealing one to me.
>> I like conditional text features (e.g. in LyX).
>>
>> In org-mode, I really really love selective export (include/exclude
>> tags) and using #+INCLUDE: for including other files. This gives me
>> enormous flexibility, with zero DITA pain.
>>
>> May I propose an additional feature? I haven't seen anything like it
>> published anywhere, though maybe I am using the incorrect search
>> terms. (I am getting enormous vertigo and time-travel sickness reading
>> up on Lisp, XML, DITA, etc.)
>>
>> It's a pretty basic idea, but I hope you can take a moment to weigh up
>> its potential.
>>
>> We could assign tags to hierarchies of ot

Re: [O] Re: Completing with anything

2011-03-22 Thread Eric S Fraga
Eric Abrahamsen  writes:

[...]

> This is what I've been using to insert other people's contact
> information into emails. Probably no good for general use, but maybe
> will provide food for thought.
>
> #+BEGIN_SRC emacs-lisp
> (defun my-cite-contact (name)
>   (interactive "sName (regexp): ")
>   (let ((rec)
>   (records (bbdb-search (bbdb-records) name name name nil nil)))
> (if (= (length records) 1)
>   (setq rec (car records))
>   (if (zerop (length records))
> (error "No matching records")
>   (setq rec
> (let ((int-name (ido-completing-read "Pick one: "
>  (mapcar 'bbdb-record-name 
> records
>   (car (bbdb-search (bbdb-records) int-name))
> (insert (bbdb-dwim-net-address rec
> #+END_SRC

This looks quite nice; I have been missing the possibility of a regex
search for mail addresses and the combination with ido is quite
appealing.

How do you invoke it?  I am currently struggling with the interactions
between .mailrc (emacs mail aliases, expanding as abbrevs) and bbdb
(expanding with TAB).  This is partly why I haven't even considered
using org-contacts yet...

As always, with Emacs, too many choices, too little time!  ;-)

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.92.gf702.dirty)



[O] Re: "Tag hierarchy" idea

2011-03-22 Thread Matt Lundin
John Tait  writes:

> Thanks for that. But then what are #-FILETAGS for?
>

FILETAGS are primarily used in the agenda -- i.e., filetags are
inherited by the entire file, so when you filter the agenda by tags, the
filetags are also considered.

Not much work has been done to integrate filetags with export.

Perhaps this should be a feature request?

Best,
Matt

> John
>
>
>> Alas, I believe exclude tags only work with trees (not filetags).
>> According to the docstring of org-export-handle-export-tags, "If any of
>> SELECT-TAGS is found, all *trees* not marked by a SELECT-TAG will be
>> removed (emph. mine)."



Re: [O] Re: org-publish not publishing changed files

2011-03-22 Thread Nick Dokos
Aidan Gauland  wrote:

> 
> Yes it does.  Sorry, I should have worded that differently.  I meant
> that I have been repeatedly wiping ~/.org-timestamps/ in hopes that it
> will not get screwed up again and think none of my files have changed,
> and never re-publishes changed files (after an initial org-publish
> operation).  I think I have run into a bug in org-mode and I really
> want to track it down, so I thought the best place to start would be
> to look at what the timestamps are (in a human-readable format).
> 

OK - thanks. I started taking a look at the code, but I'm not getting
anywhere fast, so the more eyes we can have on it the better.

I believe what happens is that the in-memory cache is initialized from
the files in ~/.org-timestamps the first time that you try to publish
(I'm not sure yet when the cache is flushed back out to the files yet).
Here is one of the timestamp files:

,
| (setq org-publish-cache (make-hash-table :test 'equal :weakness nil :size 
100))
| (puthash ":project:" "worg-org-faq" org-publish-cache)
| (puthash ":cache-file:" "/home/nick/.org-timestamps/worg-org-faq.cache" 
org-publish-cache)
| (puthash "Xd2e1407553750278e966c6cda86f154ffa648149" 1299616514 
org-publish-cache)
`

It's a simple key-value store: (puthash key value table) does the
obvious thing, so the timestamp here is 1299616514 for the object with
key Xd2e1407553750278e966c6cda86f154ffa648149. The timestamp is the
ctime of the file, obtained by calling file-attributes, getting the
5th element, the last modification time. This is returned as a list
of two integers (high, low16) which are then combined into a single
integer: that's the time since 1970-01-01:00:00:00, the usual Unix
time. 

In the above case, I calculate as follows (lsh is a shift function -
(lsh val 16) shifts left by 16, (lsh val -16) shifts right by 16):

high bits: (lsh 1299616514 -16) -> 19830
low bits:  (- 1299616514 (lsh 19830 16)) -> 37634

So encoded time is (19830 37364)

Decoded time: (decode-time '(19830 37634)) -> (14 35 15 8 3 2011 2 nil -18000)

that is 14:35:15 08-03-2011 dow=2(=Tuesday) dst=nil(= no dst - the
switch happened later) zone=-18000 (in seconds - that is -5GMT in
hours).

So you might try the following simple helper function:

--8<---cut here---start->8---
(defun org-ts-to-hr (ts)
  (let* ((high (lsh ts -16))
 (low (- ts (lsh high 16
(decode-time (list high low
--8<---cut here---end--->8---

(org-ts-to-hr 1299616514) -> (14 35 15 8 3 2011 2 nil -18000)

Note that it may not be the timestamp itself that's at fault: it may
be the key. If we calculate a key and go look in the cache and don't
find it, then the file is considered out of date. But I guess this
is the opposite behavior of what you see. Never mind...

HTH,
Nick



[O] Using Variable in Org-capture configuration

2011-03-22 Thread Chao LU
Dear all,

Just writing to see if it is possible to use variable in org-capture
configuration, like this

 (setq org-capture-templates
   '(("t" "Todo" entry (file *"~/org/refile.org"*) "* TODO %?\n
%i\n  %a" :prepend t)))
  
   \---How could I use->
(concat My-Dropbox-Path "refile.org")

Since I put all my files in Dropbox, and the My-Dropbox-Path has different
values under MAC and M$Windows.

Thanks,

Chao


[O] [PATCH] Allow mixed export of numbered and unnumbered sections in LaTeX

2011-03-22 Thread Lawrence Mitchell
* lisp/org-latex.el (org-export-latex-subcontent): Deal specially with
the case that NUM is an integer.

We would sometimes like to have numbered \sections in LaTeX export but
unnumbered \subsections and so forth.  That is, use the starred
equivalents for all sectioning commands below a certain level.
Previously, the num: option specification could only specify whether
sections should be numbered or unnumbered at all levels.  We now treat
an integer value specially, if num:N is supplied then the highest N
levels are numbered, and lower levels are exported without numbering.
---
 lisp/org-latex.el |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

[...]
Wouldn't it be nice if #+OPTIONS: num:2 exported
\section{foo}
\subsection{bar}
\subsubsection*{baz}

It turns out the patch is relatively straightforward.  I haven't
included a doc update, but could do so if required.


diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index fbdeb5e..7a3c629 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1151,7 +1151,9 @@ and its content."
 
 (defun org-export-latex-subcontent (subcontent num)
   "Export each cell of SUBCONTENT to LaTeX.
-If NUM, export sections as numerical sections."
+If NUM is non-nil export numbered sections, otherwise use unnumbered
+sections.  If NUM is an integer, export the highest NUM levels as
+numbered sections and lower levels as unnumbered sections."
   (let* ((heading (cdr (assoc 'heading subcontent)))
 (level (- (cdr (assoc 'level subcontent))
   org-export-latex-add-level))
@@ -1187,6 +1189,9 @@ If NUM, export sections as numerical sections."
  ;; Normal conversion
  ((<= level depth)
   (let* ((sec (nth (1- level) sectioning))
+(num (if (integerp num)
+ (>= num level)
+   num))
 start end)
(if (consp (cdr sec))
(setq start (nth (if num 0 2) sec)
-- 
1.7.4.rc2.18.gb20e9




Re: [O] Re: unnumbered subsections in latex export

2011-03-22 Thread Nick Dokos
Suvayu Ali  wrote:

> Hi S=C3=A9bastien,
> 
> On Tue, 22 Mar 2011 13:20:29 +0100
> S=C3=A9bastien Vauban  wrote:
> > >
> > > I was wondering whether there is some way to export the attached org
> > > file to latex such that headlines beyond level 2 (3 and onwards) can
> > > be exported as unnumbered subsections or subsubsections like this,
> > > \subsection*{}, instead of enclosing them within itemize.
> > >
> > > The file uses the following options header:
> > >
> > > #+OPTIONS:   H:2 num:t toc:t ::t |:t ^:t -:t f:t *:t <:nil
> >=20
> > Using H:3 num:2?  Untested... But that should do the work.
> >=20
> 
> That didn't work. It exports the same as the following options
> 
> #+OPTIONS:   H:3 num:t toc:t ::t |:t ^:t -:t f:t *:t <:nil
> 
> I think the num option is a boolean. The manual says the following:
> 
>  num:   turn on/off section-numbers
> 
> Would it be a worthwhile feature request to allow numbers for that
> option? Then one could have finer control on the numbering.
> 


You can do it (I think - but have not tried it) by changing H:3 to
H:5 or so:

,
| (defcustom org-export-latex-low-levels 'itemize
|   "How to convert sections below the current level of sectioning.
| This is specified by the `org-export-headline-levels' option or the
| value of \"H:\" in Org's #+OPTION line.
`

and then asking LaTeX to omit the numbering appropriately:

\setcounter{secnumdepth}{2}

Adjust the 2 to taste.

Nick



Re: [O] Using Variable in Org-capture configuration

2011-03-22 Thread Nick Dokos
Chao LU  wrote:

> Dear all,
> 
> Just writing to see if it is possible to use variable in org-capture 
> configuration, like this
> 
>  (setq org-capture-templates
>    '(("t" "Todo" entry (file "~/org/refile.org") "* TODO %?\n  %i\n  
> %a" :prepend t)))
>   
>    \---How could I use-> 
> (concat My-Dropbox-Path
> "refile.org")
> 
> Since I put all my files in Dropbox, and the My-Dropbox-Path has different 
> values under MAC and
> M$Windows.
> 

Search for "backtick" on gmane - see e.g. the following post:

   http://thread.gmane.org/gmane.emacs.orgmode/29163/focus=29180

Nick



Re: [O] Using Variable in Org-capture configuration

2011-03-22 Thread Erik Iverson

Chao,

I believe I had the exact same issue, caused the exact same use case, 
i.e., Dropbox.  Read David's answer and see if it helps:


http://www.mail-archive.com/emacs-orgmode@gnu.org/msg29029.html

Chao LU wrote:

Dear all,

Just writing to see if it is possible to use variable in org-capture 
configuration, like this


 (setq org-capture-templates
   '(("t" "Todo" entry (file *"~/org/refile.org 
"*) "* TODO %?\n  %i\n  %a" :prepend t)))

  
   \---How could I 
use-> (concat My-Dropbox-Path "refile.org ")


Since I put all my files in Dropbox, and the My-Dropbox-Path has 
different values under MAC and M$Windows.


Thanks,

Chao




[O] Re: Completing with anything

2011-03-22 Thread Eric Abrahamsen
Eric S Fraga  writes:

> Eric Abrahamsen  writes:
>
> [...]
>
>> This is what I've been using to insert other people's contact
>> information into emails. Probably no good for general use, but maybe
>> will provide food for thought.
>>
>> #+BEGIN_SRC emacs-lisp
>> (defun my-cite-contact (name)
>>   (interactive "sName (regexp): ")
>>   (let ((rec)
>>  (records (bbdb-search (bbdb-records) name name name nil nil)))
>> (if (= (length records) 1)
>>  (setq rec (car records))
>>   (if (zerop (length records))
>>(error "No matching records")
>>  (setq rec
>>(let ((int-name (ido-completing-read "Pick one: "
>> (mapcar 'bbdb-record-name 
>> records
>>  (car (bbdb-search (bbdb-records) int-name))
>> (insert (bbdb-dwim-net-address rec
>> #+END_SRC
>
> This looks quite nice; I have been missing the possibility of a regex
> search for mail addresses and the combination with ido is quite
> appealing.
>
> How do you invoke it?  I am currently struggling with the interactions
> between .mailrc (emacs mail aliases, expanding as abbrevs) and bbdb
> (expanding with TAB).  This is partly why I haven't even considered
> using org-contacts yet...
>
> As always, with Emacs, too many choices, too little time!  ;-)

I only ever invoke it through M-x, as I only ever use it to paste other
people's contact details into an email (something I find myself doing
surprisingly often).

The trick was definitely figuring out at what "level" to let ido do its
thing. The key was that bbdb came with both its own generic search
function, and its own formatting function—ido is just the glue between,
if necessary.

I don't really like the fact that you first produce a collection of
records, then pick *the name* of one record and essentially re-search
all the records for that particular name, but I couldn't figure out a
way to have ido select from among *representations* of actual records,
and then return the record directly. I think that's where ido will trip
you up: it's only made to select from strings.

E




[O] Customizing LaTeX-export, Beamer, \institute, and BEAMER_envargs

2011-03-22 Thread Bernd Weiss

Dear all,

I am preparing a Beamer presentation and I am having some trouble with 
side effects (?) due to my attempt to customize the LaTeX-export. My 
minimum example can be found below.


The default LaTeX-export does not recognise the '\institute'-option (I 
mean, as far as I know). For that reason, I run "(add-to-list 
'org-export-latex-classes ...)". Unfortunately, the export-function does 
no longer recognice ":BEAMER_envargs: [plain]" (or ":BEAMER_envargs: 
[shrink=5]")[1].


Thanks,

Bernd

[1] Which is obviously due to "\\begin{frame}[fragile]\\frametitle{%s} 
...".



#+begin_src emacs-lisp :results silent :exports none
(add-to-list 'org-export-latex-classes
  ;; beamer class, for presentations
  '("beamer"
 "\\documentclass[11pt]{beamer}\n
   [NO-DEFAULT-PACKAGES]
   [EXTRA]
   \\mode<{{{beamermode}}}>\n
  \\usethemebeamertheme\n
  \\institutebeamerinstitute\n
   \\subjectbeamersubject\n"

 ("\\section{%s}" . "\\section*{%s}")

 ("\\begin{frame}[fragile]\\frametitle{%s}"
   "\\end{frame}"
   "\\begin{frame}[fragile]\\frametitle{%s}"
   "\\end{frame}")))
#+end_src


#+LaTeX_CLASS: beamer
#+MACRO: BEAMERMODE presentation
#+MACRO: BEAMERTHEME Madrid
#+MACRO: BEAMERINSTITUTE Research Institute for ???
#+TITLE: 
#+AUTHOR: Arthur Mueller
#+DATE: March, 28th 2011


#+BEAMER_FRAME_LEVEL: 2
#+latex_header: \mode{\usetheme{Madrid}}


* Introduction
** A simple slide
:PROPERTIES:
:BEAMER_env: frame
:BEAMER_envargs: [plain]
:END:
   This slide consists of some text with a number of bullet points:

- the first, very @important@, point!
- the previous point shows the use of the special markup which
  translates to the Beamer specific /alert/ command for highlighting
  text.


The above list could be numbered or any other type of list and may
include sub-lists.




[O] [babel] Trouble with :cache yes

2011-03-22 Thread Ken.Williams
Hi,

I'm having some trouble getting ":cache yes" to behave the way I think
it's supposed to.  As a test, I have a simple example containing just a
title and one source block:

#+source: testcache
#+begin_src R :cache yes :exports both :results output
dat <-  matrix(runif(12), 3, 4)
print(dat)
#+end_src


If I export this document to HTML (C-c C-e b), Emacs asks me "Evaluate
this R code block (testcache) on your system?"  If I say 'y' it
re-evaluates, if I say 'n' it doesn't, so it doesn't seem like there's any
role that caching gets to play here.

In addition, when I export the document as above, the results are not
saved in the original org-mode buffer, so whatever "#+results" block is
there (or not there) from doing C-c C-c is neither used nor overwritten -
and therefore the exported document contains different results than the
source document.

The behavior I expected (please let me know if my expectation is
incorrect) was for the result of the computation to be cached in the Emacs
buffer when I do the first export, and for that saved result to be
included in the exported content for subsequent exports, until either the
code/inputs change or I delete the results block.

My configuration is:

Emacs  : GNU Emacs 23.2.50.1 (i386-apple-darwin9.8.0, NS
apple-appkit-949.54)
 of 2010-08-18 on braeburn.aquamacs.org - Aquamacs Distribution 2.1
Package: Org-mode version 7.5

Thanks!


--
Ken Williams
Senior Research Scientist
Thomson Reuters
http://labs.thomsonreuters.com




RE: [O] How to reuse page keywords for LaTeX with pdfkeywords and hyperref package?

2011-03-22 Thread Mikhail Titov
Bastien:

Thank you! I understand that it is not possible right now through simple 
settings. However hyperref is getting added to packages alist at some point. Is 
there a way to dereference org-export-page-keywords let's say in my custom 
LaTeX class definition in my dot emacs file or even in source code. Or is the 
problem in that that variable is not defined that time?

Mikhail

-Original Message-
From: Bastien Guerry [mailto:bastiengue...@googlemail.com] On Behalf Of Bastien
Sent: Tuesday, March 22, 2011 4:54 AM
To: Mikhail Titov
Cc: 'Org mailing list'
Subject: Re: [O] How to reuse page keywords for LaTeX with pdfkeywords and 
hyperref package?

Hi Mikhail,

"Mikhail Titov"  writes:

> I would like to be able to have same keywords for both HTML and PDF 
> output. I was a bit surprised that it is not there yet. I’m not a lisp 
> user:( Could someone suggest what needs to be done to use 
> org-export-page-keywords to set the value of pdfkeywords option of 
> hyperref LaTeX package?

This is not possible right now.  You can do it manually by removing hyperref 
from the `org-export-latex-default-packages-alist' variable, and by adding such 
a header in your org file:

#+LATEX_HEADER: \usepackage[dvips, bookmarks, colorlinks=false,
   pdftitle={An example PDF file from LaTeX}, pdfauthor={Diego Santa
   Cruz}, pdfsubject={From LaTeX to PDF}, pdfkeywords={PDF, LaTeX,
hyperlinks, hyperref}]{hyperref} 

But your request makes sense, I might implement it someday.

Best,

--
 Bastien




Re: [O] Using Variable in Org-capture configuration

2011-03-22 Thread Carsten Dominik

On 22.3.2011, at 15:25, Chao LU wrote:

> Dear all,
> 
> Just writing to see if it is possible to use variable in org-capture 
> configuration, like this
> 
>  (setq org-capture-templates
>'(("t" "Todo" entry (file "~/org/refile.org") "* TODO %?\n  %i\n  
> %a" :prepend t)))
>   
>\---How could I use-> 
> (concat My-Dropbox-Path "refile.org")
> 
> Since I put all my files in Dropbox, and the My-Dropbox-Path has different 
> values under MAC and M$Windows.

Using backquote as the others in this thread say is one possibility.
However, you can also get the latest version of Org - it does
allow a lisp form for the file name:

http://article.gmane.org/gmane.emacs.orgmode/38067/match=form

- Carsten

> 
> Thanks,
> 
> Chao




[O] Bug: Recurring items NEVER show up in timeline unaccompanied

2011-03-22 Thread Mark S


You know, I think this may be the same bug I ran into 3 years ago when I  
last tried Org-mode. Is there any hope that this will be addressed? I note  
that this forum is the only location given for sending bug reports in the  
documentation.


Thanks!
Mark

--- On Sat, 3/19/11, Nick Dokos  wrote:


From: Nick Dokos 
Subject: Re: [O] Bug: Recurring items don't always show up in timeline
To: "Chris Randle" 
Cc: nicholas.do...@hp.com, emacs-orgmode@gnu.org
Date: Saturday, March 19, 2011, 11:46 AM
Chris Randle 
wrote:

On 2011-03-18 21:20, Nick Dokos wrote:

> > Mark Swrote:
> >
> >> I posted this before as a question, but since
it has been confirmed by
> >> others, and shows up under Linux and Windows,
I'll now post the
> >> details as a bug.
> >>
> >> The Timeline view *would* be very useful for
scheduling months in
> >> advance, reviewing history, or printing a
year event
> >> calendar. Unfortunately, it appears that it
can't really be trusted.
> >> The basic problem is that in AGENDA TIMELINE
view ("C-a L") recurring
> >> items are frequently and unpredictably
dropped from the view. The
> >> regular AGENDA view works fine AFAIK -- its
the TIMELINE that is at
> >> issue.
> >
> > AFAICT, the culprit is org-get-all-dates: it
matches date strings, translates
> > to number of days since the (imaginary) date
0001-12-31bce,
> > accumulates them in a list, sorts them, takes
care of gaps - but
> > completely ignores any repeaters: iow, the "don't
always show" in the
> > Subject line should more accurately say "never
show".
>> Unless I'm missing something (again!), when I try it,
they *do* repeat
> *sometimes*. For example, the entry
>> TODO [#A] Bath for dog <2011-03-10 Thu +1w>
>> appears in agenda timeline as follows:
>> 2011-03-10, miss 1 week, 2011-03-24, 2011-03-31,
2011-04-07, miss 7
> weeks, 2011-06-02, miss 8 weeks (agenda terminates
2011-07-31).
>That's true. I believe that's when it coincides with
another entry: it
sneaks in on the heels of the other entry. But I may very
well be wrong:
I have only scratched the surface a bit.
Nick





[O] s-tab not working as intended in kde's konsole

2011-03-22 Thread Izzie
Hi, I'm a newcomer to orgmode and a basic emacs user who has trouble with some 
shortcuts not doing what they should. I don't know how to fix it.

This problem occurs on an aptosid (debian sid 64-bits) laptop with kde when 
running emacs in konsole with the -nw parameter. 

Instead of folding/unfolding S-TAB seems to take focus away as the cursor goes 
from full to empty but nothing. 

shift-tab happens to be used by konsole as a shortcut for "next view container" 
but I'm not sure what actually happening as this problem doesn't occur at all 
on 
my desktop under debian wheezy 64-bits and disabling the shift-tab shortcut in 
konsole doesn't fix the problem.

I also noticed a few other shortcuts are not working, such as:
- C-S-RET (seems to do the same as a regular RET)
- M-S-RET (does nothing but emacs complains with "ESC  is undefined"
- C-RET (seems to be the same as a regular RET)
- M-S-LEFT/RIGHT does not work but M-LEFT/RIGHT does

Any help appreciated.

Iz




Re: [O] Bug: Recurring items NEVER show up in timeline unaccompanied

2011-03-22 Thread Nick Dokos
Mark S  wrote:

> 
> You know, I think this may be the same bug I ran into 3 years ago when I  
> last tried Org-mode. Is there any hope that this will be addressed? I note  
> that this forum is the only location given for sending bug reports in the  
> documentation.
> 
> Thanks!
> Mark
> 

I went looking for a bug report but the only thing that I can find
posted by you was a thread on "Getting org-agenda-sorting-strategy to
work" - nothing about the timeline.  I also searched for timeline and
although there was a fair amount of activity in 2008, none of it seemed
related to this bug (I might have overlooked it of course). Can you
provide a pointer to the bug report?

Be that as it may, it will certainly be addressed when somebody provides
a patch and the maintainer applies it. *When* that will be is anybody's
guess of course (remember, everybody is a volunteer here with a day job
that might or might not leave much time for org bug fixing).  But
generally speaking, once a bug bubbles to the surface, it does not stay
a bug for long.

And finally: this is the right place to post bug reports.

HTH,
Nick

PS. BTW, if you gave up on org because the timeline was not working, you
have been missing out on a bunch of good things :-) Even with a broken
timeline, org is incredibly useful. And some of us (both Chris and I e.g.,
who have been most active in the recent discussion) have never used the
timeline at all...







[O] [babel] Emitting both text & graphics output

2011-03-22 Thread Ken.Williams
Hi,

Suppose I have a source block like the following, which both 'print's some
text output and 'plot's to a graphics device:

--
#+begin_src R :file tp.png :exports both :results output graphics
dat <-  matrix(runif(12), 6, 2)
print(dat)
plot(dat)
#+end_src
--



I can't seem to get the print() output to display, either by exporting to
HTML or by simple evaluation of the code block.

'C-c C-c' results in the following 'results' section:

--
#+results:
[[file:tp.png]]
--



And 'C-c C-e b' results in HTML output like this:

--
dat <-
matrix(runif(12), 6, 2)
print(dat)
plot(dat)





--



Neither of those have the actual printed matrix output, which would be
something like this:

--
#+begin_src R :exports both :results output
dat <-  matrix(runif(12), 6, 2)
print(dat)
#+end_src

#+results:
:   [,1]  [,2]
: [1,] 0.3675202 0.1995134
: [2,] 0.9221087 0.1225686
: [3,] 0.6534830 0.6986238
: [4,] 0.3523151 0.1299406
: [5,] 0.7207582 0.5494278
: [6,] 0.3665547 0.6328452
--




Any clues?  Thanks.



--
Ken Williams
Senior Research Scientist
Thomson Reuters
http://labs.thomsonreuters.com




Re: [O] Bug: Recurring items NEVER show up in timeline unaccompanied

2011-03-22 Thread Nick Dokos
Some more comments and another bug in org-timeline:

o a repeater always gets reported on its initial date - it only gets reported
  on subsequent instances iff it coincides with some other entry that will be
  reported on that date.

o the initial comment of org-timeline says "Only entries with a time
  stamp of today or later will be listed." However, in the let*, we have
(let* ((dopast t)
   ...
  so by default we get past dates as well.

o [the additional bug] if dopast is set to nil in the let*, then we run the
  following code to get rid of past dates:

(if (not dopast)
;; Remove past dates from the list of dates.
(setq day-numbers (delq nil (mapcar (lambda(x)
  (if (>= x today) x nil))
day-numbers

  But day-numbers isn't just numbers: it's a list of day numbers
  interspersed with gap information:

   (733451 (:omitted . 28) 733479 (:omitted . 5) 733484 (:omitted . 21) 733505 
(:omitted . 15) 733520 ...)
  and the mapcar function chokes when it has to deal with a gap argument.


Since there is no way to set dopast from the outside, perhaps the thing
to do is to remove both it and the above code (as well as one additional
instance of the variable) and declare that org-timeline will always do
both past and future. Or, given some global option variable, it can be
set to that value, in which case the code above needs to be fixed to
deal with the gaps.

Also, some stopping point will need to be provided. Right now, that is
the last explicit date in the file, but in the presence of repeaters
(and assuming that org-timeline gets modified to deal with them), that
natural stopping point gets pushed all the way to infinity, so some
other way will need to be provided to stop the enumeration.

Comments?

Nick

  



RE: [O] [babel] Emitting both text & graphics output

2011-03-22 Thread Mikhail Titov
I'm just a newbie user of org & babel, but as a workaround I'd split it into
several blocks and use session based work. For instance I have the following
in my dot emacs:

(setq org-babel-default-header-args:R
  '((:results . "output") (:session . "*R*")))

This way I can always see what is going on within ESS in *R* buffer and all
variables are preserved.

Mikhail

> -Original Message-
> From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode-
> bounces+mlt=gmx...@gnu.org] On Behalf Of ken.willi...@thomsonreuters.com
> Sent: Tuesday, March 22, 2011 3:03 PM
> To: emacs-orgmode@gnu.org
> Subject: [O] [babel] Emitting both text & graphics output
> 
> Hi,
> 
> Suppose I have a source block like the following, which both 'print's
> some
> text output and 'plot's to a graphics device:
> 
> --
> #+begin_src R :file tp.png :exports both :results output graphics
> dat <-  matrix(runif(12), 6, 2)
> print(dat)
> plot(dat)
> #+end_src
> --
> 
> 
> 
> I can't seem to get the print() output to display, either by exporting
> to
> HTML or by simple evaluation of the code block.
> 
> 'C-c C-c' results in the following 'results' section:
> 
> --
> #+results:
> [[file:tp.png]]
> --
> 
> 
> 
> And 'C-c C-e b' results in HTML output like this:
> 
> --
> dat <-
> matrix(runif(12), 6, 2)
> print(dat)
> plot(dat)
> 
> 
> 
> 
> 
> --
> 
> 
> 
> Neither of those have the actual printed matrix output, which would be
> something like this:
> 
> --
> #+begin_src R :exports both :results output
> dat <-  matrix(runif(12), 6, 2)
> print(dat)
> #+end_src
> 
> #+results:
> :   [,1]  [,2]
> : [1,] 0.3675202 0.1995134
> : [2,] 0.9221087 0.1225686
> : [3,] 0.6534830 0.6986238
> : [4,] 0.3523151 0.1299406
> : [5,] 0.7207582 0.5494278
> : [6,] 0.3665547 0.6328452
> --
> 
> 
> 
> 
> Any clues?  Thanks.
> 
> 
> 
> --
> Ken Williams
> Senior Research Scientist
> Thomson Reuters
> http://labs.thomsonreuters.com
> 





Re: [O] [PATCH] Allow mixed export of numbered and unnumbered sections in LaTeX

2011-03-22 Thread Suvayu Ali
On Tue, 22 Mar 2011 14:26:14 +
Lawrence Mitchell  wrote:

> * lisp/org-latex.el (org-export-latex-subcontent): Deal specially with
> the case that NUM is an integer.
> 
> We would sometimes like to have numbered \sections in LaTeX export but
> unnumbered \subsections and so forth.  That is, use the starred
> equivalents for all sectioning commands below a certain level.
> Previously, the num: option specification could only specify whether
> sections should be numbered or unnumbered at all levels.  We now treat
> an integer value specially, if num:N is supplied then the highest N
> levels are numbered, and lower levels are exported without numbering.
> ---
>  lisp/org-latex.el |7 ++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> [...]
> Wouldn't it be nice if #+OPTIONS: num:2 exported
> \section{foo}
> \subsection{bar}
> \subsubsection*{baz}
> 
> It turns out the patch is relatively straightforward.  I haven't
> included a doc update, but could do so if required.
> 

This works perfectly. Thanks a lot Lawrence. :) 

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Re: unnumbered subsections in latex export

2011-03-22 Thread Suvayu Ali
On Tue, 22 Mar 2011 10:35:10 -0400
Nick Dokos  wrote:

> Suvayu Ali  wrote:
> 
> > Hi S=C3=A9bastien,
> > 
> > On Tue, 22 Mar 2011 13:20:29 +0100
> > S=C3=A9bastien Vauban  wrote:
> > > >
> > > > I was wondering whether there is some way to export the
> > > > attached org file to latex such that headlines beyond level 2
> > > > (3 and onwards) can be exported as unnumbered subsections or
> > > > subsubsections like this, \subsection*{}, instead of enclosing
> > > > them within itemize.
> > > >
> > > > The file uses the following options header:
> > > >
> > > > #+OPTIONS:   H:2 num:t toc:t ::t |:t ^:t -:t f:t *:t <:nil
> > >=20
> > > Using H:3 num:2?  Untested... But that should do the work.
> > >=20
> > 
> > That didn't work. It exports the same as the following options
> > 
> > #+OPTIONS:   H:3 num:t toc:t ::t |:t ^:t -:t f:t *:t <:nil
> > 
> > I think the num option is a boolean. The manual says the following:
> > 
> >  num:   turn on/off section-numbers
> > 
> > Would it be a worthwhile feature request to allow numbers for that
> > option? Then one could have finer control on the numbering.
> > 
> 
> 
> You can do it (I think - but have not tried it) by changing H:3 to
> H:5 or so:
> 
> ,
> | (defcustom org-export-latex-low-levels 'itemize
> |   "How to convert sections below the current level of sectioning.
> | This is specified by the `org-export-headline-levels' option or the
> | value of \"H:\" in Org's #+OPTION line.
> `
> 
> and then asking LaTeX to omit the numbering appropriately:
> 
> \setcounter{secnumdepth}{2}
> 
> Adjust the 2 to taste.
> 

This works too, but Lawrence's patch makes it much easier and
probably works for other export formats too. Thanks a lot. :)

> Nick

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Re: unnumbered subsections in latex export

2011-03-22 Thread Nick Dokos
Suvayu Ali  wrote:

> This works too, but Lawrence's patch makes it much easier and
> probably works for other export formats too. Thanks a lot. :)
> 

No doubt Lawrence's patch can be extended to work for other exports, but
it's not there yet: each exporter would need a change similar to the one
that he made to the LaTeX exporter.

Nick







[O] orgmode and rss

2011-03-22 Thread Jude DaShiell
A long-standing friend is looking for a platform he can use to write rss 
and publish it.  Earlier today I read about plannermode being able to do 
this and don't yet have plannermode on my machine but do have orgmode.  So 
I'm curious if this can be done.  He has to learn emacs along with orgmode 
but already has a blog in operation.  Both of us use screen readers on 
Linux and both of us prefer command line environments to g.u.i. if that 
makes things any easier.






Re: [O] [babel] Emitting both text & graphics output

2011-03-22 Thread suvayu ali
On Tue, Mar 22, 2011 at 1:02 PM,   wrote:
> --
> #+begin_src R :file tp.png :exports both :results output graphics
> dat <-  matrix(runif(12), 6, 2)
> print(dat)
> plot(dat)
> #+end_src
> --
>
>
>
> I can't seem to get the print() output to display, either by exporting to
> HTML or by simple evaluation of the code block.


Exporting to HTML includes a plot for me. Are you sure you activated R properly?

This is my settings for babel,

https://github.com/suvayu/.emacs.d/blob/master/lisp/org-mode-settings.el#L282

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] publishing org-mode to google docs

2011-03-22 Thread June Tate-Gans
Try T.V Raman's gdocs.el library from the emacspeak packages. You can
find it here: 
.

On Mon, Mar 21, 2011 at 3:22 PM, Daniel Mahler  wrote:
> What is the best way to publishh org-mode outlines to google docs.
> I can upload the PDF, but I need the resulting google docs to be editable.
>
> thanks
> Daniel
>
>



-- 
June Tate-Gans    | Don't try to outweird me, three-eyes. I get stranger things
www.theonelab.com | than you free with my breakfast cereal. -- Zaphod Beeblebrox



Re: [O] [babel] Emitting both text & graphics output

2011-03-22 Thread Nick Dokos
suvayu ali  wrote:

> On Tue, Mar 22, 2011 at 1:02 PM,   wrote:
> > --
> > #+begin_src R :file tp.png :exports both :results output graphics
> > dat <- =A0matrix(runif(12), 6, 2)
> > print(dat)
> > plot(dat)
> > #+end_src
> > --
> >
> >
> >
> > I can't seem to get the print() output to display, either by exporting to
> > HTML or by simple evaluation of the code block.
> 
> 
> Exporting to HTML includes a plot for me. Are you sure you activated R prop=
> erly?
> 

... but it doesn't include the print(dat) output. That's what the OP wanted
I think.

Nick

PS. the session trick that Mikhail Titov suggested works well:

--8<---cut here---start->8---

* Foo

#+begin_src R :session *R* :exports both :results output
 dat <-  matrix(runif(12), 6, 2)
 print(dat)
#+end_src

#+results:
:   [,1]   [,2]
: [1,] 0.3459181 0.04018971
: [2,] 0.9300838 0.75353098
: [3,] 0.4234347 0.51248641
: [4,] 0.3713377 0.23556420
: [5,] 0.2572491 0.73720994
: [6,] 0.7233642 0.58195861


#+begin_src R :session *R* :exports both :results graphics :file tp.png
 plot(dat)
#+end_src

#+results:
[[file:tp.png]]

--8<---cut here---end--->8---




Re: [O] [babel] Trouble with :cache yes

2011-03-22 Thread Eric Schulte
Hi Ken,

In order for caching to work, the results of the code block must exist
in the org-mode file.  For example, the following code block will be
evaluated when triggered either interactively or during export

#+begin_src emacs-lisp :cache yes
  (+ 2 2)
#+end_src

alternately, this block will not be evaluated when triggered either
interactively or on export, because the cached results are present

#+begin_src emacs-lisp :cache yes
  (+ 2 2)
#+end_src

#+results[9b77429d6cea71daf37e21ee09170810b9905066]:
: 4

In your example, for the code block to not be evaluated as part of the
export process, you must first evaluate it manually within the Org-mode
file, leaving the results (with the hash tag) saved in the Org-mode
file.

Best -- Eric

 writes:

> Hi,
>
> I'm having some trouble getting ":cache yes" to behave the way I think
> it's supposed to.  As a test, I have a simple example containing just a
> title and one source block:
>
> #+source: testcache
> #+begin_src R :cache yes :exports both :results output
> dat <-  matrix(runif(12), 3, 4)
> print(dat)
> #+end_src
>
>
> If I export this document to HTML (C-c C-e b), Emacs asks me "Evaluate
> this R code block (testcache) on your system?"  If I say 'y' it
> re-evaluates, if I say 'n' it doesn't, so it doesn't seem like there's any
> role that caching gets to play here.
>
> In addition, when I export the document as above, the results are not
> saved in the original org-mode buffer, so whatever "#+results" block is
> there (or not there) from doing C-c C-c is neither used nor overwritten -
> and therefore the exported document contains different results than the
> source document.
>
> The behavior I expected (please let me know if my expectation is
> incorrect) was for the result of the computation to be cached in the Emacs
> buffer when I do the first export, and for that saved result to be
> included in the exported content for subsequent exports, until either the
> code/inputs change or I delete the results block.
>
> My configuration is:
>
> Emacs  : GNU Emacs 23.2.50.1 (i386-apple-darwin9.8.0, NS
> apple-appkit-949.54)
>  of 2010-08-18 on braeburn.aquamacs.org - Aquamacs Distribution 2.1
> Package: Org-mode version 7.5
>
> Thanks!
>
>
> --
> Ken Williams
> Senior Research Scientist
> Thomson Reuters
> http://labs.thomsonreuters.com



Re: [O] [babel] feature request: automatically connect source code block to its session

2011-03-22 Thread Eric Schulte
This seems reasonable,

Do you know how ESS associates a code buffer with a session (i.e. is
there some buffer-local variable which holds the session name)?

With this information in hand it shouldn't be difficult to expand the
C-' behavior for R s.t. it automatically associates the resulting
Org-Src buffer with the proper R session.

Good idea.  Best -- Eric

Andreas Leha  writes:

> Hi all,
>
> I have a feature request (if what I want is not already possible, that is).
>
> Could a source code block, which has the :session header argument, be
> associated with its session as soon as C-' is pressed?
>
> The background to this question is, that all ess support functionality
> for R (r-autoyas, autocomplete-R, and ess-eldoc) need an associated R
> session.  They start to function only as soon as the first line of the
> code block is evaluated, which associates the source buffer with its
> session.
> The autocomplete-R even fails to load without an associated R session
> (byte-code: Language mode `R-mode' fails with: "Symbol nil may not be
> buffer-local")
> and this way cuts the connection to org, such that C-' becomes undefined.
>
> Regards,
> Andreas



Re: [O] Org babel with multiple linked segments of source code

2011-03-22 Thread Eric Schulte
Hi,

The setup you suggest below is not currently supported.  I fear
implementing such a system could have some odd semantic extensions into
other parts of Org-mode code blocks, for example, would it then make
sense for the results of a code block to be collected over all code
blocks with that name?  For example,

#+source: test2
#+begin_src emacs-lisp
  1
#+end_src

#+source: test2
#+begin_src emacs-lisp
  2
#+end_src

#+begin_src emacs-lisp :var data=test2
  data
#+end_src

#+results:
| 1 | 2 |

Maybe, but this is certainly not possible under the current setup.

Anyways, back to your use case, maybe it would be equally convenient to
simply have a number of sequential code blocks in the Org-mode file all
tangle out, as they will be placed in the tangled file in the order they
appear in the Org-mode file, so your example below could be changed
to...

** tangling example
   :PROPERTIES:
   :tangle:   test1.clj
   :exports:  none
   :END:

#+begin_src clojure
  blah
#+end_src

#+begin_src clojure
  foo
#+end_src

#+begin_src clojure
  bar
#+end_src

#+begin_src clojure
  blah
#+end_src

While not the same as what you suggested this may be sufficient.

Best -- Eric

Nicholas Patrick  writes:

> I'm trying to figure out how to minimize the overhead with using babel to
> write some segments of code.  I find myself writing short segments of a set
> of functionality, then writing a collector source block which is referred to
> later on in the code... e.g.
>
> *
> #+srcname: test1
> #+begin_src clojure :tangle test1.clj :exports none :noweb yes
> blah
> <>
> blah
> #+end_src
>
> #+srcname: test2
> #+begin_src clojure
> foo
> #+end_src
>
> #+srcname: test2
> #+begin_src clojure
> bar
> #+end_src
> *
> I'd like to see
> blah
> foo
> bar
> blah
>
> but I see
> blah
> foo
> blah
>
> What I'd like to see is a single srcname for the code that just concatenates
> the two different sections when it is referred by <>.
> That way I don't have to come up with different names and collectors and so
> on and so forth.  Maybe I'm just not doing "literate programming" right, but
> when I'm hacking stuff together, I'd like to minimize the housekeeping.
> e.g.
>
> Is there a way to do this?



Re: [O] babel R: should/does order of parameters matter?

2011-03-22 Thread Eric Schulte
Hi Myles,

I believe the problem here is that your :var header argument syntax is
wrong.  A :var header argument must have a name, and equals sign, and an
assignment for the variable, e.g.

#+begin_src sh :var name="eric"
  echo $name
#+end_src

#+results:
: eric

Please see the online manual for more information on the :var header
argument. http://orgmode.org/manual/var.html#var

Best -- Eric

Myles English  writes:

> Hello,
>
> First of all thanks very much for all the very well explained help
> given in previous threads I have started.
>
> Now, I have found different results arise from a difference in position
> of parameters (I'm using commit c01c2ad Fri Mar 18, R version 2.12.20,
> Feb 25):
>
>
> #+TBLNAME: data
> | x | parameter | value |
> |---+---+---|
> | 0 | heat  |30 |
> | 1 | heat  |30 |
>
> This next block works as I expect and returns the column names:
>
> #+source: namesNFirst
> #+begin_src R  :var N :var tbl :var param :colnames yes
>names(tbl)
> #+end_src
>
> #+call: namesNFirst(N=10,tbl=data,param="heat")
>
> #+results: namesNFirst(N=10,tbl=data,param="heat")
> | x |
> | parameter |
> | value |
>
> Now, I would expect this to return the same result as above:
>
> #+source: namesNLast
> #+begin_src R  :var tbl :var param :var N :colnames yes 
>names(tbl)
> #+end_src
>
> #+call: namesNLast(tbl=data,param="heat",N=10)
>
> but it doesn't:
>
> #+results: namesNLast(tbl=data,param="heat",N=10)
> | X0   |
> | heat |
> | X30  |
>
> Removing the string parameter 'param', and again it works as expected:
>
> #+source: namesNoParam
> #+begin_src R  :var tbl :var N :colnames yes 
>names(tbl)
> #+end_src
>
> #+call: namesNoParam(tbl=data,N=10)
>
> #+results: namesNoParam(tbl=data,N=10)
> | x |
> | parameter |
> | value |
>
> I can't find any difference R-side when using :session.  At this stage
> I am asking for help; is this intended or a bug?.
>
> Thanks.
>
> Myles



[O] escaping of #+TEXT lines: \vspace vs \vspace*

2011-03-22 Thread Eric Abrahamsen
Hi,

In a certain org file I put this line into the export options:

#+begin_src org-mode
#+TEXT: \vspace*{0.5in}
#+end_src

The starred version is necessary, obviously, since this comes before any
text, and LaTeX will ignore a plain old \vspace{} in those cases.

This currently gets escaped as \vspace*\{0.5in\}, which keeps it from
working. I noticed that regular \vspace{} is not escaped, so I went
looking in org-latex.el, but can't begin to figure out which regexp in
which function is protecting the unstarred version, but not the starred
version.

Is this fixable?

Thanks!
Eric




Re: [O] [babel] Trouble with :cache yes

2011-03-22 Thread Rainer M Krug
On Wed, Mar 23, 2011 at 3:50 AM, Eric Schulte  wrote:
> Hi Ken,
>
> In order for caching to work, the results of the code block must exist
> in the org-mode file.  For example, the following code block will be
> evaluated when triggered either interactively or during export
>
> #+begin_src emacs-lisp :cache yes
>  (+ 2 2)
> #+end_src
>
> alternately, this block will not be evaluated when triggered either
> interactively or on export, because the cached results are present
>
> #+begin_src emacs-lisp :cache yes
>  (+ 2 2)
> #+end_src
>
> #+results[9b77429d6cea71daf37e21ee09170810b9905066]:
> : 4
>
> In your example, for the code block to not be evaluated as part of the
> export process, you must first evaluate it manually within the Org-mode
> file, leaving the results (with the hash tag) saved in the Org-mode
> file.

I will chime in here, because I had a similar problem.
This does not work for me. When I evaluate manually (C-c c) I get the following:

* test
#+source: testcache
#+begin_src R :cache yes :exports both :results output
  dat <-  matrix(runif(12), 3, 4)
  print(dat)
#+end_src

#+results[cad298135e53df633545d6a32a8b2aab5201721c]: testcache
:   [,1]  [,2]  [,3]  [,4]
: [1,] 0.4470891 0.2016197 0.1383083 0.6214485
: [2,] 0.1598936 0.3819967 0.3527698 0.5124687
: [3,] 0.3040325 0.5906898 0.1611272 0.1702849

Which I saved (just to be save).

When exporting to a pdf, I get the following matrix in the pdf:

  [,1][,2] [,3]  [,4]
[1,] 0.5626863 0.8397120 0.9886886 0.2233873
[2,] 0.8697064 0.1101432 0.1372992 0.4114674
[3,] 0.3548678 0.5658843 0.1608864 0.5809167

And it is different after each export. So it seems that the code block
*is* actually evaluated, despite of the cached info.

Rainer


>
> Best -- Eric
>
>  writes:
>
>> Hi,
>>
>> I'm having some trouble getting ":cache yes" to behave the way I think
>> it's supposed to.  As a test, I have a simple example containing just a
>> title and one source block:
>>
>> #+source: testcache
>> #+begin_src R :cache yes :exports both :results output
>> dat <-  matrix(runif(12), 3, 4)
>> print(dat)
>> #+end_src
>>
>>
>> If I export this document to HTML (C-c C-e b), Emacs asks me "Evaluate
>> this R code block (testcache) on your system?"  If I say 'y' it
>> re-evaluates, if I say 'n' it doesn't, so it doesn't seem like there's any
>> role that caching gets to play here.
>>
>> In addition, when I export the document as above, the results are not
>> saved in the original org-mode buffer, so whatever "#+results" block is
>> there (or not there) from doing C-c C-c is neither used nor overwritten -
>> and therefore the exported document contains different results than the
>> source document.
>>
>> The behavior I expected (please let me know if my expectation is
>> incorrect) was for the result of the computation to be cached in the Emacs
>> buffer when I do the first export, and for that saved result to be
>> included in the exported content for subsequent exports, until either the
>> code/inputs change or I delete the results block.
>>
>> My configuration is:
>>
>> Emacs  : GNU Emacs 23.2.50.1 (i386-apple-darwin9.8.0, NS
>> apple-appkit-949.54)
>>  of 2010-08-18 on braeburn.aquamacs.org - Aquamacs Distribution 2.1
>> Package: Org-mode version 7.5
>>
>> Thanks!
>>
>>
>> --
>> Ken Williams
>> Senior Research Scientist
>> Thomson Reuters
>> http://labs.thomsonreuters.com
>
>



-- 
NEW GERMAN FAX NUMBER!!!

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

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Cell:           +27 - (0)83 9479 042
Fax:            +27 - (0)86 516 2782
Fax:            +49 - (0)321 2125 2244
email:          rai...@krugs.de

Skype:          RMkrug
Google:         r.m.k...@gmail.com