[O] Quirk in Emacs-Lisp code block evaluation

2011-07-28 Thread Matthew Snyder
Hello -

I noticed today as I was playing with code blocks that some results are 
prematurely truncated, possibly because they contain nil as a first element and 
are thus considered empty return values.

Consider:


#+BEGIN_SRC emacs-lisp
'(a nil nil b)
#+END_SRC

#+results:
| a | nil | nil | b |

But then:

#+BEGIN_SRC emacs-lisp
'(nil nil nil b)
#+END_SRC

#+results:

I'm using Emacs 24.0.50.1 and Org Mode 7.6, ELPA version 20110728.

--
Matthew Snyder


Re: [O] How-to evaluate Java-snippets in org-mode/org-babel?

2011-07-28 Thread Eric Schulte
Torsten Wagner  writes:

> Hi Eric,
>
> some feedback of first testing weeks
> It works well on my desktop machine, I tried to do the same on my
> laptop. However, I faced the problem that java did not find the files.
> I tried everything. Made sure using the same java and emacs version
> (same linux distro, same test file). Copied over .emacs config files,
> compared the versions of ob-java.el on both machines. I couldn't
> figure out why it works with one and does not work on the other
> machine.
> Somehow the classpath seems to differ buy I do not see where to change
> it in the correct way.
>
> I hacked a bit into ob-java.el file. I noticed that you call the
> generated class file by creating the string
>
> java packagename/classname
>
> whereas packagename/classname is coming from the classname variable
> set at the source-code block.
>
> In the earlier attempt we used
>
> java -cp . packagename.classname
>
> which makes sure the classpath is set to the local directory.
>
> I hacked this into your code and now it works on the laptop too (to
> say this modification works on both desktop and laptop). It might be
> worse to add, since the classpath seems to be set depending on many
> parameters (distro, other java ides, local user settings, etc.). Thus,
> many might observe problems at this point.
>
> Please find a patch attached.
>
> Even better would be to add an option to set the classpath but my
> elisp skills are to poor for that but would like to see how to do
> it ;)
> #+BABEL: :classpath "."
> where it might be the local directory by default?!
>

I've just pushed up a slightly different solution which involves two new
header arguments
- :cmpflag can be used to pass flags to the java compiler (e.g., "cp .")
- :cmdline can be used to pass flags to the java executable (e.g., "cp .")

So, the following could be used to get the behavior resulting from your
patch using these flags.

#+begin_src emacs-lisp
(setq org-babel-default-header-args:java '((:cmpflag "-cp .") (:cmdline "-cp 
.")))
#+end_src

This solution somehow seems more flexible in that it won't force a
classpath value on users and will allow for passing other flags to the
java runtime.

>
> Beside of that I noticed that there might be a need for a plain-text
> mode.. sounds funny, but maybe sometimes someone need auxiliary files
> which are not executed by themselves. Sure I could use simply a shell
> session and echo into a file, or tangle it,  but I guess it might be
> more elegant to have a, "only-paste-this-into-this-file-execute"
>
> #+BEGIN_SRC: plain :filename folder/folder/testdata.csv
> 1, 2
> 2, 4
> 3, 8
> #+END_SRC
> to generate /folder/folder/testdata.csv which contains the data in the
> block.
>

This is currently possible with tangling, e.g.,

#+begin_src text :tangle somewhere.txt
  This will still tangle out to a file, and it opens in text mode, which
  may be nice.  
#+end_src

Thanks for the feedback and the patch -- Eric

>
> Because sometimes, one might need to call external programs or
> programs in code-blocks are supposed to read data from files instead
> from within org-babel.
>
> In general this could be the standard feature for all unrecognised
> languages. Probably with a warning that the required
> compiler/interpreter is not configured. However, this would allow
> people at least to get the source files which they could use
> externally. The difference to tangle would be that one can decide
> block by block what to execute. E.g., I could have several of the
> above "testdata" blocks and simply executing one of them would change
> the input for later code blocks.
>
> Totti
>
>
>
>

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



Re: [O] cleaning all the #+results from an org document

2011-07-28 Thread Eric Schulte
Ista Zahn  writes:

> On Thu, Jul 28, 2011 at 8:59 AM, Stephen Eglen
>  wrote:
>> Thanks Torsten, you've expressed it elegantly!
>>>
>>> a) send it to someone without the results (to let him create his own)
>>> b) archive them without having possible huge amount of lines of
>>> results which can be reproduced any time by executing the block again.
>>> c) to delete all the old results and start "fresh"
>
> +1 for c. I often work with R objects that are simply too large to
> store in org tables, so I use babel caching + session + write / load R
> data files from disk. This works, but it becomes easy to get to an
> inconsistent state, and I would like to be able to delete the results
> blocks and run the whole thing fresh.
>

You could try evaluating the following with "M-x :" in an Org-mode
buffer.  If this works well then I'll give it its own function name and
key shortcut (key combo suggestions welcome).

#+begin_src emacs-lisp
  (org-babel-map-src-blocks nil (org-babel-remove-result))
#+end_src

Thank -- Eric

>
> Best,
> Ista
>
>>
>> I was mostly thinking about b (for putting into version control) and c,
>> for giving to students to try out.
>>
>> Stephen
>>
>>

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



Re: [O] Pattch to org.texi: Document ":eval no"

2011-07-28 Thread Eric Schulte
Applied, Thanks for the patch -- Eric

"Sebastien Vauban"  writes:

> Hi Stephen,
>
> Stephen Eglen wrote:
>> Small patch attached, thanks Seb for pointing this out.
>>
>> Stephen
>>
>> diff --git a/doc/org.texi b/doc/org.texi
>> index 3ecf897..eb45885 100644
>> --- a/doc/org.texi
>> +++ b/doc/org.texi
>> @@ -12990,10 +12990,10 @@ permissions of the tangled file are set to make it 
>> executable.
>>  @subsubsection @code{:eval}
>>  The @code{:eval} header argument can be used to limit the evaluation of
>>  specific code blocks.  @code{:eval} accepts two arguments ``never'' and
>> -``query''.  @code{:eval never} will ensure that a code block is never
>> -evaluated, this can be useful for protecting against the evaluation of
>> -dangerous code blocks.  @code{:eval query} will require a query for every
>> -execution of a code block regardless of the value of the
>> +``query''.  @code{:eval never} (or @code{:eval no}) will ensure that a code
>> +block is never evaluated, this can be useful for protecting against the
>> +evaluation of dangerous code blocks.  @code{:eval query} will require a 
>> query
>> +for every execution of a code block regardless of the value of the
>>  @code{org-confirm-babel-evaluate} variable.
>>  
>>  If this header argument is not set then evaluation is determined by the 
>> value
>
> While this -- really! -- is an excellent initiative (to update the doc when
> you notice something's missing).
>
> Note that, would have better read my notes, instead of counting on my memory,
> I would have told you ":eval never". Though, I just checked, and confirm that
> ":eval no" is (for the moment) equivalent to it: see ob.el, lines 218 and 226.
>
> So, this patch makes sense -- except if Eric wants to let this option
> disappear, and only supports it in the code for backward compatibility.
>
> Best regards,
>   Seb

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



Re: [O] Emacs and tablet devices

2011-07-28 Thread T Helms

On 07/28/2011 08:44 AM, Jason F. McBrayer wrote:

On Thu, 28 Jul 2011 13:59:18 +0200, Piter_ wrote:


It may be not the best place to ask, but:
How useful is emacs on tablet devices. I have been thinking about
emacs and freerunner. But I have no clue how the keybindings work
with it.

Another possible device you might consider is the N850/900/950
series. I'm fairly certain there is a native emacs build for those
that requires no special jiggery-pokery.



I have an n900.  Emacs and org work wonderfully for a small device.  I'm 
using 23.2 compiled by Sander Boer on this list.


The keyboard is easily remapped.  The only downsides are the screen size 
& speed.  A task that takes 4 sec. to run on my laptop takes over 30 on 
the phone (iterating large tables and the like).


Capture & clocking make it very useful in the handheld, so useful that I 
just picked a 2nd device to have when my current one dies.


I can't speak to tablets or the freerunner but I would think the lack of 
a real keyboard would be difficult to overcome.




Re: [O] Release 7.7

2011-07-28 Thread suvayu ali
On Fri, Jul 29, 2011 at 12:00 AM, Nathan Neff  wrote:
> On Thu, Jul 28, 2011 at 9:33 AM, Michael C Gilbert  wrote:
>> On Jul 28, 2011, at 3:47 AM, Bastien wrote:
>>
>>> Allow relative time when scheduling/adding a deadline
>>> ==
>
> How is this different from the previous behavior?  I thought it was always
> possible to type +2d to schedule something 2 days in the future?
>

This is the new part:

... and three weeks after the _current timestamp_, if any


> Thanks,
> --Nate
>
>



-- 
Suvayu

Open source is the future. It sets us free.



[O] Keeping vertical bars in exported, ASCII file

2011-07-28 Thread Michael Hannon
Greetings.  I wonder if there's a way to tell Emacs to keep the "fences"
(vertical bars) in an exported, ASCII file.  I.e., sometimes I'd like:

    | Name  | Phone | Age |
    |---+---+-|
    | Peter |  1234 |  17 |
    | Anna  |  4321 |  25 |

instead of:

  Name    Phone   Age  
 ---+---+-
  Peter    1234    17  
  Anna 4321    25  

Is there some way to do that?

I've tried:

    #+OPTIONS |:t
    #+OPTIONS ::t
    #+OPTIONS |:t ::t

but didn't notice any change in the output.

Thanks,

-- Mike

Re: [O] Release 7.7

2011-07-28 Thread Nathan Neff
On Thu, Jul 28, 2011 at 9:33 AM, Michael C Gilbert  wrote:
> On Jul 28, 2011, at 3:47 AM, Bastien wrote:
>
>> Allow relative time when scheduling/adding a deadline
>> ==

How is this different from the previous behavior?  I thought it was always
possible to type +2d to schedule something 2 days in the future?

Thanks,
--Nate



Re: [O] getorg.sh script

2011-07-28 Thread suvayu ali
Hi Jude,

On Thu, Jul 28, 2011 at 11:39 PM, Bernt Hansen  wrote:
> If that happens and you get a conflict you don't know how to deal with
> and you're willing to reedit your Makefile changes (which you would have
> to do anyway if you get a fresh clone) then you can just nuke everything
> with
>
> $ git checkout master
> $ git reset --hard origin/master
>
> and then redo your Makefile changes instead of recloning.
>

If you are willing to commit your changes to the Makefile in your local
repository you can do this:

$  Makefile # here master = origin/master
$ git commit -i Makefile -m "My changes" # master = origin/master+1
$ git pull --rebase --stat

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] getorg.sh script

2011-07-28 Thread Bernt Hansen
> On Thu, 28 Jul 2011, Bernt Hansen wrote:
>
>> In what situations does org-mode update fail?  I've never had to reclone
>> the org-mode repository - ever.  If git update fails, just do it again.
>> Recloning means you need to download all of the objects for org-mode
>> again which should never be necessary.
>> 
>> If you've messed up your local master branch somehow and want to revert
>> back to the official 'master' branch then just
>> 
>> $ git checkout master
>> $ git reset --hard origin/master
>> 
>> which throws away any local commits and uncommitted changes in your
>> working directory.
>> 
>> I fail to understand why you would ever need this script.  Can you
>> please elaborate?
>> 

Jude DaShiell  writes:

> Whenever I apply a patch to the Makefile an orgmode update fails since 
> my local changes have to be stashed or commited according to git.  It's 
> the merge step that fails.
>
> I probably know less about git than I ought to, but that's what's 
> happened over here.

Okay - there's an article on Worg about keeping local changes on top of
org-mode development (basically you commit your Makefile changes and
always rebase on top of origin/master -- which happens automatically
when you merge with git pull)

If that happens and you get a conflict you don't know how to deal with
and you're willing to reedit your Makefile changes (which you would have
to do anyway if you get a fresh clone) then you can just nuke everything
with

$ git checkout master
$ git reset --hard origin/master

and then redo your Makefile changes instead of recloning.

Let me know if I can provide any information to make this less painful
for you.

Regards,
Bernt




Re: [O] getorg.sh script

2011-07-28 Thread Jude DaShiell
Whenever I apply a patch to the Makefile an orgmode update fails since 
my local changes have to be stashed or commited according to git.  It's 
the merge step that fails.

I probably know less about git than I ought to, but that's what's 
happened over here.

On Thu, 28 Jul 2011, Bernt Hansen wrote:

> Jude DaShiell  writes:
> 
> > These days I use this when an org-mode update fails and I have to erase 
> > the whole org-mode directory tree and clone org-mode again.  
> > Cut here.
> >
> > #!/bin/bash
> > #file getorg.sh - run git to update local org repository.
> > if [ -r ~/org-mode  ]; then
> > echo "updating emacs-org-mode"
> > cd org-mode
> > git pull
> > make all
> > sudo make install
> > sudo make install-info
> > exit 0
> > fi
> > echo "getting new clone of emacs-org-mode"
> > mkdir org-mode
> > cd ~/org-mode
> > git clone git://orgmode.org/org-mode.git
> > make all
> > sudo make install
> > sudo make install-info
> >
> > cut here.
> > I learned some additional bash shell technique as a result of having 
> > written this script so am happy to have done it and gained the experience.
> 
> Hi Jude,
> 
> In what situations does org-mode update fail?  I've never had to reclone
> the org-mode repository - ever.  If git update fails, just do it again.
> Recloning means you need to download all of the objects for org-mode
> again which should never be necessary.
> 
> If you've messed up your local master branch somehow and want to revert
> back to the official 'master' branch then just
> 
> $ git checkout master
> $ git reset --hard origin/master
> 
> which throws away any local commits and uncommitted changes in your
> working directory.
> 
> I fail to understand why you would ever need this script.  Can you
> please elaborate?
> 
> Thanks,
> Bernt
> 
> 





Re: [O] Org-Mode Homepage error

2011-07-28 Thread Achim Gratz
Bastien  writes:
> Mhh...  I tried to patch org-info-src.js with this fix, to recompile 
> it (and get org-info.js).  I copied the result here:
>
>   http://orgmode.org/org-info2.js 
>
> Then setting this path in `org-infojs-options', I tried various ways 
> of getting a working HTML file, with the new div structure, but with 
> no good result.

I didn't have time to check if the change survives the minify script and
was out the last two days.  The unminified version did work on the Worg
writeup from Sebastian Rose.  Since he appears not to have responded to
this thread so far I'll try to check what the issue with the minified
version might be.


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

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




[O] parsing options

2011-07-28 Thread Eric Abrahamsen
Is there a generic function for parsing options lines at the top of a
file? I'd like to use some custom lines to set certain file-specific
variables, and haven't quite figured out the best way to do that.

It looks like org-set-regexps-and-options does that when you open a new
file, but that's a bear of a function, and doesn't provide for setting
your own options (or at least doesn't appear to, my eyes crossed while
reading it).

Is there any smaller function available for our own minor modes or use
cases? Should I just use regexp search? If there isn't anything like
this, would one be useful (something that either found an option value
or returned a default, or found an alist of option values, or found an
alist of values for options matching a regexp, etc)?

Thanks,
Eric




Re: [O] Attachments and refiling

2011-07-28 Thread Bernt Hansen
> At Thu, 28 Jul 2011 09:51:54 +0200,
> Bastien  wrote:
>> 
>> Hi Darlan,
>> 
>> here is how I see the situation regarding attachments:
>> 
>> 1. org-attach.el is nice because it makes it easy to attach a file to a
>>task, while not *worrying* about where the file is on the harddrive.
>> 
>> 2. Adding an ATTACH_DIR property will always add an absolute path, so
>>there is no problem when moving an entry with an explicit ATTACH_DIR.
>> 
>> 3. Refiling/archiving subtrees lose track of some attachments when the
>>attach directory "data/" is *relative* to the org file (which is the
>>default) and when the target org file is not in the same directory.
>> 
>> 4. Moving an entry with an ATTACH_DIR_INHERIT will lose attachments 
>>when the ATTACH_DIR of the target entry is different.
>> 
>> (3) and (4) are two distinct problems.
>> 
>> I suggest fixing problem (3) by making `org-attach-dir' defaulting to
>> "~/.org-attachments/".  I
>> 
>> I suggest fixing problem (4) by explicitely replacing ATTACH_DIR_INHERIT
>> with the corresponding ATTACH_DIR when the target subtree has a
>> different ATTACH_DIR.
>> 
>> The core idea is that I want to avoid moving files themselves: I think
>> it's a risky road, and I hope the solutions above will make this road
>> unnecessary.
>> 
>> I'm interested in feedback and ideas about such proposed changes.  

Darlan Cavalcante Moreira  writes:

> Regarding (2), is this a design decision? Currently I have the ATTACH_DIR
> property of some headings set to a relative path from the org file and it
> works perfectly. That is, it is possible to use either absolute or relative
> path for the ATTACH_DIR property right now.
>
> But if this is a design decision then I should not consider this behavior
> as granted, right?
>
> Also, Suvayu's suggestion for the default attachments directory is the best
> solution IMHO. That is, the default attach directory should be relative to
> org-directory.

I've used attachments in the past to *copy* attached files somewhere
into my org git repository (~/git/org) with attachments under
~/git/org/data/...

Since the files are copied I can refile the task with the attachment
anywhere in the same git repository without worrying about the details
of exactly where it lives.  Since then I've stopped using attachments
regularly but I still have archived tasks with attachments in my git
repo.

None of my existing entries have ever specified an ATTACH_DIR*
property.  Whatever solution is arrived at from this thread I would like
my existing (old) attachments to still be retrievable.

-Bernt

PS. Darlan: Please don't top-post, it makes articles much harder to read.



Re: [O] Release 7.7

2011-07-28 Thread Marcelo de Moraes Serpa
Thank you guys! Awesome release. Hope to be able to contribute soon,
currently getting my head around elisp and the org mode source.

@Bastien enjoy your vacation... post some pictures!

Cheers!

Marcelo.

On Thu, Jul 28, 2011 at 9:33 AM, Michael C Gilbert  wrote:

> On Jul 28, 2011, at 3:47 AM, Bastien wrote:
>
> > Allow relative time when scheduling/adding a deadline
> > ==
> >
> > You can now use relative duration strings like "-2d" or "++3w"
> > when calling =org-schedule= or =org-deadline=: it will schedule
> > (or set the deadline for) the item respectively two days before
> > today and three weeks after the current timestamp, if any.
> >
> > You can use this programmatically: =(org-schedule nil "+2d")=
> > will work on the current entry.
> >
> > You can also use this while (bulk-)rescheduling and
> > (bulk-)resetting the deadline of (several) items from the agenda.
> >
> > Thanks to Memnon Anon for a heads up about this!
>
> Thank you to both Memnon and Bastien. This feature alone has already made a
> difference to me and my colleagues.
>
> Orgmode and its contributors continue to astound me.
>
> — Michael
>
> Nonprofit News
> http://nonprofitnews.org
>
>
>
>


Re: [O] Attachments and refiling

2011-07-28 Thread Darlan Cavalcante Moreira

Regarding (2), is this a design decision? Currently I have the ATTACH_DIR
property of some headings set to a relative path from the org file and it
works perfectly. That is, it is possible to use either absolute or relative
path for the ATTACH_DIR property right now.

But if this is a design decision then I should not consider this behavior
as granted, right?

Also, Suvayu's suggestion for the default attachments directory is the best
solution IMHO. That is, the default attach directory should be relative to
org-directory.
  
--
Darlan

At Thu, 28 Jul 2011 09:51:54 +0200,
Bastien  wrote:
> 
> Hi Darlan,
> 
> here is how I see the situation regarding attachments:
> 
> 1. org-attach.el is nice because it makes it easy to attach a file to a
>task, while not *worrying* about where the file is on the harddrive.
> 
> 2. Adding an ATTACH_DIR property will always add an absolute path, so
>there is no problem when moving an entry with an explicit ATTACH_DIR.
> 
> 3. Refiling/archiving subtrees lose track of some attachments when the
>attach directory "data/" is *relative* to the org file (which is the
>default) and when the target org file is not in the same directory.
> 
> 4. Moving an entry with an ATTACH_DIR_INHERIT will lose attachments 
>when the ATTACH_DIR of the target entry is different.
> 
> (3) and (4) are two distinct problems.
> 
> I suggest fixing problem (3) by making `org-attach-dir' defaulting to
> "~/.org-attachments/".  I
> 
> I suggest fixing problem (4) by explicitely replacing ATTACH_DIR_INHERIT
> with the corresponding ATTACH_DIR when the target subtree has a
> different ATTACH_DIR.
> 
> The core idea is that I want to avoid moving files themselves: I think
> it's a risky road, and I hope the solutions above will make this road
> unnecessary.
> 
> I'm interested in feedback and ideas about such proposed changes.  
> 
> Thanks a lot!
> 
> -- 
>  Bastien



Re: [O] #+STARTUP: nologrefile seemingly not respected

2011-07-28 Thread Brian van den Broek
Hi all,

On 28 July 2011 01:12, Brian van den Broek  wrote:

> I have '(setq org-log-refile 'time)' in my .emacs. I have the line
> '#+STARTUP: nologrefile' in a subtree at the bottom of my inbox.org.
>
> Given this setup, I'd expect to get refiling notes with the time of
> refiling when I refile from org files *other* than inbox.org and not
> to get refiling notes when refiling from inbox.org. However, I get
> refiling notes when refiling from any .org file, including inbox.org.
>
> I am using org-mode 7.6 on emacs version 23.2.1
>
> Is the problem with my expectations or in org-mode's behaviour?

As org-mode 7.7 was released since I sent this yesterday, it seemed
worth the self-reply to update the query. The relevant behaviour of
7.7 is the same as that of 7.6.

Thanks and best,

Brian vdB



Re: [O] Remove orgx files

2011-07-28 Thread Stefan Vollmar
Dear Bastian,
dear Carsten,

we have just re-organized parts of our software documentation (Org-mode 
exlusively, of course) and I had a "colophon" section in mind with all Org 
source files and a short description of our workflow (it might be ready in a 
few days). Here is a link to the index page:

http://www.nf.mpg.de/vhist/doc/usage/theindex.html 

demonstrating the idea behind the include mechanism.

Warm regards,
Stefan

On 28.07.2011, at 11:52, Carsten Dominik wrote:

> 
> On Jul 28, 2011, at 11:25 AM, Bastien wrote:
> 
>> Hi Carsten,
>> 
>> Carsten Dominik  writes:
>> 
>>> I have not looked at you patch.  But the orgx files are produced for
>>> index and sitemap (I think) purposes.  If a site has many files and the
>>> index get recreated after republishing a single changed file, the orgx
>>> files would be needed.
>> 
>> Of course, you're right.
>> 
>> Org now stores .orgx files as dotted files: .file.orgx to hide them in
>> the current directory.
>> 
>> Also, I've committed a change so that theindex.org is produced directly
>> instead of producing theindex.inc and including it in theindex.org.  It
>> feels more simple and this way theindex.org always get republished when
>> needed.
> 
> Yes.  I think the include mechanism was so that people could write
> their own wrapper file in their own style around the index.
> I am CCing Stefan who was the driving force behind the index development,
> he might have a comment.
> 
> - Carsten
> 

-- 
Dr. Stefan Vollmar, Dipl.-Phys.
Head of IT group
Max-Planck-Institut für neurologische Forschung
Gleuelerstr. 50, 50931 Köln, Germany
Tel.: +49-221-4726-213  FAX +49-221-4726-298
Tel.: +49-221-478-5713  Mobile: 0160-93874279
E-Mail: voll...@nf.mpg.de   http://www.nf.mpg.de









smime.p7s
Description: S/MIME cryptographic signature


Re: [O] wolfram's computable document format

2011-07-28 Thread John Hendy
On Thu, Jul 21, 2011 at 11:42 PM, Scott Randby  wrote:
> On 07/21/2011 05:41 PM, David O'Toole wrote:
>> http://www.wolfram.com/cdf/
>>
>> Looks nice, and could be very interesting to orgmoders.
>>
>>
>
> Mathematica is required to make a CDF document and the required reader
> is at least 100 MB in size. I think Sage is a superior alternative.
>

I'm all for this... but can Sage do what CDF is doing? Or publish to CDF?

In other words, is Sage really an "alternative" in this instance if
it's not actually providing the same feature set?


John

> Scott Randby
>
>



Re: [O] stop rebuilding of agenda upon secondary filtering? (7.6 behavior)

2011-07-28 Thread Memnon Anon
Michael Gilbert  writes:

> Upon upgrading to 7.6, I am noticing that my agenda now rebuilds as I
> move between various secondary filters. This is a substantial slowdown
> to my regular workflow. Is there a setting I could use to adjust this
> behavior? Other advice?

see:
Message-ID: <87fwlqxw6u@gnu.org>

Memnon




Re: [O] cleaning all the #+results from an org document

2011-07-28 Thread Ista Zahn
On Thu, Jul 28, 2011 at 8:59 AM, Stephen Eglen
 wrote:
> Thanks Torsten, you've expressed it elegantly!
>>
>> a) send it to someone without the results (to let him create his own)
>> b) archive them without having possible huge amount of lines of
>> results which can be reproduced any time by executing the block again.
>> c) to delete all the old results and start "fresh"

+1 for c. I often work with R objects that are simply too large to
store in org tables, so I use babel caching + session + write / load R
data files from disk. This works, but it becomes easy to get to an
inconsistent state, and I would like to be able to delete the results
blocks and run the whole thing fresh.

Best,
Ista

>
> I was mostly thinking about b (for putting into version control) and c,
> for giving to students to try out.
>
> Stephen
>
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org



Re: [O] bulk relative time shift (in org file)?

2011-07-28 Thread Memnon Anon
Michael C Gilbert  writes:

> Ideally, something like this should be available in the org file,
> rather than in the agenda. [...]
>
> But if I shift back and forth to the agenda, then I can make this
> work. I'm assuming that the 'Cc C-s' and 'C-c C-d' commands don't work
> on regions or on everything under a heading?

It may be feasible to make scheduling and deadlining act on region;
lets wait what Bastien thinks when he is back from well
deserved vacation.

I have been experimenting to get this done with a simple function
one could bind to e.g. `C-s M-s'. (Or one could defadvice
the proper functions (?), I have to read up on that ...)

In my first tests, it somewhat works, but the logbook
is updated only on the last item, not sure why that is, yet.

I will investigate later if no one jumps in and improves/replaces
this prototype:

--8<---cut here---start->8---
(defun my-org-schedule-shift ()
  (interactive)
  (let* ((acton (if (org-region-active-p) "region" 
  "tree"))
 (val (read-string (concat "shift "acton" by: "
(if (equal acton "region")
(org-map-region '(lambda () 
   (org-schedule nil val)) (region-beginning) 
(region-end))
  (org-map-tree '(lambda () 
   (org-schedule nil val))

(defun my-org-schedule-shift-region ()
  (interactive)
  (let ((val (read-string "Shift region by: ")))
   (org-map-region '(lambda () 
  (org-schedule nil val)) (region-beginning) (region-end

(defun my-org-schedule-shift-tree ()
  (interactive)
  (let ((val (read-string "Shift region by: ")))
   (org-map-tree '(lambda () 
  (org-schedule nil val)
--8<---cut here---end--->8---

Memnon




Re: [O] Remove orgx files

2011-07-28 Thread Bastien
Hi Carsten,

Carsten Dominik  writes:

> Yes.  I think the include mechanism was so that people could write
> their own wrapper file in their own style around the index.
> I am CCing Stefan who was the driving force behind the index development,
> he might have a comment.

I don't see Stefan in CC: -- maybe you added him in BCC?

In any case, I let Stefan DTRT here.

Thanks,

-- 
 Bastien



Re: [O] Bug: Tag set in agenda need a refresh to be used in a filter [7.4]

2011-07-28 Thread Bastien
Hi Matt,

Matt Lundin  writes:

> I would suggest that this *is* the expected behavior. The cost of
> refreshing the agenda is relatively expensive - it should not be done
> on each filter.

I see.  I have reverted this change.

Still, Nicolas' request makes sense, I would like to find a solution,
but I won't be able to find one before I'm back from holidays.

Thanks,

-- 
 Bastien



Re: [O] Bug: Tag set in agenda need a refresh to be used in a filter [7.4]

2011-07-28 Thread Matt Lundin
Hi Bastien,

Bastien  writes:

> Nicolas Dudebout  writes:
>
>> When filtering with a tag that was just added, the result is not as
>> expected.
>>
>> * Steps *
>> 1 - Go in the agenda view.
>> 2 - Attach a tag  to an entry .
>> 3 - Filter using tag .
>> (4 - Refresh the view)
>>
>> * Expected behavior *
>> by doing steps 1-3, entry  should appear in the filtered output.
>>
>> * Actual behavior*
>> step 4 is needed to have entry  appear.

I would suggest that this *is* the expected behavior. The cost of
refreshing the agenda is relatively expensive - it should not be done on
each filter. 

If we do want to update the agenda after a tag change, then perhaps we
could update the text properties for the line

> This is now fixed in git repo, thanks!

This has the undesirable consequence of slowing down filtering by
triggering an agenda request.

Best,
Matt




[O] stop rebuilding of agenda upon secondary filtering? (7.6 behavior)

2011-07-28 Thread Michael Gilbert
Hi —

Upon upgrading to 7.6, I am noticing that my agenda now rebuilds as I move 
between various secondary filters. This is a substantial slowdown to my regular 
workflow. Is there a setting I could use to adjust this behavior? Other advice?

TIA

— Michael




Re: [O] Release 7.7

2011-07-28 Thread Michael C Gilbert
On Jul 28, 2011, at 3:47 AM, Bastien wrote:

> Allow relative time when scheduling/adding a deadline 
> ==
> 
> You can now use relative duration strings like "-2d" or "++3w"
> when calling =org-schedule= or =org-deadline=: it will schedule
> (or set the deadline for) the item respectively two days before
> today and three weeks after the current timestamp, if any.
> 
> You can use this programmatically: =(org-schedule nil "+2d")=
> will work on the current entry.
> 
> You can also use this while (bulk-)rescheduling and
> (bulk-)resetting the deadline of (several) items from the agenda.
> 
> Thanks to Memnon Anon for a heads up about this!

Thank you to both Memnon and Bastien. This feature alone has already made a 
difference to me and my colleagues.

Orgmode and its contributors continue to astound me.

— Michael

Nonprofit News
http://nonprofitnews.org





Re: [O] Attachments and refiling

2011-07-28 Thread Nick Dokos
suvayu ali  wrote:

> On Thu, Jul 28, 2011 at 3:46 PM, Nick Dokos  wrote:
> > suvayu ali  wrote:
> >
> >> Hi Bastien,
> >>
> >> On Thu, Jul 28, 2011 at 9:51 AM, Bastien  wrote:
> >> > I suggest fixing problem (3) by making `org-attach-dir' defaulting to
> >> > "~/.org-attachments/".
> >>
> >> Since most of us like to put our org files under version control,
> >> maybe setting it to
> >>
> >> (concat org-directory "/.org-attachments/")
> >>
> >> would be a better default?
> >>
> >
> > Why is it better?
> >
> 
> Then the attachments can also be version controlled. If it is under
> ~/.org-attachments/, then it is outside the directory tree.
> 

D'oh! thanks.

Nick



Re: [O] getorg.sh script

2011-07-28 Thread Bernt Hansen
Jude DaShiell  writes:

> These days I use this when an org-mode update fails and I have to erase 
> the whole org-mode directory tree and clone org-mode again.  
> Cut here.
>
> #!/bin/bash
> #file getorg.sh - run git to update local org repository.
> if [ -r ~/org-mode  ]; then
> echo "updating emacs-org-mode"
> cd org-mode
> git pull
> make all
> sudo make install
> sudo make install-info
> exit 0
> fi
> echo "getting new clone of emacs-org-mode"
> mkdir org-mode
> cd ~/org-mode
> git clone git://orgmode.org/org-mode.git
> make all
> sudo make install
> sudo make install-info
>
> cut here.
> I learned some additional bash shell technique as a result of having 
> written this script so am happy to have done it and gained the experience.

Hi Jude,

In what situations does org-mode update fail?  I've never had to reclone
the org-mode repository - ever.  If git update fails, just do it again.
Recloning means you need to download all of the objects for org-mode
again which should never be necessary.

If you've messed up your local master branch somehow and want to revert
back to the official 'master' branch then just

$ git checkout master
$ git reset --hard origin/master

which throws away any local commits and uncommitted changes in your
working directory.

I fail to understand why you would ever need this script.  Can you
please elaborate?

Thanks,
Bernt



Re: [O] Attachments and refiling

2011-07-28 Thread suvayu ali
On Thu, Jul 28, 2011 at 3:46 PM, Nick Dokos  wrote:
> suvayu ali  wrote:
>
>> Hi Bastien,
>>
>> On Thu, Jul 28, 2011 at 9:51 AM, Bastien  wrote:
>> > I suggest fixing problem (3) by making `org-attach-dir' defaulting to
>> > "~/.org-attachments/".
>>
>> Since most of us like to put our org files under version control,
>> maybe setting it to
>>
>> (concat org-directory "/.org-attachments/")
>>
>> would be a better default?
>>
>
> Why is it better?
>

Then the attachments can also be version controlled. If it is under
~/.org-attachments/, then it is outside the directory tree.

> Nick
>


-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Attachments and refiling

2011-07-28 Thread Nick Dokos
suvayu ali  wrote:

> Hi Bastien,
> 
> On Thu, Jul 28, 2011 at 9:51 AM, Bastien  wrote:
> > I suggest fixing problem (3) by making `org-attach-dir' defaulting to
> > "~/.org-attachments/".
> 
> Since most of us like to put our org files under version control,
> maybe setting it to
> 
> (concat org-directory "/.org-attachments/")
> 
> would be a better default?
> 

Why is it better?

Nick




Re: [O] Pattch to org.texi: Document ":eval no"

2011-07-28 Thread Sebastien Vauban
Hi Stephen,

Stephen Eglen wrote:
> Small patch attached, thanks Seb for pointing this out.
>
> Stephen
>
> diff --git a/doc/org.texi b/doc/org.texi
> index 3ecf897..eb45885 100644
> --- a/doc/org.texi
> +++ b/doc/org.texi
> @@ -12990,10 +12990,10 @@ permissions of the tangled file are set to make it 
> executable.
>  @subsubsection @code{:eval}
>  The @code{:eval} header argument can be used to limit the evaluation of
>  specific code blocks.  @code{:eval} accepts two arguments ``never'' and
> -``query''.  @code{:eval never} will ensure that a code block is never
> -evaluated, this can be useful for protecting against the evaluation of
> -dangerous code blocks.  @code{:eval query} will require a query for every
> -execution of a code block regardless of the value of the
> +``query''.  @code{:eval never} (or @code{:eval no}) will ensure that a code
> +block is never evaluated, this can be useful for protecting against the
> +evaluation of dangerous code blocks.  @code{:eval query} will require a query
> +for every execution of a code block regardless of the value of the
>  @code{org-confirm-babel-evaluate} variable.
>  
>  If this header argument is not set then evaluation is determined by the value

While this -- really! -- is an excellent initiative (to update the doc when
you notice something's missing).

Note that, would have better read my notes, instead of counting on my memory,
I would have told you ":eval never". Though, I just checked, and confirm that
":eval no" is (for the moment) equivalent to it: see ob.el, lines 218 and 226.

So, this patch makes sense -- except if Eric wants to let this option
disappear, and only supports it in the code for backward compatibility.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] cleaning all the #+results from an org document

2011-07-28 Thread Stephen Eglen
Thanks Torsten, you've expressed it elegantly!
> 
> a) send it to someone without the results (to let him create his own)
> b) archive them without having possible huge amount of lines of
> results which can be reproduced any time by executing the block again.
> c) to delete all the old results and start "fresh"

I was mostly thinking about b (for putting into version control) and c,
for giving to students to try out.  

Stephen



Re: [O] Emacs and tablet devices

2011-07-28 Thread Jason F. McBrayer

On Thu, 28 Jul 2011 13:59:18 +0200, Piter_ wrote:


It may be not the best place to ask, but:
How useful is emacs on tablet devices. I have been thinking about
emacs and freerunner. But I have no clue how the keybindings work
with it.
So my second guess is nanonote which has a keyboard (but i would
prefer freerunner as it has less moving parts).
Any experiense or tips.


I don't have any experience with either of those devices, but I do
have a little emacs-on-tablet experience.

I have run Emacs in an SSH session from Android, using the ConnectBot
ssh client, and the Hacker's Keyboard input method. I'd say the user
experience is adequate but not ideal -- it depends on sticky modifier
keys rather than the usual chording. I believe that if you ran (e.g.)
a Debian chroot alongside Android, you could run a local emacs in a
local terminal or under Xvnc.

In my opinion, this will work, but it doesn't really leverage any
tablet-specific features.

Another possible device you might consider is the N850/900/950
series. I'm fairly certain there is a native emacs build for those
that requires no special jiggery-pokery.

--
+---+
| Jason F. McBrayer jmcb...@carcosa.net |
| If someone conquers a thousand times a thousand others in |
| battle, and someone else conquers himself, the latter one |
| is the greatest of all conquerors. --- The Dhammapada |




Re: [O] cleaning all the #+results from an org document

2011-07-28 Thread Torsten Wagner

Hi,

but there is one interesting aspect missing. If I want to evaluate the 
blocks and see the results but e.g.


a) send it to someone without the results (to let him create his own)
b) archive them without having possible huge amount of lines of results 
which can be reproduced any time by executing the block again.

c) to delete all the old results and start "fresh"

A function to remove all results might become handy.
Sometimes I find it quite difficult to see if a source-code block 
execute at all and if the results are "up-to-date" or still rather old 
results. Sure there is the message in the mini-buffer but its quickly 
overlooked or removed by a key-press.


Actually, I would prefer that "old" results are deleted at the very 
first step, then the source code block should be executed and finally 
results are printed again. Its simply to dangerous to overlook that some 
results might not be updated after all because something might went 
silently wrong within the execution.


Another idea would be to add a timestamp making the last time of 
successful execution clear, which might be nice for many different other 
reasons.


#+results: [2011-07-28 Thu 21:15] ;; huh, no seconds in org-mode ?!

Greetings

Totti


On 07/28/2011 05:31 PM, Stephen Eglen wrote:

Is there an easy way to delete all the #+results: blocks that have been
generated as the result of running org mode blocks?  e.g. If I have the
following chunk:

#+begin_src R
round(runif(n=5, min=0, max=1), 3)
#+end_src

#+results:
| 0.435 |
| 0.884 |
| 0.219 |
| 0.748 |
| 0.532 |

I'd like the results table to be deleted, but not the code chunk.

Stephen






[O] Pattch to org.texi: Document ":eval no"

2011-07-28 Thread Stephen Eglen
Small patch attached, thanks Seb for pointing this out.

Stephen

diff --git a/doc/org.texi b/doc/org.texi
index 3ecf897..eb45885 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -12990,10 +12990,10 @@ permissions of the tangled file are set to make it 
executable.
 @subsubsection @code{:eval}
 The @code{:eval} header argument can be used to limit the evaluation of
 specific code blocks.  @code{:eval} accepts two arguments ``never'' and
-``query''.  @code{:eval never} will ensure that a code block is never
-evaluated, this can be useful for protecting against the evaluation of
-dangerous code blocks.  @code{:eval query} will require a query for every
-execution of a code block regardless of the value of the
+``query''.  @code{:eval never} (or @code{:eval no}) will ensure that a code
+block is never evaluated, this can be useful for protecting against the
+evaluation of dangerous code blocks.  @code{:eval query} will require a query
+for every execution of a code block regardless of the value of the
 @code{org-confirm-babel-evaluate} variable.
 
 If this header argument is not set then evaluation is determined by the value



[O] Emacs and tablet devices

2011-07-28 Thread Piter_
Hi all.
It may be not the best place to ask, but:
How useful is emacs on tablet devices. I have been thinking about
emacs and freerunner. But I have no clue how the keybindings work
with it.
So my second guess is nanonote which has a keyboard (but i would
prefer freerunner as it has less moving parts).
Any experiense or tips.
Thanks.
Petro.



Re: [O] cleaning all the #+results from an org document

2011-07-28 Thread suvayu ali
Hi Stephen,

On Thu, Jul 28, 2011 at 1:41 PM, Stephen Eglen
 wrote:
>>
>> If you don't want the results to be produced at all, you can always use
>> the babel header option[1] :results silent.
>
> Thanks Suvayu, I'm gradually learning about all the various ways output
> can be exported vs shown in the org buffer.  Am I right in understanding
> that :results silent just affects whether or not output is written into
> the .org buffer, not whether it is exported or not (e.g. into html?)
>

Since I don't know what you are trying to achieve, I'll take a guess.

You wish babel to evaluate the source block and export the results. If
so, then I am afraid the results will be present in the buffer. If
however you only want the source block for fontification and don't
want it to be evaluated, you could try my solution or even better
would be what Seb suggested. However if you wish babel to evaluate the
block but suppress the results, then you should use my suggestion.

The export preferences can be controlled by :exports header. These are
all documented in detail in the manual (referenced in my earlier
email).

> Stephen

Hope this helps.

-- 
Suvayu

Open source is the future. It sets us free.



[O] column view summary format

2011-07-28 Thread Michael Brand
Hi all

I have an issue with the column summary format in this minimal
example:

#+begin_src org
  ,#+COLUMNS: %15ITEM %amount(amt){+; %5.1f}
  ,* section
  ,** subsection 1
  ,   :PROPERTIES:
  ,   :amount:   7.12
  ,   :END:
  ,** subsection 2
  ,   :PROPERTIES:
  ,   :amount:   98.34
  ,   :END:
#+end_src

For the column view I would like to get an overlay looking like:

#+begin_src org
  ,ITEM| amt   |
  ,* section   | 105.5 |
  ,** subsection 1 |   7.1 |
  ,** subsection 2 |  98.3 |
#+end_src

but what happens is:

#+begin_src org
  ,ITEM| amt|
  ,* section   |  105.5 |
  ,** subsection 1 | 7.12   |
  ,** subsection 2 | 98.34  |
#+end_src

Is this a bug or how can I get each number formatted and aligned?

Michael



Re: [O] cleaning all the #+results from an org document

2011-07-28 Thread Sebastien Vauban
Hi Suvayu and Stephen,

suvayu ali wrote:
>> #+begin_src R
>> round(runif(n=5, min=0, max=1), 3)
>> #+end_src
>>
>> #+results:
>> | 0.435 |
>> | 0.884 |
>> | 0.219 |
>> | 0.748 |
>> | 0.532 |
>>
>> I'd like the results table to be deleted, but not the code chunk.
>
> If you don't want the results to be produced at all, you can always use
> the babel header option[1] :results silent.

Even slightly better: don't evaluate the code chunk at all, with option
":eval no".

Best regards,
  Seb

-- 
Sebastien Vauban




[O] column view sum scope

2011-07-28 Thread Michael Brand
Hi all, hi Carsten

I have an issue with the column view sum scope that can be shown best
with a minimal word count example:

#+begin_src org
  ,#+COLUMNS: %14ITEM %18word_count(sum of word counts){+}
  ,- dynamic block for column view:
  ,  #+BEGIN: columnview
  ,  #+END:
  ,* article
  ,** section
  ,   :PROPERTIES:
  ,   :word_count: 2
  ,   :END:
  ,   First_word, second_word.
  ,*** subsection
  ,:PROPERTIES:
  ,:word_count: 1
  ,:END:
  ,Third_word.
#+end_src

After "C-c C-c" on "#+BEGIN:" I would like both ":word_count:" to be
left unchanged, leading to a section sum and article sum of 3:

#+begin_src org
  ,#+COLUMNS: %14ITEM %18word_count(sum of word counts){+}
  ,- dynamic block for column view:
  ,  #+BEGIN: columnview
  ,  | ITEM   | sum of word counts |
  ,  |+|
  ,  | * article  |  3 |
  ,  | ** section |  3 |
  ,  | *** subsection |  1 |
  ,  #+END:
  ,* article
  ,** section
  ,   :PROPERTIES:
  ,   :word_count: 2
  ,   :END:
  ,   First_word, second_word.
  ,*** subsection
  ,:PROPERTIES:
  ,:word_count: 1
  ,:END:
  ,Third_word.
#+end_src

but what one gets is the first ":word_count:" interpreted as only the
total of all _subsections_, leading to a section sum and article sum
of 1:

#+begin_src org
  ,#+COLUMNS: %14ITEM %18word_count(sum of word counts){+}
  ,- dynamic block for column view:
  ,  #+BEGIN: columnview
  ,  | ITEM   | sum of word counts |
  ,  |+|
  ,  | * article  |  1 |
  ,  | ** section |  1 |
  ,  | *** subsection |  1 |
  ,  #+END:
  ,* article
  ,** section
  ,   :PROPERTIES:
  ,   :word_count: 1
  ,   :END:
  ,   First_word, second_word.
  ,*** subsection
  ,:PROPERTIES:
  ,:word_count: 1
  ,:END:
  ,Third_word.
#+end_src

As I understand, org-wc.el from the word count thread
http://thread.gmane.org/gmane.emacs.orgmode/41146/focus=42663
suffers from the same problem.

The terms curval, curtotal and prevtotal found here
http://thread.gmane.org/gmane.emacs.orgmode/12067
look like what one needs here. But I couldn't find neither these terms
in any org/lisp/*.el nor any related commit around the time of the
post above. Carsten, do you remember this?

Now I would be glad to hear any thoughts and hints.

Michael



Re: [O] cleaning all the #+results from an org document

2011-07-28 Thread Stephen Eglen
> 
> If you don't want the results to be produced at all, you can always use
> the babel header option[1] :results silent.

Thanks Suvayu, I'm gradually learning about all the various ways output
can be exported vs shown in the org buffer.  Am I right in understanding
that :results silent just affects whether or not output is written into
the .org buffer, not whether it is exported or not (e.g. into html?)

Stephen



[O] updating drift.org on Worg

2011-07-28 Thread Stephen Eglen
I've had an attempt at updating drift.org on Worg (currently in
Worg/FIXME) so that it compiles in today's org mode.  Can some kind soul
check if this patch works?  I've put brief comments at the end as to
what I've changed, and note also for some reason the strange rendering 
of 

  p[1] <- X1/N

in the .tex file as:

p\footnotemark[1] <- X1/N

Is that a bug?

(I've also just emailed Matt for write access to Worg.)

Thanks, Stephen

diff --git a/FIXME/drift.org b/FIXME/drift.org
index 7d4b921..88fbf3e 100644
--- a/FIXME/drift.org
+++ b/FIXME/drift.org
@@ -1,4 +1,5 @@
 #+title: Genetic drift
+#+author: Dan Davison
 #+seq_todo: TODO | DONE
 #+property: cache no
 
@@ -9,15 +10,13 @@
   are two genetic types: red and blue[fn:1]. Here is the initial
   generation of the population (N=10).
 
-#+begin_src ditaa :file drift-1-gen.png :cmdline -r :exports both
+#+begin_src ditaa :file drift-1-gen.png :cmdline -r :exports results
   /+ /+ /+ /+ /+ /+ /+ /+ 
/+ /+
   Generation 1|cRED| |cBLU| |cBLU| |cBLU| |cRED| |cRED| |cBLU| |cRED| 
|cRED| |cRED|
   || || || || || || || || |
| ||
   +/ +/ +/ +/ +/ +/ +/ +/ 
+/ +/  
 #+end_src
 
-#+results:
-[[file:../../../images/babel/drift-1-gen.png]]
   There is no mutation, no selection and no sex; the next generation
   is made up by randomly choosing 10 individuals from the previous
   generation[fn:2]. A single individual can be chosen more than once,
@@ -29,7 +28,7 @@
 
   So the first two generations might look like this.
 
-#+begin_src ditaa :file drift-2-gen.png :cmdline -r :exports both
+#+begin_src ditaa :file drift-2-gen.png :cmdline -r :exports results
   /+ /+ /+ /+ /+ /+ /+ /+ 
/+ /+
   Generation 1|cRED| |cBLU| |cBLU| |cBLU| |cRED| |cRED| |cBLU| |cRED| 
|cRED| |cRED|  
   || || || || || || || || |
| ||
@@ -40,10 +39,6 @@
   +/ +/ +/ +/ +/ +/ +/ +/ 
+/ +/ 
 #+end_src
 
-#+results:
-[[file:../../../images/babel/drift-2-gen.png]]
-
-
   This is a form of evolution called "genetic drift". It is inevitable,
   although if the population is very large it will have less effect.
 
@@ -55,22 +50,19 @@
   success probability 0.6. In general, the random process is described
   by the following transition probabilities.
 
-#+begin_src latex :file transprob.png
+#+begin_src latex :file transprob.png :exports results
   \begin{equation}
   \Pr(X_t=j|X_{t-1}=i) = 
\frac{j(j-1)}{2}\Big(\frac{i}{N}\Big)^j\Big(\frac{N-i}{N}\Big)^{n-j}
   \end{equation}
 #+end_src
 
-#+results:
-[[file:../../../images/babel/transprob.png]]
-
   We can simulate the evolution over many generations in R. This code
   simulates the change in frequency in a single population over 100
   generations. We'll make the population larger (N=1000) but still
   start off with 60% red individuals.
 
 #+source: simpledrift(N=1000, X1=600, ngens=100)
-#+begin_src R :file simpledrift.png :exports code
+#+begin_src R :file simpledrift.png :exports both :results graphics
   p <- numeric(ngens)
   p[1] <- X1/N
   for(g in 2:ngens)
@@ -78,9 +70,6 @@
   plot(p, type="l", ylim=c(0,1), xlab="Generation", ylab="Proportion red")
 #+end_src
 
-#+results[03beb832ebe2136388baae04b9f9e699af5d0426]: simpledrift
-[[file:../../../images/babel/simpledrift.png]]
-
   But how variable is this process? To answer this we need to repeat
   the simulation many times (i.e. simulate many identical but
   independent populations). We could do that as follows
@@ -115,40 +104,32 @@
   To run the simulation:
 
 #+source: drift(N=1000, X1=600, nreps=10, ngens=100)
-#+begin_src R :session t :file repdrift.png :exports code
+#+begin_src R :session t :file repdrift.png :exports both :results graphics
   p <- drift.faster(N, X1, ngens, nreps)
   matplot(p, type="l", ylim=c(0,1), lty=1)
 #+end_src
 
-#+results[685ae7b4150a9413db180d2917384052ec288ab5]: drift
-[[file:../../../images/babel/repdrift.png]]
   And let's quickly see how much of a speed difference the vectorisation
   makes.
 
 #+source: compare-times(N=1000, X1=600, nreps=1000, ngens=100)
-#+begin_src R :session t :colnames t :results output
+#+begin_src R :session t :colnames t :results output :exports both
   functions <- c(drift.slow=drift.slow, drift.faster=drift.faster)
   times <- sapply(functions, function(f) as.numeric(system.time(f(N, X1, 
ngens, nreps))[1]))
   print(times)
   cat(sprintf("\nFactor speed-up = %.1f\n", times[1] / times[2]))
 #+end_src
 
-#+results[ba4b29e0bf6cc6da506361b76253285f7eab31a9]: compare-times
-  :   drift.slow drift.faster 
-  :6.0640.204
-  : 
-  : Factor speed-up = 29.7
-
 * Footnotes
 
-  [fn:1] Every individual is chacterised by a single type; no sex,
-  recombination, mutation, sele

Re: [O] Release 7.7

2011-07-28 Thread suvayu ali
On Thu, Jul 28, 2011 at 12:47 PM, Bastien  wrote:
> Dear all,
>
> I'm releasing Org 7.7.
>

Wow! That was a fast bump from 7.6. Congratulations again to you and
everyone else. :)

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] How-to evaluate Java-snippets in org-mode/org-babel?

2011-07-28 Thread Torsten Wagner

Hi Eric,

some feedback of first testing weeks
It works well on my desktop machine, I tried to do the same on my 
laptop. However, I faced the problem that java did not find the files.
I tried everything. Made sure using the same java and emacs version 
(same linux distro, same test file). Copied over .emacs config files, 
compared the versions of ob-java.el on both machines. I couldn't figure 
out why it works with one and does not work on the other machine.
Somehow the classpath seems to differ buy I do not see where to change 
it in the correct way.


I hacked a bit into ob-java.el file. I noticed that you call the 
generated class file by creating the string


java packagename/classname

whereas packagename/classname is coming from the classname variable set 
at the source-code block.


In the earlier attempt we used

java -cp . packagename.classname

which makes sure the classpath is set to the local directory.

I hacked this into your code and now it works on the laptop too (to say 
this modification works on both desktop and laptop). It might be worse 
to add, since the classpath seems to be set depending on many parameters 
(distro, other java ides, local user settings, etc.). Thus, many might 
observe problems at this point.


Please find a patch attached.

Even better would be to add an option to set the classpath but my elisp 
skills are to poor for that but would like to see how to do it ;)

#+BABEL: :classpath "."
where it might be the local directory by default?!

Beside of that I noticed that there might be a need for a plain-text 
mode.. sounds funny, but maybe sometimes someone need auxiliary files 
which are not executed by themselves. Sure I could use simply a shell 
session and echo into a file, or tangle it,  but I guess it might be 
more elegant to have a, "only-paste-this-into-this-file-execute"


#+BEGIN_SRC: plain :filename folder/folder/testdata.csv
1, 2
2, 4
3, 8
#+END_SRC
to generate /folder/folder/testdata.csv which contains the data in the 
block.


Because sometimes, one might need to call external programs or programs 
in code-blocks are supposed to read data from files instead from within 
org-babel.


In general this could be the standard feature for all unrecognised 
languages. Probably with a warning that the required 
compiler/interpreter is not configured. However, this would allow people 
at least to get the source files which they could use externally. The 
difference to tangle would be that one can decide block by block what to 
execute. E.g., I could have several of the above "testdata" blocks and 
simply executing one of them would change the input for later code blocks.


Totti



>From 9853070846e98c2a14452e51c8756611aa145363 Mon Sep 17 00:00:00 2001
From: Torsten 
Date: Thu, 28 Jul 2011 19:27:08 +0900
Subject: [PATCH] resolve problems with wrong classpath

---
 lisp/ob-java.el |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-java.el b/lisp/ob-java.el
index 8595a18..cee797a 100644
--- a/lisp/ob-java.el
+++ b/lisp/ob-java.el
@@ -50,7 +50,7 @@
 	 (compile
 	  (progn (with-temp-file src-file (insert full-body))
 		 (org-babel-eval
-		  (concat org-babel-java-compiler " " src-file) ""
+		  (concat org-babel-java-compiler " -cp . " src-file) ""
 ;; created package-name directories if missing
 (unless (or (not packagename) (file-exists-p packagename))
   (make-directory packagename 'parents))
@@ -65,7 +65,7 @@
 	 (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
 	(org-babel-pick-name
 	 (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)
- (org-babel-eval (concat org-babel-java-command " " classname) ""
+ (org-babel-eval (concat org-babel-java-command " -cp . " classname) ""
 
 (provide 'ob-java)
 
-- 
1.7.6



[O] Release 7.7

2011-07-28 Thread Bastien
Dear all,

I'm releasing Org 7.7.

  http://orgmode.org/org-7.7.tar.gz
  http://orgmode.org/org-7.7.zip

Below is the list of changes, also accessible on the website:

  http://orgmode.org/Changes.html#sec-1

Thanks to all of you for the discussions, feedback and patches.
Special thanks to Nicolas Goaziou and Eric S. Schulte for their
dedication on lists and Babel.

It's been exactly 200 commits in 22 days since Org 7.6... time
for holidays!  I will be off until August 10th, with no access
to emails.

Don't hesitate to buy me a drink or a new swimming suit by 
clicking on the "Donate!" button:

  http://orgmode.org/

Enjoy,


New features and user-visible improvements 
---

New command =org-copy-visible= (=C-c C-x v=) 
=

This command will copy the visible text in the region into the
kill ring.

Thanks to Florian Beck for this function and to Carsten for
adding it to org.el and documenting it!

New hook =org-ctrl-c-ctrl-c-final-hook= 


This hook will be called when nothing special can be performed by
the busy =C-c C-c= key.  Thanks to Paul Sexton for this idea!


Allow relative time when scheduling/adding a deadline 
==

You can now use relative duration strings like "-2d" or "++3w"
when calling =org-schedule= or =org-deadline=: it will schedule
(or set the deadline for) the item respectively two days before
today and three weeks after the current timestamp, if any.

You can use this programmatically: =(org-schedule nil "+2d")=
will work on the current entry.

You can also use this while (bulk-)rescheduling and
(bulk-)resetting the deadline of (several) items from the agenda.

Thanks to Memnon Anon for a heads up about this!


New functions: =org-todo-yesterday= and =org-agenda-todo-yesterday= 


This is useful when you need to mark things done yesterday.

Thanks to Max Mikhanosha for this patch.


=org-set-property= defaults to the last interactively modified property 


When setting a property with =C-c C-x p=, it will offered the
last interactively modified property as a default choice.  If
this command is called on a property line, the property in this
line will take precedence over the last set property.


Clock: Allow synchronous update of timestamps in CLOCK log 
===

Using =S-M-= on CLOCK log timestamps will
increase/decrease the two timestamps on this line so that
duration will keep the same.  Note that duration can still be
slightly modified in case a timestamp needs some rounding.

Thanks to Rainer Stengele for this idea.


Clock: New function =org-clock-remove-empty-clock-drawer= 
==

This function removes empty =CLOCK= drawers and has been added to
=org-clock-out-hook=: when clocking out, if no CLOCK log has been
inserted and the drawer is empty, the drawer will be removed.


Capture: new escape sequence =%F= for templates 


Using =%F= in capture templates will insert the full path of the
file or the directory the capture mechanism was called from
(whereas =%f= only insert the filename.)

Thanks to Nicolas Goaziou for this change.


Agenda: new variable =org-agenda-bulk-custom-functions= for custom bulk 
functions 
==

When using =org-agenda-bulk-action= in agenda view, the user
could already call custom functions by pressing =f= and entering
the function's name.

This variable lets the user add custom choices and reach them
more quickly.  Set the variable to an alist of keys (chars) and
functions, and these keys will be accessible through the
=org-agenda-bulk-action= interface.

If there is a conflict between custom keys and hardcoded choices,
the latter ones take precedence.

Thanks to Julien Cubizolles for triggering this idea.


Refile: exclude irrelevant headings 


When refiling from an org-mode buffer, the current heading and
its subheadings will be excluded from the list of possible
targets.

This only works when =org-refile-use-cache= is =nil= and in
org-mode buffers, not in agenda buffers.

Thanks to Jason Dunsmore for this idea!

Lists: new variable =org-list-use-circular-motion= 
===

This variable allows some commands to consider lists as cyclic
structures.  For example, when non-nil, moving past the last item
of a list with S-down will bring you back to the first one.

Lists: New variable =org-list-indent-offset= 
=

This variable helps improving readability of sub-items by
increasing their indentation.  E.

Re: [O] Attachments and refiling

2011-07-28 Thread suvayu ali
Hi Bastien,

On Thu, Jul 28, 2011 at 9:51 AM, Bastien  wrote:
> I suggest fixing problem (3) by making `org-attach-dir' defaulting to
> "~/.org-attachments/".

Since most of us like to put our org files under version control,
maybe setting it to

(concat org-directory "/.org-attachments/")

would be a better default?

-- 
Suvayu

Open source is the future. It sets us free.



[O] getorg.sh script

2011-07-28 Thread Jude DaShiell
These days I use this when an org-mode update fails and I have to erase 
the whole org-mode directory tree and clone org-mode again.  
Cut here.

#!/bin/bash
#file getorg.sh - run git to update local org repository.
if [ -r ~/org-mode  ]; then
echo "updating emacs-org-mode"
cd org-mode
git pull
make all
sudo make install
sudo make install-info
exit 0
fi
echo "getting new clone of emacs-org-mode"
mkdir org-mode
cd ~/org-mode
git clone git://orgmode.org/org-mode.git
make all
sudo make install
sudo make install-info

cut here.
I learned some additional bash shell technique as a result of having 
written this script so am happy to have done it and gained the experience.





Re: [O] Remove orgx files

2011-07-28 Thread Carsten Dominik

On Jul 28, 2011, at 11:25 AM, Bastien wrote:

> Hi Carsten,
> 
> Carsten Dominik  writes:
> 
>> I have not looked at you patch.  But the orgx files are produced for
>> index and sitemap (I think) purposes.  If a site has many files and the
>> index get recreated after republishing a single changed file, the orgx
>> files would be needed.
> 
> Of course, you're right.
> 
> Org now stores .orgx files as dotted files: .file.orgx to hide them in
> the current directory.
> 
> Also, I've committed a change so that theindex.org is produced directly
> instead of producing theindex.inc and including it in theindex.org.  It
> feels more simple and this way theindex.org always get republished when
> needed.

Yes.  I think the include mechanism was so that people could write
their own wrapper file in their own style around the index.
I am CCing Stefan who was the driving force behind the index development,
he might have a comment.

- Carsten




Re: [O] Bug: Tag set in agenda need a refresh to be used in a filter [7.4]

2011-07-28 Thread Bastien
Hi Nicolas,

Nicolas Dudebout  writes:

> When filtering with a tag that was just added, the result is not as
> expected.
>
> * Steps *
> 1 - Go in the agenda view.
> 2 - Attach a tag  to an entry .
> 3 - Filter using tag .
> (4 - Refresh the view)
>
> * Expected behavior *
> by doing steps 1-3, entry  should appear in the filtered output.
>
> * Actual behavior*
> step 4 is needed to have entry  appear.

This is now fixed in git repo, thanks!

-- 
 Bastien



Re: [O] Agenda global list tweak

2011-07-28 Thread Bastien
Hi Ido,

Ido Magal  writes:

> So instead of 
>
> todo.txtmow lawn
> todo.txtclean mower
> todo.txtbuy fuel
>
> i'd see
>
> todo.txt  mow lawn
> mow lawn   clean mower
> mow lawn   buy fuel
>
> Is this easy to do?

Stupid trick: rename your CATEGORY to use the name of the current
entry.

Otherwise, no, that's not easy to do.

HTH,

-- 
 Bastien



Re: [O] [DEV] Org-Startup.el concept

2011-07-28 Thread Bastien
Hi Matthew,

Matthew Sauer  writes:

> Also, what will happen if I run the command to append the custom
> agenda views and none have been defined?

I think you will see by yourself :)

Let us know when you have some code ready that we can check, 
and good luck for writing it!

Best,

-- 
 Bastien



Re: [O] Remove orgx files

2011-07-28 Thread Bastien
Hi Carsten,

Carsten Dominik  writes:

> I have not looked at you patch.  But the orgx files are produced for
> index and sitemap (I think) purposes.  If a site has many files and the
> index get recreated after republishing a single changed file, the orgx
> files would be needed.

Of course, you're right.

Org now stores .orgx files as dotted files: .file.orgx to hide them in
the current directory.

Also, I've committed a change so that theindex.org is produced directly
instead of producing theindex.inc and including it in theindex.org.  It
feels more simple and this way theindex.org always get republished when
needed.

Best,

-- 
 Bastien



Re: [O] cleaning all the #+results from an org document

2011-07-28 Thread suvayu ali
Hi Stephen,

On Thu, Jul 28, 2011 at 10:31 AM, Stephen Eglen
 wrote:
> Is there an easy way to delete all the #+results: blocks that have been
> generated as the result of running org mode blocks?  e.g. If I have the
> following chunk:
>
> #+begin_src R
> round(runif(n=5, min=0, max=1), 3)
> #+end_src
>
> #+results:
> | 0.435 |
> | 0.884 |
> | 0.219 |
> | 0.748 |
> | 0.532 |
>
> I'd like the results table to be deleted, but not the code chunk.
>

If you don't want the results to be produced at all, you can always use
the babel header option[1] :results silent.

> Stephen
>
>

Footnotes:

[1] 


-- 
Suvayu

Open source is the future. It sets us free.

Message-ID: 
From: Suvayu Ali 



Re: [O] New feature: loop over siblings for some commands

2011-07-28 Thread Bastien
Hi David,

David Maus  writes:

> My vacation starts saturday so I do have time and really like to get
> my hands dirty with some Lisp hacking.

Great, thanks.

> Now for the macro (2 iterations later): It might not be necessary to
> factor out the functions if the function that invokes the looping
> can be called recursively.

I've applied the first two patches that I sent in my previous email,
thus removing the previous half-baked functionality.  

If you can have a look at the third patch and start from there, that
would be great -- this third patch has some problems (with C-u C-c C-s
for example) and was just a first attempt.

Thanks for any update on this!

Best,

-- 
 Bastien



Re: [O] [PATCH 2/2] Log yesterday item today, better org-extend-today-until

2011-07-28 Thread Bastien
Hi Max,

Max Mikhanosha  writes:

> There is already unfinished support for "backdating" stuff via
> org-extend-today-until variable, but it does not work in the log-note
> time-stamp. Following patch fixes that oversight, and adds two new
> commands: (org-done-yesterday) and (org-agenda-done-yesterday), which are
> exactly as their "today" counterparts, but all the timestamps and
> CLOSED line will be marked as of 23:59 yesterday.

I've now tested and applied this patch, thanks a lot for it.

I guess the warning in `org-extend-today-until' is a bit obsolete :)

Best,

-- 
 Bastien



[O] cleaning all the #+results from an org document

2011-07-28 Thread Stephen Eglen
Is there an easy way to delete all the #+results: blocks that have been
generated as the result of running org mode blocks?  e.g. If I have the
following chunk:

#+begin_src R 
round(runif(n=5, min=0, max=1), 3)
#+end_src

#+results:
| 0.435 |
| 0.884 |
| 0.219 |
| 0.748 |
| 0.532 |

I'd like the results table to be deleted, but not the code chunk.

Stephen



Re: [O] Trouble compiling

2011-07-28 Thread Avery Chan
That's unfortunate. I /am/ in China; sounds like the Great Firewall  
might be at work. Thanks for the input...


Avery


On Jul 28, 2011, at 4:02 AM, Marc-Oliver Ihm wrote:


On 27.07.2011 11:18, Avery Chan wrote:

To whom it may concern,

I am trying to load orgmode via the emacs-starter kit. Following the
instructions, I did the following:

508 cp -R emacs-starter-kit ~/.emacs.d
509 cd /Users/avery/.emacs.d
511 git submodule init
515 git submodule update

The update procedure failed with the following output:

Cloning into src/org...
error: Unable to get pack file
http://orgmode.org/org-mode.git/objects/pack/pack-beb4230c6615129746e9adfd39b5a38d78a4c191.pack

transfer closed with 49103369 bytes remaining to read
error: Unable to find db094c320412204a990668024f88eef00d307a44 under
http://orgmode.org/org-mode.git
Cannot obtain needed object db094c320412204a990668024f88eef00d307a44
error: Fetch failed.
Clone of 'http://orgmode.org/org-mode.git' into submodule path 'src/ 
org'

failed

Is there a way for me to fix this? I suspect that it is a  
configuration

issue since when I tried the URL I got a 403.

Thanks!

Avery



Hi !
Just try to download this with my browser, and it worked Okay for  
my. Maybe you hav become victim of a network glitch ? In which case  
a retry would help (if you not already have done this)

regards, Marc





Re: [O] New version which is compatible with emacs 24: New function to view your notes in chronological order

2011-07-28 Thread Bastien
Hi Marc-Oliver,

Marc-Oliver Ihm  writes:

> Thanx for testing again !

You're welcome.

> I will try to figure out, how to patch `org-sparse-tree'.

Thanks -- let us know how it goes, and take the time to grasp 
Org's internals...

> And I will add active timestamps. Which was a think, that I have
> thought of before, but postponed until someone would suggest/request
> this feature :-)

Yep.  It will make your `org-find-timestamps' function quite useful.
Please be aware that I will spend some time and trying to create a cache
for timestamps (see recent discussions about calfw), and that such a
cache could help a lot in making your solution easier to implement.

Best,

-- 
 Bastien



Re: [O] Fwd: Development workflow

2011-07-28 Thread Bastien
Marcelo de Moraes Serpa  writes:

> Thanks Jambunathan, that's really some good advice. You're right,
> sometimes we just postpone things because we think we should "get
> ready" for it. Profound and true.

Indeed: http://vimeo.com/26415958

-- 
 Bastien



Re: [O] making coloured tables

2011-07-28 Thread Bastien
Dear all,

I welcome discussions about features in this area, but please be
aware this is something I will not be hacking into in the next two
months.

So, if someone wants to take this in charge and to propose a design
and an implementation, please do!

Thanks,

-- 
 Bastien



Re: [O] Attachments and refiling

2011-07-28 Thread Bastien
Hi Darlan,

here is how I see the situation regarding attachments:

1. org-attach.el is nice because it makes it easy to attach a file to a
   task, while not *worrying* about where the file is on the harddrive.

2. Adding an ATTACH_DIR property will always add an absolute path, so
   there is no problem when moving an entry with an explicit ATTACH_DIR.

3. Refiling/archiving subtrees lose track of some attachments when the
   attach directory "data/" is *relative* to the org file (which is the
   default) and when the target org file is not in the same directory.

4. Moving an entry with an ATTACH_DIR_INHERIT will lose attachments 
   when the ATTACH_DIR of the target entry is different.

(3) and (4) are two distinct problems.

I suggest fixing problem (3) by making `org-attach-dir' defaulting to
"~/.org-attachments/".  I

I suggest fixing problem (4) by explicitely replacing ATTACH_DIR_INHERIT
with the corresponding ATTACH_DIR when the target subtree has a
different ATTACH_DIR.

The core idea is that I want to avoid moving files themselves: I think
it's a risky road, and I hope the solutions above will make this road
unnecessary.

I'm interested in feedback and ideas about such proposed changes.  

Thanks a lot!

-- 
 Bastien



Re: [O] Development workflow

2011-07-28 Thread Bastien
Hi Marcelo,

Jambunathan K  writes:

> You don't have to compile your elisp files at all and as a developer I
> would even venture to say you shouldn't.

I also recommend not compiling your .el files, you will have more
useful debug traces (setq edebug-on-error t).

I would suggest reading the documentation of Edebug in the Elisp info
file.  M-x edebug-defun RET on functions will let you go through the
functions' evaluation step by step and understand better what they do
right (and wrong).

Also, please use git branches and send patch with git format-patch.

If you have comments about the code while reading through, please 
share them freely -- a longstanding wish of mine is to organize a 
live code review with core Org hackers:

  
http://scientopia.org/blogs/goodmath/2011/07/06/things-everyone-should-do-code-review/

Good luck!

-- 
 Bastien



Re: [O] [PATCH] New org-depend trigger for finding next highest priority/effort item

2011-07-28 Thread Bastien
Hi Max,

Max Mikhanosha  writes:

> At Wed, 27 Jul 2011 13:33:16 +0200,
> Bastien wrote:
>> 
>> Also, it would be really nice to update this tutorial on Worg and to
>> show how to use the new feature you introduced:
>> 
>>   http://orgmode.org/worg/org-contrib/org-depend.html
>
> Done, will push once I have permissions

Great -- thanks.

The person to contact to get write access to Worg's repo is Matt Lundin,
but if you give me your username on repo.or.cz I can add you now.

Best,

-- 
 Bastien



Re: [O] making coloured tables

2011-07-28 Thread Daniel Clemente
El Wed, 27 Jul 2011 22:30:19 +0200 Sebastien Vauban va escriure:
> if they seem to make sense... So, here's my idea: having some automagic style
> (background) applied on the cells to distinguish:
> 
> - the input cells (the ones you cannot delete... without troubles): they don't
>   have any formula associated with them
> 
> - the final result cells: the ones with computed results
> 
> - the other ones, whose content is computed, but serves as input to other
>   cells.
> 

  This would be very useful. I see 3 types of cells (apart from headers, 
comment rows, etc.):
- cells not affected by formulae
- cells used in some formula calculation
- cells whose value was written by a formula (some of them may also be of the 
second type)