Re: [O] small docstring typo in org-clone-subtree-with-time-shift

2011-09-30 Thread Brian van den Broek
On 29 Sep 2011 23:17, "Achim Gratz"  wrote:
>
> Brian van den Broek  writes:
> > I suspect that the optimal way is to generate a patch against the
> > documentation. If that's right and someone would point me to what I'd
> > need to read to learn how to do so (I've never produced a patch
> > before), I'd be happy to learn and do it that way henceforward.
>
> Make your own clone of the Git repository.  Check out the master branch



> Check "How to contribute to Orgmode" on the website.
>
>
> HTH,
> Achim.

Hi Achim,

Thanks for that, especially in a context where an RTFM would not have been
unwarranted.

As it happens, I've set aside some time for a pass through the manual in the
next while (for me, this is a semi-annual affair) and I pledge to repay your
kindness in providing these step by step instructions by making active use
of them!

Thanks again,

Brian vdB


Re: [O] Printing in indent mode

2011-09-30 Thread Jambunathan K
Jarmo Hurri  writes:

> Jambunathan K  writes:
>
>>> Is there a way to print the document tree in indent mode so that the
>>> hidden stars would not show up in the printed version?
>>
>> Don't you think exporting the buffer to say pdf is a better option
>> than printing the buffer directly?
>
> That would be very nice, but I do not know how to do this for a
> hierarchical list so that the result would look like a list. I tried
> org-export-as-pdf, but it gives me an output that is far from a list:
> the result is a complete document, with a table of contents, section
> numbering and each item in the list either as a section or a subsection.

Please post an example org file and the hierarchical list that you want
to export. Also post a png image or a screenshot of what the output
should look like. 

I strongly believe there is a way to do what you want without resorting
to postscript printing.

Have you tried exporting to ASCII - C-c C-e a - and print that buffer
instead?

> --
>
> Jarmo Hurri
>
>
>

-- 



Re: [O] would take more than an org-mode strip-down.

2011-09-30 Thread Jambunathan K

This is a quote from Richard Stallman's speech & article.

, From http://www.gnu.org/gnu/rms-lisp.html
| Multics Emacs proved to be a great success — programming new editing
| commands was so convenient that even the secretaries in his office
| started learning how to use it. They used a manual someone had written
| which showed how to extend Emacs, but didn't say it was a
| programming. So the secretaries, who believed they couldn't do
| programming, weren't scared off. They read the manual, discovered they
| could do useful things and they learned to program.
`

Secretaries were able to embrace Emacs only because they didn't fear it
in the first place. May be they were a bit curious as well.

Remember, the secrataries referred to in this article are secretaries
who ran in to Geekiest of Geeks day in and day out in the years when
computers were even unheard of by the common masses.

Only words I can say to James Levine is this:

1. Have no fear. Be curious. Emacs is easy to learn and use.
2. Have no fear. Be curious. Orgmode is  easy to learn and use.

Both Emacs and Orgmode will make you *MORE* thoughtful. I wouldn't
hesitate to add this thoughtful men make the world a better place for
themselves and others.

That said, I would say discard Orgmode. Use pen and paper. Use notice
boards - much like the modern whiteboards or the ancient blackboards -
to exchange notes with your workers. 

Go with what works for you. 

Jambunathan K.






[O] Time range end in agenda view not displayed

2011-09-30 Thread michael holzer
Hi everyone,

I'm having a problem with the agenda view, hopefully someone can tell me
what I'm doing wrong:

When I have an entry that contains a time range, for example:

* timerange
  <2011-09-30 Fri 14:00>--<2011-09-30 Fri 18:00>

this shows up in the agenda view as:

  uni:14:00.. timerange

while I would expect something like:

  uni:14:00-18:00 timerange

as the manual says
(http://orgmode.org/org.html#Time_002dof_002dday-specifications).

Thanks for any help,
michael



Re: [O] Printing in indent mode

2011-09-30 Thread Giovanni Ridolfi
Jarmo Hurri  writes:

Hi, Jarmo ,

> Jambunathan K  writes:
>
>>> Is there a way to print the document tree in indent mode so that the
>>> hidden stars would not show up in the printed version?
>>
>> Don't you think exporting the buffer to say pdf is a better option
>> than printing the buffer directly?
>
> That would be very nice, but I do not know how to do this for a
> hierarchical list so that the result would look like a list. I tried
> org-export-as-pdf, but it gives me an output that is far from a list:
> the result is a complete document, with a table of contents, section
> numbering and each item in the list either as a section or a
> subsection.

For a subtree:
* A list
:PROPERTIES:
:EXPORT_TITLE: 
:EXPORT_OPTIONS:  H:0 num:nil toc:nil \n:t @:t ::t |:t ^:t f:nil *:t tags:nil 
TeX:t LaTeX:nil skip:t p:nil  author:nil  email:nil  creator:nil timestamp:nil
:END:
** title of list
*** item 1
 item 1.2
* item 1.3
** item 1.4
*** item 2

C-c @  C-c C-e b [for html]

If you want to export the whole document, please configure the 
#+OPTIONS:  
line accordingly.

hth
Giovanni



Re: [O] Time range end in agenda view not displayed

2011-09-30 Thread Daniel Bausch
Hi Michael,

it's much easier to achieve, what you want.  Just write
<2011-09-30 Fri 14:00-18:00>
(at least as long as the times refer to the same day)

Daniel

Am Freitag 30 September 2011, 12:00:56 schrieb michael holzer:
> Hi everyone,
> 
> I'm having a problem with the agenda view, hopefully someone can tell me
> what I'm doing wrong:
> 
> When I have an entry that contains a time range, for example:
> 
> * timerange
>   <2011-09-30 Fri 14:00>--<2011-09-30 Fri 18:00>
> 
> this shows up in the agenda view as:
> 
>   uni:14:00.. timerange
> 
> while I would expect something like:
> 
>   uni:14:00-18:00 timerange
> 
> as the manual says
> (http://orgmode.org/org.html#Time_002dof_002dday-specifications).
> 
> Thanks for any help,
> michael




Re: [O] Time range end in agenda view not displayed

2011-09-30 Thread Memnon Anon
michael holzer  writes:

> When I have an entry that contains a time range, for example:
>
> * timerange
>   <2011-09-30 Fri 14:00>--<2011-09-30 Fri 18:00>
>
> this shows up in the agenda view as:
>
>   uni:14:00.. timerange
>
> while I would expect something like:
>
>   uni:14:00-18:00 timerange

* STRT Reply Holzer
  <2011-09-30 Fri 12:30-12:35>

hth
Memnon




[O] [BUG] Re: Time range end in agenda view not displayed

2011-09-30 Thread Giovanni Ridolfi
michael holzer  writes:

> When I have an entry that contains a time range, for example:
>
> * timerange
>   <2011-09-30 Fri 14:00>--<2011-09-30 Fri 18:00>
>
> this shows up in the agenda view as:
>
>   uni:14:00.. timerange
>
> while I would expect something like:
>
>   uni:14:00-18:00 timerange
>

|the manual says:
|Time ranges can be specified with two timestamps, 
|like ‘<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>’.
|
| 20:30-22:15 Marvin escorts the Hitchhikers to the bridge

I confirm this bug.

Org-mode version 7.7 0e9d401519c020af29a7e35da7acfca25e6c3be4
GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600) of 2011-03-10 on 3249CTO

Giovanni




Re: [O] Time range end in agenda view not displayed

2011-09-30 Thread michael holzer
Thanks to everyone for the fast answers :)



[O] How to debug "Specified time is not representable"

2011-09-30 Thread Karl Voit
Hi!

When I get «Specified time is not representable» while creating the
Agenda view, I want to get more information *where* the problem is.

I found [1] and following and so I got it that there is no way of
managing timestamps before 1970 :-(

Is there a way to get to the problematic time stamp?

  1. http://lists.gnu.org/archive/html/emacs-orgmode/2011-05/msg00729.html
-- 
Karl Voit




Re: [O] [BUG] Re: Time range end in agenda view not displayed

2011-09-30 Thread Niels Giesen
Giovanni Ridolfi  writes:

> michael holzer  writes:
>
>> When I have an entry that contains a time range, for example:
>>
>> * timerange
>>   <2011-09-30 Fri 14:00>--<2011-09-30 Fri 18:00>
>>
>> this shows up in the agenda view as:
>>
>>   uni:14:00.. timerange
>>
>> while I would expect something like:
>>
>>   uni:14:00-18:00 timerange
>>
>
> |the manual says:
> |Time ranges can be specified with two timestamps, 
> |like ‘<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>’.
> |
> | 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
>
> I confirm this bug.
>
> Org-mode version 7.7 0e9d401519c020af29a7e35da7acfca25e6c3be4
> GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600) of 2011-03-10 on 3249CTO
>
> Giovanni
>
>

Funny enough, I noticed this too last week, so I whipped up this patch.
It inserts the range when start date is the same as the end date. Please
test (it's still young) && include in Org if you so please.
  
#+begin_src diff
>From dcf81753aa5cab311f2a3a0272e4691e4bc6ea38 Mon Sep 17 00:00:00 2001
From: Niels Giesen 
Date: Mon, 26 Sep 2011 11:43:55 +0200
Subject: [PATCH] Show timestamp ranges in agenda

* lisp/org-agenda.el (org-agenda-get-blocks): Show timestamp ranges in
  agenda if start day is same as end day
---
 lisp/org-agenda.el |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index b1fa5f5..e8effd5 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5396,7 +5396,9 @@ FRACTION is what fraction of the head-warning time has 
passed."
 org-agenda-timerange-leaders)
(1+ (- d0 d1)) (1+ (- d2 d1)))
   head category tags
-  (cond ((= d1 d0)
+  (cond ((and (= d1 d0) (= d2 d0))
+ (concat "<" start-time ">--<" end-time 
">"))
+ ((= d1 d0)
  (concat "<" start-time ">"))
 ((= d2 d0)
  (concat "<" end-time ">"))
-- 
1.7.4.1
#+end_src

Regards, Niels.
-- 
http://pft.github.com/



Re: [O] How to debug "Specified time is not representable"

2011-09-30 Thread Jambunathan K
Karl Voit  writes:

> Hi!
>
> When I get «Specified time is not representable» while creating the
> Agenda view, I want to get more information *where* the problem is.
>
> I found [1] and following and so I got it that there is no way of
> managing timestamps before 1970 :-(
>
> Is there a way to get to the problematic time stamp?
>
>   1. http://lists.gnu.org/archive/html/emacs-orgmode/2011-05/msg00729.html

Hope you have looked at C-h v org-read-date-force-compatible-dates 

A simple M-x grep-find on .org files for the year should work.

You may also try

M-x debug-on-entry RET ding RET

Look at the backtrace and see whether you can get some clues.

Works best if your orgmode is not compiled

-- 



Re: [O] How to debug "Specified time is not representable"

2011-09-30 Thread Nick Dokos
Karl Voit  wrote:

> Hi!
> 
> When I get «Specified time is not representable» while creating the
> Agenda view, I want to get more information *where* the problem is.
> 
> I found [1] and following and so I got it that there is no way of
> managing timestamps before 1970 :-(
> 

Not quite true: Carsten introduced org-read-date-force-compatible-dates
which allows the user to take full responsibility for shooting
{him,her}self in the foot :-)

See 

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

You can try setting it to nil and see if your system dtrt, but you
should read the caveats in the doc string of the variable.

Nick

> Is there a way to get to the problematic time stamp?
> 
>   1. http://lists.gnu.org/archive/html/emacs-orgmode/2011-05/msg00729.html
> -- 
> Karl Voit
> 
> 



Re: [O] [BUG] Re: Time range end in agenda view not displayed

2011-09-30 Thread Michael Brand
Hi Niels

On Fri, Sep 30, 2011 at 16:41, Niels Giesen  wrote:
> [...] I whipped up this patch. [...] Please test (it's still young) [...]

This is a nice water proofing as I like it. The patch passes my tests.

(The patch can be found here:)
http://patchwork.newartisans.com/patch/970

Michael



[O] Kill org files on agenda exit

2011-09-30 Thread Gene Cooley
Whenever I exit my agenda views, there are still all org agenda files open. Is 
there any possibility to kill those buffers on agenda exit?




Re: [O] Kill org files on agenda exit

2011-09-30 Thread Michael Brand
Hi Gene

On Fri, Sep 30, 2011 at 18:49, Gene Cooley  wrote:
> Whenever I exit my agenda views, there are still all org agenda files open. 
> Is there any possibility to kill those buffers on agenda exit?

It seems you have used "q" to exit. This variant leaves the agenda
buffers open. To close them use the variant "x".

Michael



Re: [O] would take more than an org-mode strip-down.

2011-09-30 Thread Thomas S. Dye
Carsten Dominik  writes:

> 1. Startup difficulties for non-EMacs users
>
>One of the fundamental aspect you discuss is the difficulty to
>enter the Org-mode world as a general computer user, possibly not
>familiar Emacs.
>
>Today's world expects programs to be self-explanatory, if possible
>without any documentation reading at all (no, I am not saying that
>this is what *you personally* expect, I mean in general).  In the
>world of iOS, it is standard that one can download an application
>and at least get started with it by playfully launching it.
>Manuals and Documentation are generally disliked.  This also has to
>with the fleeing nature of peoples use of programs.  It is common
>to spend more time looking for a tool or program than the time one
>uses it before discarding or at least ignoring it.  I have many
>apps on my iPod Touch which I have downloaded, used once for a very
>short time, and then not ever again.  So if there is a 70% chance
>that I will ditch the program after a week, the cost of reading
>documentation is extremely high. 
>
>Mind you, I do think that this is (today) a legitimate expectation.
>However, a user with this kind of expectation would be very
>difficult to make feel at home in Org-mode.  The main startup
>problem is already that is runs in Emacs, and a good new version of
>Emacs is not frequently part of a computer system for "normal"
>people.  Org-mode really lives in Emacs. If flourishes on so many
>ideas that are deeply ingrained in Emacs.  So much of Org-mode use
>is quite obvious when you already use and love Emacs.  The tags
>issue you mention is a great example.  Emacs solves these things
>using "completion" (see also Eric Fraga's post in this thread).  An
>Emacs user automatically tries to type a keyword like this by
>typing a few letters and then hitting M-TAB in order to do
>completion.  This is something the spine does for an Emacs user, no
>brain required.
>
>Obviously this will be very hard for a person that comes with a
>different expectation to this program.  And yes, this could be
>helped with putting more GUI-like elements into Org files.  For
>example, we could make tags look like buttons and let the user
>click on them in order to change this.  But, I and many Emacs users
>would see this as a distraction, a detour.  We even do have this
>feature, but it is not turned on by default.
>
>I think that the real issue here is that Org-mode was not
>(originally) intended for "normal" people.  It is a geeks program,
>and we take our pride from making vi users (vi is another
>programmers editor) jealous enough so that they will create a clone
>of the program.  We have not even begun to cater for another
>audience, and this is the thing you, James, are running up against.
>The website we have is not aimed at the general audience.  The fact
>that people like you even know about the program and consider using
>it speaks for the success Org-mode has been.
>
>If we, as the Org-mode community, would like to draw in a new class
>of people, the website would have to be changed.  We'd need a basic
>page, with only a link to the geek stuff.  And the installation
>instruction should be:
>
>a) Download and install Emacs
>b) Create a file with extension ".org" and edit it in Emacs.
>
>i.e. no links to how to install the latest version etc etc.  Russel
>Adam has pointed (earlier in this thread) to his intro video for
>Windows users, this has the right spirit, but still assumes users
>might want to update Org-mode.  You might have gotten off to a
>better start with such an entry page - but that does not mean you'd
>like to program because it would not work intuitively at first
>sight.
>

I see this issue as an opportunity to innovate rather than as some
limitation of Org-mode related to it being a geeks program.  As several
others have pointed out, complexity is the price paid for flexibility.
Yes, it is difficult for an avocational programmer or a non-programmer
to tailor Org-mode properly, but this is because it is possible to do so
many things with Org-mode and not because Org-mode is structured
illogically or limited in what it will do within its realm.  

For the sake of discussion, I'd like to disagree with Carsten and
suggest that the Org-mode community has begun to cater to another
audience.  I'd also like to disagree (I think) with James that Org-mode
requires something along the lines of a strip down.

It seems to me that the reproducible research capabilities of Org-mode
might work as a way to "package" Org-mode for any number of purposes.
The main focus of this work up until now has been to reproduce
scientific research papers, along with their data analyses.  But why not
grocery shopping planners, workout trackers, etc.?  Eric Schul

[O] TABLES: Remove/add cell

2011-09-30 Thread Gustav Wikström
Hello!

How do I add or remove a single cell in a table?

Example:
I have the following table:
|1 |1 |
|2 |3 |
|3 |4 |
|4 |  |

Now I want to add an empty cell in @2$2 (below the heading) and thus move
the following cells in column 2 down one step.

After:
|1 |1 |
|2 |  |
|3 |3 |
|4 |4 |

Is this doable?

Regards
Gustav


Re: [O] TABLES: Remove/add cell

2011-09-30 Thread Michael Brand
Hi Gustav

Ehm - it is doable, but not by editing commands from Org table. Only
with several rectangular edits or an Org table formula with a few
tricks and a temporary column to be removed afterward. Probably not as
comfortable as you have expected:

- insert row in only one column
  start with:
  | a | 1 |   |
  | b | 3 |   |
  | c | 4 |   |
  | d |   |   |

  | a | 1 | 1 |
  | b | 3 |   |
  | c | 4 | 3 |
  | d |   | 4 |
  #+TBLFM: @1$3=$-1::@3$3..@>$3=subscr(@2$2..@>>$2, @# - 2)

- remove again
  start with:
  | a | 1 |   |
  | b |   |   |
  | c | 3 |   |
  | d | 4 |   |

  | a | 1 | 1 |
  | b |   | 3 |
  | c | 3 | 4 |
  | d | 4 |   |
  #+TBLFM: @1$3=$-1::@2$3..@>>$3=subscr(@3$2..@>$2, @# - 1)

See the Calc manual for "subscr" and the Org manual for "@#" and the rest.

If it does not work (e. g. org-version 6.33) then upgrade.

Michael

2011/9/30 Gustav Wikström :
> How do I add or remove a single cell in a table?
> Example:
> I have the following table:
> |        1 |        1 |
> |        2 |        3 |
> |        3 |        4 |
> |        4 |          |
> Now I want to add an empty cell in @2$2 (below the heading) and thus move
> the following cells in column 2 down one step.
> After:
> |        1 |        1 |
> |        2 |          |
> |        3 |        3 |
> |        4 |        4 |
> Is this doable?



Re: [O] TABLES: Remove/add cell

2011-09-30 Thread brian powell
* May want to turn org-mode/table off temporarily (or maybe it will
just make it easier) then you can do the "rectangle edits" michael was
referring to:
** Go to the point just to the right of the 4.
** C@ ---marks the point.
** Go to the 3.
** Cxrk
** Go to "@2$2"--i.e. where the "4" used to be.
** Cxry
* Emacs OrgMode makes all of this easier since it lines everything up
for you by "covering down" the columns (org-table-align)---making all
the cells easily edited by the usual "rectangle-killing" and
"rectangle-yanking" methods.
** The method above can be generalized for editing OrgMode tables
regardless of the number of symbols in the cells--since OrgMode aligns
them for you; and, EMACS is restricted only by the amount of RAM in
your computer.
*** Also, if you want to edit gygabyte size files, using similar
methods, I highly recommend QEMACS.



Re: [O] TABLES: Remove/add cell

2011-09-30 Thread Michael Brand
Oh, and there is a much easier solution, probably the easiest:

Transpose the table with this
http://orgmode.org/worg/org-hacks.html#sec-1-3-1
If the section numbering changed in the meantime: look for "Transpose
tables (Juan Pechiar)"

and split it into two (or three) tables:

| a | b | c | d |

| 1 | 3 | 4 |   |

(| e | f | g | h |)

Then you can use the very convenient editing functions of Org table on
the second part of the table, join the parts together and transpose
again.

Michael

2011/9/30 Michael Brand :
> Ehm - it is doable, but not by editing commands from Org table. Only
> with several rectangular edits or an Org table formula with a few
> tricks and a temporary column to be removed afterward. Probably not as
> comfortable as you have expected:
>
> - insert row in only one column
>  start with:
>  | a | 1 |   |
>  | b | 3 |   |
>  | c | 4 |   |
>  | d |   |   |
>
>  | a | 1 | 1 |
>  | b | 3 |   |
>  | c | 4 | 3 |
>  | d |   | 4 |
>  #+TBLFM: @1$3=$-1::@3$3..@>$3=subscr(@2$2..@>>$2, @# - 2)
>
> - remove again
>  start with:
>  | a | 1 |   |
>  | b |   |   |
>  | c | 3 |   |
>  | d | 4 |   |
>
>  | a | 1 | 1 |
>  | b |   | 3 |
>  | c | 3 | 4 |
>  | d | 4 |   |
>  #+TBLFM: @1$3=$-1::@2$3..@>>$3=subscr(@3$2..@>$2, @# - 1)
>
> See the Calc manual for "subscr" and the Org manual for "@#" and the rest.
>
> If it does not work (e. g. org-version 6.33) then upgrade.



Re: [O] TABLES: Remove/add cell

2011-09-30 Thread Gustav Wikström
This is similar to the way I've done it before. It makes it cumbersome if
there are many lines below the cell that is to be inserted though..

It would be nice to have as a function that inserts or deletes a cell in the
same way as one can insert and delete rows and columns. Maybe as a prefix
to M-S- and M-S- ?

/Gustav

On Fri, Sep 30, 2011 at 8:50 PM, brian powell wrote:

> * May want to turn org-mode/table off temporarily (or maybe it will
> just make it easier) then you can do the "rectangle edits" michael was
> referring to:
> ** Go to the point just to the right of the 4.
> ** C@ ---marks the point.
> ** Go to the 3.
> ** Cxrk
> ** Go to "@2$2"--i.e. where the "4" used to be.
> ** Cxry
> * Emacs OrgMode makes all of this easier since it lines everything up
> for you by "covering down" the columns (org-table-align)---making all
> the cells easily edited by the usual "rectangle-killing" and
> "rectangle-yanking" methods.
> ** The method above can be generalized for editing OrgMode tables
> regardless of the number of symbols in the cells--since OrgMode aligns
> them for you; and, EMACS is restricted only by the amount of RAM in
> your computer.
> *** Also, if you want to edit gygabyte size files, using similar
> methods, I highly recommend QEMACS.
>


[O] Time range end in agenda view not displayed

2011-09-30 Thread michael holzer
Hi everyone,

I'm having a problem with the agenda view, hopefully someone can tell me
what I'm doing wrong:

When I have an entry that contains a time range, for example:

* timerange
  <2011-09-30 Fri 14:00>--<2011-09-30 Fri 18:00>

this shows up in the agenda view as:

  uni:14:00.. timerange

while I would expect something like:

  uni:14:00-18:00 timerange

as the manual says
(http://orgmode.org/org.html#Time_002dof_002dday-specifications).

Thanks for any help,
michael




[O] looking for examples using babel/calc

2011-09-30 Thread orgm...@h-rd.org

Hi,

is there some documentation and are there some examples of using babel  
with calc?  I have no luck in getting it to work.


thanks.






Re: [O] Kill org files on agenda exit

2011-09-30 Thread Darlan Cavalcante Moreira

A good thing is that "x" will not close files that you have manually
opened. Only the files opened by org-mode when processing the agenda are
closed.

--
Darlan

At Fri, 30 Sep 2011 18:59:06 +0200,
Michael Brand  wrote:
> 
> Hi Gene
> 
> On Fri, Sep 30, 2011 at 18:49, Gene Cooley  wrote:
> > Whenever I exit my agenda views, there are still all org agenda files open. 
> > Is there any possibility to kill those buffers on agenda exit?
> 
> It seems you have used "q" to exit. This variant leaves the agenda
> buffers open. To close them use the variant "x".
> 
> Michael
> 



[O] [PATCH][babel] add a string input to ob-octave

2011-09-30 Thread Litvinov Sergey
Please consider a tiny patch to add a string input variable to
ob-octave. I also add tests for ob-octave.
>From 4848960cefc1b1486705f7aed022ba199189b6e1 Mon Sep 17 00:00:00 2001
From: Litvinov Sergey 
Date: Sat, 1 Oct 2011 02:04:49 +0200
Subject: [PATCH] Add string input variables to ob-octave.el. Add tests for ob-octave.el

---
 lisp/ob-octave.el   |6 +++-
 testing/README.org  |1 +
 testing/examples/ob-octave-test.org |   43 +++
 testing/lisp/test-ob-octave.el  |   55 +++
 4 files changed, 104 insertions(+), 1 deletions(-)
 create mode 100644 testing/examples/ob-octave-test.org
 create mode 100644 testing/lisp/test-ob-octave.el

diff --git a/lisp/ob-octave.el b/lisp/ob-octave.el
index 3d90954..cfc1f1d 100644
--- a/lisp/ob-octave.el
+++ b/lisp/ob-octave.el
@@ -117,7 +117,11 @@ specifying a variable of the same value."
   (if (listp var)
   (concat "[" (mapconcat #'org-babel-octave-var-to-octave var
 			 (if (listp (car var)) "; " ",")) "]")
-(format "%s" (or var "nil"
+(cond
+ ((stringp var)
+  (format "\'%s\'" (or var "nil")))
+ (t
+  (format "%s" (or var "nil"))
 
 (defun org-babel-prep-session:octave (session params &optional matlabp)
   "Prepare SESSION according to the header arguments specified in PARAMS."
diff --git a/testing/README.org b/testing/README.org
index 2f16a55..221a33c 100644
--- a/testing/README.org
+++ b/testing/README.org
@@ -79,6 +79,7 @@ First tangle this file out to your desktop.
(list (concat org-dir "/testing/examples/babel.org")
  (concat org-dir "/testing/examples/normal.org")
  (concat org-dir "/testing/examples/ob-awk-test.org")
+ (concat org-dir "/testing/examples/ob-octave.org")
  (concat org-dir "/testing/examples/ob-fortran-test.org")
  (concat org-dir "/testing/examples/link-in-heading.org")
  (concat org-dir "/testing/examples/links.org")))
diff --git a/testing/examples/ob-octave-test.org b/testing/examples/ob-octave-test.org
new file mode 100644
index 000..37cf3f9
--- /dev/null
+++ b/testing/examples/ob-octave-test.org
@@ -0,0 +1,43 @@
+#+Title: a collection of examples for ob-octave tests
+#+OPTIONS: ^:nil
+
+* Simple tests
+  :PROPERTIES:
+  :ID:   54dcd61d-cf6c-4d7a-b9e5-854953c8a753
+  :END:
+Number output
+#+begin_src octave :exports results :results silent
+ans = 10
+#+end_src
+
+Array output
+#+begin_src octave :exports results :results silent
+ans = 1:4'
+#+end_src
+
+* Input tests
+  :PROPERTIES:
+  :ID:   cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba
+  :END:
+Input an integer variable
+#+begin_src octave :exports results :results silent :var s=42
+ans = s
+#+end_src
+
+
+Input an array
+#+begin_src octave :exports results :results silent :var s='(1.0 2.0 3.0)
+ans = s
+#+end_src
+
+Input a matrix
+#+begin_src octave :exports results :results silent :var s='((1 2) (3 4))
+ans = s
+#+end_src
+
+Input a string
+#+begin_src octave :exports results :results silent :var s="test"
+ans = s(1:2)
+#+end_src
+
+
diff --git a/testing/lisp/test-ob-octave.el b/testing/lisp/test-ob-octave.el
new file mode 100644
index 000..f3972ec
--- /dev/null
+++ b/testing/lisp/test-ob-octave.el
@@ -0,0 +1,55 @@
+;;; test-ob-octave.el --- tests for ob-octave.el
+
+;; Copyright (c) 2010 Sergey Litvinov
+;; Authors: Sergey Litvinov
+
+;; Released under the GNU General Public License version 3
+;; see: http://www.gnu.org/licenses/gpl-3.0.html
+
+(org-test-for-executable "octave")
+
+(let ((load-path (cons (expand-file-name
+			".." (file-name-directory
+			  (or load-file-name buffer-file-name)))
+		   load-path)))
+  (require 'org-test)
+  (require 'org-test-ob-consts))
+
+(require 'ob-octave)
+
+(ert-deftest ob-octave/input-none ()
+  "Number output"
+  (org-test-at-id "54dcd61d-cf6c-4d7a-b9e5-854953c8a753"
+(org-babel-next-src-block)
+(should (= 10 (org-babel-execute-src-block)
+
+(ert-deftest ob-octave/output-vector ()
+  "Vector output"
+  (org-test-at-id "54dcd61d-cf6c-4d7a-b9e5-854953c8a753"
+(org-babel-next-src-block 2)
+(should (equal '((1 2 3 4)) (org-babel-execute-src-block)
+
+(ert-deftest ob-octave/input-variable ()
+  "Input variable"
+  (org-test-at-id "cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba"
+(org-babel-next-src-block)
+(should (= 42 (org-babel-execute-src-block)
+
+(ert-deftest ob-octave/input-array ()
+  "Input an array"
+  (org-test-at-id "cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba"
+(org-babel-next-src-block 2)
+(should (equal '((1 2 3)) (org-babel-execute-src-block)
+
+(ert-deftest ob-octave/input-matrix ()
+  "Input a matrix"
+  (org-test-at-id "cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba"
+(org-babel-next-src-block 3)
+(should (equal '((1 2) (3 4)) (org-babel-execute-src-block)
+
+(ert-deftest ob-octave/input-string ()
+  "Input a string"
+  (org-test-at-id "cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba"
+(org-babel-next-src-b

Re: [O] Time range end in agenda view not displayed

2011-09-30 Thread XeCycle
michael holzer  writes:

> Hi everyone,
>
> I'm having a problem with the agenda view, hopefully someone can tell me
> what I'm doing wrong:
>
> When I have an entry that contains a time range, for example:
>
> * timerange
>   <2011-09-30 Fri 14:00>--<2011-09-30 Fri 18:00>

I think they should look like <2011-09-30 Fri 14:00-18:00>.

> this shows up in the agenda view as:
>
>   uni:14:00.. timerange
>
> while I would expect something like:
>
>   uni:14:00-18:00 timerange
>
> as the manual says
> (http://orgmode.org/org.html#Time_002dof_002dday-specifications).
>
> Thanks for any help,
> michael
>
>
>

-- 
Carl Lei (XeCycle)
Department of Physics, Shanghai Jiao Tong University
OpenPGP public key: 7795E591
Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591


pgptXrCPnausG.pgp
Description: PGP signature


Re: [O] org-mobile-push

2011-09-30 Thread Nick Dokos
Vikas Rawal  wrote:

> Thanks Nick and Jambunathan for taking the trouble to respond.
> 
> > 
> > So pretty please: when you get an error, *at the very least*, do
> > 
> >M-x toggle-debug-on-error
> 
> Thanks nick for teaching my how to use back-trace. Here is the
> output. May I request you to help identify what could be causing the
> problem.
> 

The backtrace shows (you read it from the bottom up) that the following sequence
of calls took place:

   org-mobile-push -> org-mobile-create-sumo-agenda ->
 org-store-agenda-views -> org-batch-store-agenda-views ->
   org-agenda(nil "X") -> org-agenda-run-series("SUMO" ...) ->
 org-agenda-list -> org-get-entries-from-diary ->
   diary-list-entries -> run the diary-hook ->
 appt-make-list

In trying to call this last function, emacs gets an error: the function
is not defined.

Basically what happens is that org-mobile-push calculates the agenda, by
calling org-agenda-list. This function checks the value of the variable
org-agenda-include-diary, which in your case must be t, so it tries to
add agenda entries from the diary.  It calls org-get-entries-from-diary
to do that, which calls diary-list-entries. This one runs the diary-hook
and somewhere in your init files you must have done something like
this:

  (add-hook 'diary-hook (function appt-make-list))

When the hook is run, emacs tries to call the function, does not find it and
complains.

To fix it, change the above line to

  (require 'appt)
  (add-hook 'diary-hook (function appt-make-list))

The (require 'appt) makes sure that the file that defines this function is
loaded, the function is defined when emacs needs to call it and the problem
is resolved.

Strictly speaking, the function does not need to be defined that early:
it only needs to be defined before it is called, but if you are going to
call it, you might as well do it early. If that's not desirable for some
reason, you can use the autoload mechanism (see the emacs manual for
that).

Note that there are two customizations (the setting of
org-agenda-include-diary to t and the setting of diary-hook) that caused
your problem. I don't include the diary in my agenda, so I would not
have seen the problem at all. That's one of the reasons why it's
important for everybody to have the Pavlovian response:

  error --> must get backtrace

It can pinpoint where *your* problem is and show the way to a solution.

HTH,
Nick


> Debugger entered--Lisp error: (void-function appt-make-list)
>   appt-make-list()
>   run-hooks(diary-hook)
>   diary-list-entries((9 26 2011) 1)
>   byte-code("\301\302!\203\nfter>"))) (alltodo nil ((org-agenda-title-append 
> "KEYS=t TITLE: ALL TODO "))) (agenda "" 
> ((org-agenda-title-append "KEYS=n#1 TITLE: Agenda and all TODO's 
> "))) (alltodo nil ((org-agenda-title-append "KEYS=n#2 TITLE: 
> Agenda and all TODO's " ((org-agenda-compact-blocks nil)) 
> ("/home/vikas/Dropbox/MobileOrg/agendas.org")))
>   ...
>   org-agenda(nil "X")
>   (let ((org-agenda-compact-blocks nil)) (org-agenda nil thiscmdkey))
>   eval((let ((org-agenda-compact-blocks nil)) (org-agenda nil thiscmdkey)))
>   ...
>   ...
>   (org-batch-store-agenda-views)
>   eval((org-batch-store-agenda-views))
>   org-store-agenda-views()
>   org-mobile-create-sumo-agenda()
>   org-mobile-push()
>   call-interactively(org-mobile-push t nil)
>   execute-extended-command(nil)
>   call-interactively(execute-extended-command nil nil)
> 
> > which means that you can load the file and therefore define the function
> > by inserting
> > 
> > (require 'appt)
> 
> Thanks Jambunathan and Nick. This indeed solves the problem.
> 
> Vikas
>