[Orgmode] Re: Possible bug in ordered tasks

2010-06-26 Thread Carsten Dominik


On Jun 25, 2010, at 8:55 PM, Bernt Hansen wrote:


Carsten Dominik carsten.domi...@gmail.com writes:


On Jun 25, 2010, at 3:23 PM, Robert Goldman wrote:


Question:  what is the proper way to get a NIL into a property?  Are
we
to use () instead of nil?  Or are property values always  
interpreted

as strings?

Apologies in advance if this is a stupid question!


Not a stupid question at all.

There is no way, currently.   Property values are string - the only
way to make
org-entry-get return nil is to not have the property defined at all.


I've wanted a similar thing in the past for the LOGGING property where
the parent task has special logging set via the LOGGING property but I
want to undo that for some of the child tasks so they use the default
logging setup.

Having a way to undefine a property would be good in general I think.


This does now work, the property value nil will now be interpreted as
explicit undefine of a property.

- Carsten


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: [ANN] Org-babel integrated into Org-mode

2010-06-26 Thread Štěpán Němec
Eric Schulte schulte.e...@gmail.com writes:

 Hi Rainer,

 First I'll give some expanded instructions in the hopes of helping out
 anyone else affected by my lack of good instructions in the announcement
 email.  Then I'll provide a re-write of your config below as an example.

 Babel took the integration into Org-mode as an opportunity to do some
 much needed house cleaning.  Most importantly we have cleared out
 unnecessary configuration variables -- which is great unless you already
 have these variables set.

 We have eliminated the two main internal lists of languages, namely
 - org-babel-interpreters and
 - org-babel-tangle-langs
 so any config lines which mention those variables, can/should be
 stripped out in their entirety.  This includes any calls to the
 `org-babl-add-interpreter' function, whose sole purpose was to add
 languages to the org-babel-interpreters variable.

 alright, so with those calls stripped out, we may still in some cases
 want to associate a file name extension with certain languages, for
 example we want all of our emacs-lisp files to end in a .el, we can do
 this will the `org-babel-tangle-lang-exts' variable.  In general you
 shouldn't need to touch this as it already has defaults for most common
 languages, and if a language is not present in org-babel-tangle-langs,
 then babel will just use the language name, so for example a file of c
 code will have a .c extension by default, sh code will have a .sh
 extension ect...

 You also mentioned shebang lines.  This configuration now lives in
 header arguments.  So the shebang for a single file can be set at the
 code block level, e.g.

 #+begin_src clojure :shebang #!/usr/bin/env clj
   (println with a shebang line, I can be run as a script!)
 #+end_src

 note that whenever a file is tangled which includes a shebang line,
 org-babel will make the file executable, so there is good reason to only
 add shebangs at the source-code level.  However if you're sure that you
 want all of your code in some language (say shell scripts) to tangle out
 with shebang lines, then you can customize the default header arguments
 for that language, e.g.

 ;; ensure this variable is defined defined
 (unless (boundp 'org-babel-default-header-args:sh)
   (setq org-babel-default-header-args:sh '()))

 ;; add a default shebang header argument
 (add-to-list 'org-babel-default-header-args:sh
  '(:shebang . #!/bin/bash))

 The final change, is that to conform to Emacs guidelines, the prefix
 org-babel-* in all require lines, has been changed to ob-*, also, since
 Babel now loads by default with Org-mode you can remove any
   (require 'org-babel)
 or 
   (require 'org-babel-init)
 that may by lying around your configuration.

 Whew! that was alot of writing for a /simplification/ of configuration.
 Hopefully the example of your configuration below will be a more
 succinct demonstration of the needed transformations.

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

 Hi

 First of all thanks for integrating Org-babel into Org-mode.

 But for the less fluent elisp and org-mode users, I am slightly confused in
 the changes necessary on my side.

 I have the following in my emacs.org file:


 #+begin_src emacs-lisp
   (require 'org-babel-R) ;; requires R and ess-mode
   ;; (require 'org-babel-ruby)  ;; requires ruby, irb, ruby-mode, and
 inf-ruby
   (require 'org-babel-python);; requires python, and python-mode
   ;; (require 'org-babel-clojure)   ;; requires clojure, clojure-mode,
 swank-clojure and slime
 #+end_src

 the above becomes

 #+begin_src emacs-lisp
   (require 'ob-R)
   ;; (require 'ob-ruby)
   (require 'ob-python)
   ;; (require 'ob-clojure)
 #+end_src

 
 *** Start babel
 #+begin_src emacs-lisp
   (org-babel-load-library-of-babel)
 #+end_src

 the above becomes

 #+begin_src emacs-lisp
   (org-babel-lob-ingest ~/path/to/org/contrib/babel/library-of-babel.org)
 #+end_src

 
 *** Customization of sh
 set shebang for sh script to #!/bin/bash and exclude additional comments
 (t)
 #+begin_src emacs-lisp
   (setq org-babel-tangle-langs
   (cons
   '(sh sh #!/bin/bash t)
 (remove-if (lambda (el) (string= (car el) sh)) org-babel-tangle-langs)))
 #+end_src

 #+begin_src emacs-lisp
   ;; ensure this variable is defined defined
   (unless (boundp 'org-babel-default-header-args:sh)
 (setq org-babel-default-header-args:sh '()))

   ;; add a default shebang header argument
   (add-to-list 'org-babel-default-header-args:sh
'(:shebang . #!/bin/bash))
 #+end_src

 
 *** Customization of R
   set shebang for R script to  and exclude additional comments (t)
 #+begin_src emacs-lisp
   (setq org-babel-tangle-langs
   (cons
   '(R R)
   (remove-if (lambda (el) (string= (car el) R)) org-babel-tangle-langs)))
 #+end_src


 the above can be omitted entirely

 If you've made it this far, then thanks for your patience, and please
 let me know if you run into any problems with the above.

 Best -- Eric

How come some of your 

[Orgmode] Bug: org.texi doesn't compile [6.36trans (release_6.36.415.gb2dcd)]

2010-06-26 Thread Tassilo Horn

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


The error is:

--8---cut here---start-8---
(cd doc; makeinfo --no-split org.texi -o org)
org.texi:5914: @kbd expected braces.
org.texi:5914: @kbd missing close brace.
makeinfo: Removing output file `org' due to errors; use --force to preserve.
make: *** [doc/org] Error 1
--8---cut here---end---8---

Here's a fix:

--8---cut here---start-8---
diff --git a/doc/org.texi b/doc/org.texi
index 0bf2f2b..f3e88b8 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -5911,7 +5911,7 @@ the documentation for org-remember at
 The new capturing setup described here is preferred and should be used by new
 users.  To convert your @code{org-remember-templates}, run the command
 @example
-...@kbd M-x org-capture-import-remember-templates RET
+...@kbd{m-x org-capture-import-remember-templates RET}
 @end example
 @noindent and then customize the new variable with @kbd{M-x
 customize-variable org-capture-templates}, check the result, and save the
--8---cut here---end---8---

Emacs  : GNU Emacs 24.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2010-06-24 on thinkpad
Package: Org-mode version 6.36trans (release_6.36.415.gb2dcd)

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: org-remember and anything

2010-06-26 Thread rubikitch
From: Glauber Alex Dias Prado sma...@gmail.com
Subject: Re: org-remember and anything
Date: Mon, 14 Jun 2010 10:38:09 -0300

 Oh sorry, here is complete instructions:
 (add-to-list 'load-path /home/glauber/elisp)
 (add-to-list 'load-path /home/glauber/elisp/org-mode)
 (add-to-list 'load-path /home/glauber/elisp/org-mode/lisp)
 (require 'org)
 (require 'init-org-mode) ;; which can be found here: 
 http://openpaste.org/22109/inline/
 (require 'anything-startup)
 (toggle-debug-on-error)
 
 call function org-remember trough binding f9-o-r
 when prompt for a template press t
 results in backtrace. I think im using latest version of all involved.
 
 Thierry Volpiatto thierry.volpia...@gmail.com writes:
 
  Hi, can you please provide more info on what you do exactly and how you
  use anything (which source, function etc...) with org.
  Which command give this backtrace?
 
  Glauber Alex Dias Prado sma...@gmail.com writes:
 
  Hi,
  when calling org-remember, after selecting the template org doesnt
  provide the right syntax to anything as it is configure for icomplete i
  think, dunno what is really involved here as it used to work( i tried it
  with both ido completion support on and off):
 
  Sorry if this is not really a org thing:
 
 
  Debugger entered--Lisp error: (error anything-interpret-value: Symbol 
  must be a function or a variable)

Sorry for late reply.
I just fixed the bug.

Cheers,
--
rubikitch

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Org-babel `:hlines yes` no longer working for python

2010-06-26 Thread Christopher Allan Webber
Hello all,

I was going through the tutorial and testing the :hlines yes feature as
described in the info manual.  Unfortunately, the example given no
longer seems to work for python:

#+tblname: many-cols
| a | b | c |
|---+---+---|
| d | e | f |
|---+---+---|
| g | h | i |

#+source: echo-table
#+begin_src python :var tab=many-cols :hlines yes
  return tab
#+end_src

#+results: echo-table
| a | b | c |
| d | e | f |
| g | h | i |

In the buffer *Org-Babel Error Output* I see:

Traceback (most recent call last):
  File stdin, line 6, in module
  File stdin, line 3, in main
NameError: global name 'hline' is not defined

In emacs-lisp this still seems to work though.  But I also see that in
emacs lisp hlines are represented by the hline symbol.  I'm guessing
that the python equivalent was trying to do the same thing, but no hline
variable exists in python?

Thanks!
 - cwebb

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: packaging org-mode worg

2010-06-26 Thread Ian Barton




I also like the idea of a debian package for Worg - this cannot hurt and
might advertize the project quite widely.



I'll create a ppa for Worg on Launchpad and see if I can create a useful 
package.


I think that in addition to just the org files, it would be useful if 
the package contained an html version, an info version and maybe a pdf. 
I am assuming that I can just use org's publish facilities to do this.


Ian.

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: packaging org-mode worg

2010-06-26 Thread Bastien
Hi Ian,

Ian Barton li...@manor-farm.org writes:

 I'll create a ppa for Worg on Launchpad and see if I can create a useful
 package.

Thanks a lot for this!

 I think that in addition to just the org files, it would be useful if
 the package contained an html version, an info version and maybe a
 pdf. I am assuming that I can just use org's publish facilities to do
 this.

Let me know if I can help you build this package.

-- 
 Bastien

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: [ANN] Org-babel integrated into Org-mode

2010-06-26 Thread Eric Schulte
Štěpán Němec step...@gmail.com writes:

[...]

 How come some of your rewrites above still use the `org-babel-' prefix?
 (As a side note, I don't see what Emacs guidelines suggest `ob-' is more
 appropriate than `org-babel-', and I would personally prefer to retain
 the latter -- it's much more descriptive.)

 Štěpán


Hi Štěpán,

The guidelines I mentioned (I believe) specify that all file names for
emacs-lisp files which are part of Emacs must be unique in the first 6
or so characters.  This is why all (require 'ob-*) lines (which must
correspond to file names) now use ob-* instead of org-babel-*.  Since I
(like you) prefer the org-babel-* prefixes, those have been retained for
all function and variable names.

Hope this explains it, I'm certainly open to other naming suggestions.

Best -- Eric

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] complex filters in agenda view

2010-06-26 Thread Nick Dokos
Matt Price mopto...@gmail.com wrote:

 yet another question as i continue to set things up.
 
 how would I create a custom agenda view that accomplishes this:
 (todo items marked ACTION OR WAITING AND tagged email)? 
 I don't think I see how to do this in the manual 
 (http://orgmode.org/org.html#Custom-agenda-views).
 
 am i missing it?  Thanks again,

Need you ask? :-) I have always thought that just as we are about to
think of something that org-mode cannot do, either we are wrong and it
is already there, or Carsten (and now et. al.) is checking in the
required change.


A bit more seriously, there was a post by Bernt Hansen recently on
exactly this question:

  http://thread.gmane.org/gmane.emacs.orgmode/26319/focus=26329

and the relevant documentation is section 10.3.3, Matching tags and
properties, in the Org manual (particularly the last paragraph or two
in the section.)

Based on these, and on the documentation of org-agenda-custom-commands,
I came up with the following:

(setq org-agenda-custom-commands
  '((x matt-price-special tags-todo email/!+ACTION|+WAITING)))

BTW, the ! skips DONE items and speeds up the search.

Of course, you would have to splice in the new setting to your settings
of org-agenda-custom-commands, but I assume that is clear.

That answers the question (I think), but I wanted to talk a bit more
about testing things like this: there is an old idea in emacs lisp
programming of a minimal .emacs file, where you strip everything off and
leave only what's relevant for testing. Then you fire up a bare emacs
that avoids all other complications and concentrates on *these*
complications:

 emacs -Q -l ~/minimal.emacs

Here is the minimal .emacs that I use for org (shamelessly stolen from
Bernt Hansen - you'll have to modify the paths for your setup), as modified
for your question:

,
| ;;; constant part
| (add-to-list 'load-path (expand-file-name ~/src/emacs/org/org-mode/lisp))
| (add-to-list 'auto-mode-alist '(\\.\\(org\\|org_archive\\|txt\\)$ . 
org-mode))
| (require 'org-install)
| (global-set-key \C-cl 'org-store-link)
| (global-set-key \C-ca 'org-agenda)
| 
| ;;; variable part
| (setq org-agenda-custom-commands
|   '((x matt-price-special tags-todo email/!+ACTION|+WAITING)))
| 
| (setq org-agenda-files '(~/src/org/filters/matt-price.org))
`

and here's the file that I used for testing the custom agenda command:

,
| #+TODO: TODO ACTION WAITING | DONE
| 
| 
| * TODO foo:email:
|
| * ACTION bar
| 
| * WAITING baz
| 
| * ACTION foobar   :email:
| 
| * DONE foobaz
| 
| * WAITING barbaz  :email:
`

I could then apply the custom command with C-c a x and I got the following:

,
| Headlines with TAGS match: email/!+ACTION|+WAITING
| Press `C-u r' to search again with new search string
|   matt-price: ACTION foobar  
:email:
|   matt-price: WAITING barbaz 
:email:
`

What I hope to do with these ramblings is to gently encourage you (and
everybody else) to provide these two things whenever you submit a
question:

   o Here is what I have in my org file.

   o Here is what I would like to see.

   o Here is what I tried.

It was fairly easy to come up with them this time, but that is not
always the case, so since you have already spent some time setting it
up, show us what you have done: you are likely to get an answer much
more quickly and it is more likely to be a correct answer that way.

Cheers,
Nick

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: complex filters in agenda view

2010-06-26 Thread Bernt Hansen
Matt Price mopto...@gmail.com writes:

 yet another question as i continue to set things up.

 how would I create a custom agenda view that accomplishes this:
 (todo items marked ACTION OR WAITING AND tagged email)? 

Hi Matt,

Use a tags match (or a tags todo match if both of those todo items are
not done states)

C-c a m email/ACTION|WAITING RET

or

C-c a m email/!ACTION|WAITING RET

Tags todo matches with /! or C-c a M returns results faster if you don't
need to match any DONE states.

-Bernt

 I don't think I see how to do this in the manual 
 (http://orgmode.org/org.html#Custom-agenda-views).

 am i missing it?  Thanks again,
 matt

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: [ANN] Org-babel integrated into Org-mode

2010-06-26 Thread Štěpán Němec
Eric Schulte schulte.e...@gmail.com writes:

 Štěpán Němec step...@gmail.com writes:

 [...]

 How come some of your rewrites above still use the `org-babel-' prefix?
 (As a side note, I don't see what Emacs guidelines suggest `ob-' is more
 appropriate than `org-babel-', and I would personally prefer to retain
 the latter -- it's much more descriptive.)

 Štěpán


 Hi Štěpán,

 The guidelines I mentioned (I believe) specify that all file names for
 emacs-lisp files which are part of Emacs must be unique in the first 6
 or so characters.  This is why all (require 'ob-*) lines (which must
 correspond to file names) now use ob-* instead of org-babel-*.  Since I
 (like you) prefer the org-babel-* prefixes, those have been retained for
 all function and variable names.

I see. Hm... could you provide some source for that? The only
restriction on file names I can recall is this section from Appendix D
of the Emacs Lisp Reference Manual:

   * Please keep the names of your Emacs Lisp source files to 13
 characters or less.  This way, if the files are compiled, the
 compiled files' names will be 14 characters or less, which is
 short enough to fit on all kinds of Unix systems.
 
Is that perhaps what you meant? In any case, I see that the
recommendation I quote above would make the file renaming necessary,
too.

(Also, I believe you actually did mention renaming *functions*, which
created my confusion in the first place -- cf. the commit message of
e0e4d76094f26 for example.)

 Hope this explains it, I'm certainly open to other naming suggestions.

It would make a lot of sense to at least still begin the file names with
`org' IMHO, if at all possible.

Štěpán

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Org-babel `:hlines yes` no longer working for python

2010-06-26 Thread Eric Schulte
Hi Christopher,

Thanks for pointing this out, this is an error in the documentation,
which I will update.  The code you posted should generate the error you
have received.

Currently the only language which can handle hlines is emacs-lisp, all
other languages will result in errors like the one you pasted below.
That's not to say that it wouldn't be possible to add hline handling to
other languages, or to maybe do something tricky like session-based
evaluation in which an `hlines' variable was pre-initialized to some
value, but I digress.

Note that it *is* possible to have hlines in the output, using colnames,
e.g.

--8---cut here---start-8---
#+tblname: A
| a | b | c |
|---+---+---|
| d | e | f |
| g | h | i |

#+begin_src python :var tab=A :colnames yes
return [[val + '*' for val in row] for row in tab]
#+end_src

#+results:
| a  | b  | c  |
|++|
| d* | e* | f* |
| g* | h* | i* |
--8---cut here---end---8---

which works because the hline, and the column names, are never made
available to python, rather Babel holds onto them and then re-applies
them to the source block's output.

or even to have an elisp block add hlines to your results

--8---cut here---start-8---
#+tblname: many-cols
| a | b | c |
|---+---+---|
| d | e | f |
|---+---+---|
| g | h | i |

#+source: echo-table
#+begin_src python :var tab=many-cols
  return tab
#+end_src

#+begin_src emacs-lisp :var table=echo-table
  (butlast (apply #'append (mapcar (lambda (el) (list el 'hline)) table)))
#+end_src

#+results:
| a | b | c |
|---+---+---|
| d | e | f |
|---+---+---|
| g | h | i |
--8---cut here---end---8---

Thanks for pointing this out!

Best -- Eric

Christopher Allan Webber cweb...@dustycloud.org writes:

 Hello all,

 I was going through the tutorial and testing the :hlines yes feature as
 described in the info manual.  Unfortunately, the example given no
 longer seems to work for python:

 #+tblname: many-cols
 | a | b | c |
 |---+---+---|
 | d | e | f |
 |---+---+---|
 | g | h | i |

 #+source: echo-table
 #+begin_src python :var tab=many-cols :hlines yes
   return tab
 #+end_src

 #+results: echo-table
 | a | b | c |
 | d | e | f |
 | g | h | i |

 In the buffer *Org-Babel Error Output* I see:

 Traceback (most recent call last):
   File stdin, line 6, in module
   File stdin, line 3, in main
 NameError: global name 'hline' is not defined

 In emacs-lisp this still seems to work though.  But I also see that in
 emacs lisp hlines are represented by the hline symbol.  I'm guessing
 that the python equivalent was trying to do the same thing, but no hline
 variable exists in python?

 Thanks!
  - cwebb

 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: [ANN] Org-babel integrated into Org-mode

2010-06-26 Thread Eric Schulte
Štěpán Němec step...@gmail.com writes:

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

 Štěpán Němec step...@gmail.com writes:

 [...]

 How come some of your rewrites above still use the `org-babel-' prefix?
 (As a side note, I don't see what Emacs guidelines suggest `ob-' is more
 appropriate than `org-babel-', and I would personally prefer to retain
 the latter -- it's much more descriptive.)

 Štěpán


 Hi Štěpán,

 The guidelines I mentioned (I believe) specify that all file names for
 emacs-lisp files which are part of Emacs must be unique in the first 6
 or so characters.  This is why all (require 'ob-*) lines (which must
 correspond to file names) now use ob-* instead of org-babel-*.  Since I
 (like you) prefer the org-babel-* prefixes, those have been retained for
 all function and variable names.

 I see. Hm... could you provide some source for that? The only
 restriction on file names I can recall is this section from Appendix D
 of the Emacs Lisp Reference Manual:

* Please keep the names of your Emacs Lisp source files to 13
  characters or less.  This way, if the files are compiled, the
  compiled files' names will be 14 characters or less, which is
  short enough to fit on all kinds of Unix systems.
  
 Is that perhaps what you meant? In any case, I see that the
 recommendation I quote above would make the file renaming necessary,
 too.


Maybe that is the ultimate source, this requirement came to me by way of
a recommendation from Carsten when we first discussed merging babel into
the Org-mode core.


 (Also, I believe you actually did mention renaming *functions*, which
 created my confusion in the first place -- cf. the commit message of
 e0e4d76094f26 for example.)


my bad.


 Hope this explains it, I'm certainly open to other naming suggestions.

 It would make a lot of sense to at least still begin the file names with
 `org' IMHO, if at all possible.


hmm, the longest (non-language-specific) file name is already 12
characters long,

(length ob-tangle.el) ;; = 12

which doesn't give us much room to play around with.  Looking at a
couple of possible prefixes, and the related leftover characters for
differentiating the *-tangle, *-comint, *-ref, etc... core babel files,
yields the following

| prefix   | remaining characters |
|--+--|
| ob-  |5 |
| org-b-   |2 |
| orgb-|3 |
| org-bbl- |0 |
| bbl- |4 |
| babel-   |2 |
#+TBLFM: $2='(sbe leftover (prefix $$1))

#+source: leftover
#+begin_src emacs-lisp :var prefix=
  (-
   ;; length w/o .el
   (- 13 (length .el))
   ;; length of prefix
   (length prefix))
#+end_src

Personally, none of the above seem to be particularly superior to the
current naming scheme, given the fact that we need to fit multiple files
behind this prefix.

-- Eric


 Štěpán

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] magit, revert, folding, normal-mode, performance

2010-06-26 Thread Samuel Wales
Worth knowing that magit reverts buffers.  It appears to
revert all buffers, not just those with changes.  This has 2
consequences for org.  Magit is slow, and org visibility is
reset to default.

So I wonder:

Is there a way to preserve visibilty across revert-buffer?
Has anybody profiled loading a large org file?

Thanks.

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [ANN] Org-babel integrated into Org-mode

2010-06-26 Thread Stephan Schmitt



Also sprach Eric Schulte:

Štěpán Němecstep...@gmail.com  writes:


Eric Schulteschulte.e...@gmail.com  writes:


Štěpán Němecstep...@gmail.com  writes:

[...]


How come some of your rewrites above still use the `org-babel-' prefix?
(As a side note, I don't see what Emacs guidelines suggest `ob-' is more
appropriate than `org-babel-', and I would personally prefer to retain
the latter -- it's much more descriptive.)

 Štěpán




[...]

The only restriction on file names I can recall is this section
from Appendix D of the Emacs Lisp Reference Manual:

* Please keep the names of your Emacs Lisp source files to 13
  characters or less.  This way, if the files are compiled, the
  compiled files' names will be 14 characters or less, which is
  short enough to fit on all kinds of Unix systems.



Are there any unix systems running emacs 22 (iirc org-mode doesn't
support emacs 21 anymore) which have problems with long filenames?
We're living in the 21st century, aren't we?

[...]


It would make a lot of sense to at least still begin the file names with
`org' IMHO, if at all possible.



hmm, the longest (non-language-specific) file name is already 12
characters long,

(length ob-tangle.el) ;; =  12

which doesn't give us much room to play around with.  Looking at a
couple of possible prefixes, and the related leftover characters for
differentiating the *-tangle, *-comint, *-ref, etc... core babel files,
yields the following

| prefix   | remaining characters |
|--+--|
| ob-  |5 |
| org-b-   |2 |
| orgb-|3 |
| org-bbl- |0 |
| bbl- |4 |
| babel-   |2 |
#+TBLFM: $2='(sbe leftover (prefix $$1))

#+source: leftover
#+begin_src emacs-lisp :var prefix=
   (-
;; length w/o .el
(- 13 (length .el))
;; length of prefix
(length prefix))
#+end_src

Personally, none of the above seem to be particularly superior to the
current naming scheme, given the fact that we need to fit multiple files
behind this prefix.


I think you have to add 2 to each of the numbers above.
But the conclusion surely remains the same...

Greetings,
Stephan

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Org-babel `:hlines yes` no longer working for python

2010-06-26 Thread Eric Schulte
Hi Christopher,

I'm certainly no Python expert, but I implemented your idea of
converting hlines to and from None's (patch below [1]), and it seems
to work (under some definition of work).  See the following example with
the new behavior.

--8---cut here---start-8---
#+tblname: many-cols
| a | b | c |
|---+---+---|
| d | e | f |
|---+---+---|
| g | h | i |

#+source: echo-table
#+begin_src python :var tab=many-cols :hlines yes
  return tab
#+end_src

#+results: echo-table
| a | b | c |
|---+---+---|
| d | e | f |
|---+---+---|
| g | h | i |
--8---cut here---end---8---

Please, Python people, try this out and if you like the behavior then
I'll happily apply the patch.

Best -- Eric

Christopher Allan Webber cweb...@dustycloud.org writes:

 Hey Eric,

 Thanks for the super helpful reply!

 Out of curiosity, is it likely that we will ever get hline support in
 Python and etc?  I've been pondering how it might be done, and maybe it
 could be like this, using a '|-' string instead of a list for the row:

 [['a', 'b', 'c'], '|-', ['d', 'e', 'f'], ['g', 'h', 'i']]

 Which would produce:

 | a | b | c |
 |---+---+---|
 | d | e | f |
 | g | h | i |

 Alternately maybe the same thing could be done by abusing None:

 [['a', 'b', 'c'], None, ['d', 'e', 'f'], ['g', 'h', 'i']]

 Thoughts?
  - cwebb

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

 Hi Christopher,

 Thanks for pointing this out, this is an error in the documentation,
 which I will update.  The code you posted should generate the error you
 have received.

 Currently the only language which can handle hlines is emacs-lisp, all
 other languages will result in errors like the one you pasted below.
 That's not to say that it wouldn't be possible to add hline handling to
 other languages, or to maybe do something tricky like session-based
 evaluation in which an `hlines' variable was pre-initialized to some
 value, but I digress.

 Note that it *is* possible to have hlines in the output, using colnames,
 e.g.


 --8---cut here---start-8---
 #+tblname: A
 | a | b | c |
 |---+---+---|
 | d | e | f |
 | g | h | i |

 #+begin_src python :var tab=A :colnames yes
 return [[val + '*' for val in row] for row in tab]
 #+end_src

 #+results:
 | a  | b  | c  |
 |++|
 | d* | e* | f* |
 | g* | h* | i* |
 --8---cut here---end---8---

 which works because the hline, and the column names, are never made
 available to python, rather Babel holds onto them and then re-applies
 them to the source block's output.

 or even to have an elisp block add hlines to your results


 --8---cut here---start-8---
 #+tblname: many-cols
 | a | b | c |
 |---+---+---|
 | d | e | f |
 |---+---+---|
 | g | h | i |

 #+source: echo-table
 #+begin_src python :var tab=many-cols
   return tab
 #+end_src

 #+begin_src emacs-lisp :var table=echo-table
   (butlast (apply #'append (mapcar (lambda (el) (list el 'hline)) table)))
 #+end_src

 #+results:
 | a | b | c |
 |---+---+---|
 | d | e | f |
 |---+---+---|
 | g | h | i |
 --8---cut here---end---8---

 Thanks for pointing this out!

 Best -- Eric

 Christopher Allan Webber cweb...@dustycloud.org writes:

 Hello all,

 I was going through the tutorial and testing the :hlines yes feature as
 described in the info manual.  Unfortunately, the example given no
 longer seems to work for python:

 #+tblname: many-cols
 | a | b | c |
 |---+---+---|
 | d | e | f |
 |---+---+---|
 | g | h | i |

 #+source: echo-table
 #+begin_src python :var tab=many-cols :hlines yes
   return tab
 #+end_src

 #+results: echo-table
 | a | b | c |
 | d | e | f |
 | g | h | i |

 In the buffer *Org-Babel Error Output* I see:

 Traceback (most recent call last):
   File stdin, line 6, in module
   File stdin, line 3, in main
 NameError: global name 'hline' is not defined

 In emacs-lisp this still seems to work though.  But I also see that in
 emacs lisp hlines are represented by the hline symbol.  I'm guessing
 that the python equivalent was trying to do the same thing, but no hline
 variable exists in python?

 Thanks!
  - cwebb

 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Footnotes: 
[1]  
diff --git a/lisp/babel/langs/ob-python.el b/lisp/babel/langs/ob-python.el
index 2ce9e1d..29bb166 100644
--- a/lisp/babel/langs/ob-python.el
+++ b/lisp/babel/langs/ob-python.el
@@ -96,7 +96,7 @@ called by `org-babel-execute-src-block'.
 specifying a var of the same value.
   (if (listp var)
   (concat [ (mapconcat #'org-babel-python-var-to-python var , ) ])
-(format %S var)))
+(if (equal var 'hline) None (format %S var
 
 (defun org-babel-python-table-or-string (results)
   If the results look 

[Orgmode] Re: magit, revert, folding, normal-mode, performance

2010-06-26 Thread Óscar Fuentes
Samuel Wales samolog...@gmail.com writes:

 Worth knowing that magit reverts buffers.  It appears to
 revert all buffers, not just those with changes.

Magit reverts all saved buffers on the current working copy after
committing.

 This has 2 consequences for org.  Magit is slow, and org visibility is
 reset to default.

I'm the author of the patch that introduced that behavior on magit. The
purpose is to update the VC modeline text that indicates when a file is
edited (Git-branch_name for pristine files, Git:branch_name for edited
files.) It's true thas sometimes reverting can be slow and produce side
effects.

 So I wonder:

 Is there a way to preserve visibilty across revert-buffer?

I'll look at the docstring of `revert-buffer' and, specifically, to
`revert-buffer-function'. But don't bother, I have a patch for updating
the VC modeline without reverting the buffer and will submit it to the
magit mailing list right now.

 Has anybody profiled loading a large org file?


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Org-babel `:hlines yes` no longer working for python

2010-06-26 Thread Christopher Allan Webber
Eric,

Looks good to me!  It's abusing the None type's meaning a little, but
I think it's acceptable enough.  (If you think of hlines as rows that
are not rows, you can trick yourself into thinking it is perfectly
pythonic :))

 - cwebb

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

 Hi Christopher,

 I'm certainly no Python expert, but I implemented your idea of
 converting hlines to and from None's (patch below [1]), and it seems
 to work (under some definition of work).  See the following example with
 the new behavior.


 --8---cut here---start-8---
 #+tblname: many-cols
 | a | b | c |
 |---+---+---|
 | d | e | f |
 |---+---+---|
 | g | h | i |

 #+source: echo-table
 #+begin_src python :var tab=many-cols :hlines yes
   return tab
 #+end_src

 #+results: echo-table
 | a | b | c |
 |---+---+---|
 | d | e | f |
 |---+---+---|
 | g | h | i |
 --8---cut here---end---8---

 Please, Python people, try this out and if you like the behavior then
 I'll happily apply the patch.

 Best -- Eric

 Christopher Allan Webber cweb...@dustycloud.org writes:

 Hey Eric,

 Thanks for the super helpful reply!

 Out of curiosity, is it likely that we will ever get hline support in
 Python and etc?  I've been pondering how it might be done, and maybe it
 could be like this, using a '|-' string instead of a list for the row:

 [['a', 'b', 'c'], '|-', ['d', 'e', 'f'], ['g', 'h', 'i']]

 Which would produce:

 | a | b | c |
 |---+---+---|
 | d | e | f |
 | g | h | i |

 Alternately maybe the same thing could be done by abusing None:

 [['a', 'b', 'c'], None, ['d', 'e', 'f'], ['g', 'h', 'i']]

 Thoughts?
  - cwebb

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

 Hi Christopher,

 Thanks for pointing this out, this is an error in the documentation,
 which I will update.  The code you posted should generate the error you
 have received.

 Currently the only language which can handle hlines is emacs-lisp, all
 other languages will result in errors like the one you pasted below.
 That's not to say that it wouldn't be possible to add hline handling to
 other languages, or to maybe do something tricky like session-based
 evaluation in which an `hlines' variable was pre-initialized to some
 value, but I digress.

 Note that it *is* possible to have hlines in the output, using colnames,
 e.g.


 --8---cut here---start-8---
 #+tblname: A
 | a | b | c |
 |---+---+---|
 | d | e | f |
 | g | h | i |

 #+begin_src python :var tab=A :colnames yes
 return [[val + '*' for val in row] for row in tab]
 #+end_src

 #+results:
 | a  | b  | c  |
 |++|
 | d* | e* | f* |
 | g* | h* | i* |
 --8---cut here---end---8---

 which works because the hline, and the column names, are never made
 available to python, rather Babel holds onto them and then re-applies
 them to the source block's output.

 or even to have an elisp block add hlines to your results


 --8---cut here---start-8---
 #+tblname: many-cols
 | a | b | c |
 |---+---+---|
 | d | e | f |
 |---+---+---|
 | g | h | i |

 #+source: echo-table
 #+begin_src python :var tab=many-cols
   return tab
 #+end_src

 #+begin_src emacs-lisp :var table=echo-table
   (butlast (apply #'append (mapcar (lambda (el) (list el 'hline)) table)))
 #+end_src

 #+results:
 | a | b | c |
 |---+---+---|
 | d | e | f |
 |---+---+---|
 | g | h | i |
 --8---cut here---end---8---

 Thanks for pointing this out!

 Best -- Eric

 Christopher Allan Webber cweb...@dustycloud.org writes:

 Hello all,

 I was going through the tutorial and testing the :hlines yes feature as
 described in the info manual.  Unfortunately, the example given no
 longer seems to work for python:

 #+tblname: many-cols
 | a | b | c |
 |---+---+---|
 | d | e | f |
 |---+---+---|
 | g | h | i |

 #+source: echo-table
 #+begin_src python :var tab=many-cols :hlines yes
   return tab
 #+end_src

 #+results: echo-table
 | a | b | c |
 | d | e | f |
 | g | h | i |

 In the buffer *Org-Babel Error Output* I see:

 Traceback (most recent call last):
   File stdin, line 6, in module
   File stdin, line 3, in main
 NameError: global name 'hline' is not defined

 In emacs-lisp this still seems to work though.  But I also see that in
 emacs lisp hlines are represented by the hline symbol.  I'm guessing
 that the python equivalent was trying to do the same thing, but no hline
 variable exists in python?

 Thanks!
  - cwebb

 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

 Footnotes: 
 [1]  

 diff --git a/lisp/babel/langs/ob-python.el b/lisp/babel/langs/ob-python.el
 index 2ce9e1d..29bb166 100644
 --- a/lisp/babel/langs/ob-python.el
 +++ b/lisp/babel/langs/ob-python.el
 @@ -96,7 +96,7 @@ 

[Orgmode] Bug: org-capture destroys target file when user aborting prompt in template [6.36trans (release_6.36.430.gec51)]

2010-06-26 Thread David Maus

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


When I use an org-capture template that prompts for something
(e.g. headline title) and I abort the prompt (C-g), the capture
process is aborted.  When I quit Emacs right after this, it
mentions the target file to be changed and asks if I would like to
save the change.  If I say yes, the target file is written to disk
with just the skeleton of the template.

Steps to reproduce:

 - setup capture targets with a prompt, e.g.

   (setq org-capture-templates
  '((t Task or appointment entry (file ~/org/inbox.org)
 * TODO %^{Todo} \n:PROPERTIES:\n:created: %U\n:END:\n\n%?)
(m Task or appointment (internet message) entry
 (file ~/org/inbox.org)
 * TODO %:subject \n:PROPERTIES:\n:created: %U\n:END:\n\n%a\n\n%?)
(i Idea (some day, may be) entry (file ~/org/inbox.org)
 * MAYBE %^{What} \n:PROPERTIES:\n:created: %U\n:END:\n\n%?)
(n Note entry (file ~/org/inbox.org)
 * %:subject%^{Topic} :note:\n:PROPERTIES:\n:created: %U\n:END:\n\n%?)
(p Project entry (file ~/org/inbox.org)
 * %^{Project} :project:\n:PROPERTIES:\n:created: %U\n:END:\n\n%?)))

 - call `org-capture' and select template with prompt (e.g. t)

 - when prompted, press C-g

 - quit Emacs, answer yes to save target file

 - *boom*, the target contains just:

   * TODO
 :PROPERTIES:
 :created:  [2010-06-27 So 07:36]
 :END:

 %?

Taking a quick look at this, I noticed that after aborting the prompt
I have a buffer namend *Capture* with the skeletion of the template,
i.e. exactly what is writting to disk when I leave Emacs.  C-c C-k
does not work in this buffer.

And it is not even necessary to leave Emacs -- calling
`org-save-all-org-buffers' seems to cause this buffer writting to
target file.

 -- David

Emacs  : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
 of 2010-05-16 on raven, modified by Debian
Package: Org-mode version 6.36trans (release_6.36.430.gec51)

current state:
==
(setq
 org-export-html-final-hook '(org-inlinetask-remove-terminator)
 org-log-done 'time
 org-wl-nntp-prefer-web-links t
 org-export-author-info nil
 org-export-latex-default-class scrartcl
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-todo-keyword-faces '((MAYBE :foreground coral :weight bold) (TODO 
:foreground red :weight bold)
  (NEXT :foreground orange red :weight bold) 
(WAIT :foreground dark red :weight bold)
  (DONE :foreground forest green :weight bold)
  (CANCELLED :foreground dark gray :weight bold))
 org-wl-shimbun-prefer-web-links t
 org-agenda-custom-commands '((r Refile new tasks, projects, notes, and 
references tags LEVEL=1+REFILE
   ((org-agenda-overriding-header New tasks, 
projects, notes, and references)))
  (o Other tasks tags-todo 
STYLE\habit\/!TODO
   ((org-agenda-skip-function (quote 
dmj/has-timestamp))
(org-agenda-overriding-header Other tasks))
   )
  (n Next actions tags-todo /!NEXT 
((org-agenda-overriding-header Next actions)))
  (M Someday/maybe tags-todo /!MAYBE)
  (p Projects tags project 
((org-agenda-overriding-header Projects)))
  (P New projects tags-todo /!-DONE-CANCELLED
   ((org-agenda-overriding-header New projects)
(org-agenda-skip-function (quote 
dmj/skip-non-project)))
   )
  )
 org-agenda-files '(~/org/)
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent 
org-depend-block-todo)
 org-agenda-tags-column -100
 org-export-ascii-final-hook '(org-inlinetask-remove-terminator)
 org-hide-leading-stars t
 org-clock-into-drawer CLOCK
 org-checklist-export-function 'org-export-as-ascii
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current org-checklist)
 org-agenda-todo-ignore-scheduled t
 org-todo-state-tags-triggers '((todo (note)))
 org-log-state-notes-insert-after-drawers t
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-stuck-projects '(project/-DONE-CANCELLED (NEXT) nil nil)
 org-trigger-hook '(org-depend-trigger-todo)
 org-export-preprocess-hook '(org-export-blocks-preprocess)
 org-tags-exclude-from-inheritance '(note project)