Re: [Orgmode] importing google docs document into org

2011-02-20 Thread Puneeth Chaganti
On Sun, Feb 20, 2011 at 12:01 PM, Le Wang l26w...@gmail.com wrote:
 On Fri, Feb 18, 2011 at 8:57 PM, Puneeth
 Chaganti puncha...@gmail.com wrote:

 Actually, if you can describe the problems that you were faced with, I
 would be interested in spending some time and trying to fix those
 problems with Pandoc or atleast report issues and get them fixed. (I
 had contributed the original exporter, though my Haskell knowledge is
 negligible.)

 Upon closer inspection of the google docs exported html, it appears that the
 problems I had were not pandoc issues but google docs issues.

Righto! Thanks for taking the time to inspect.

Thanks,
Puneeth

___
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: ePub and Org mode

2011-02-20 Thread Eric Schulte
Achim Gratz strom...@nexgo.de writes:

 Christian Moe m...@christianmoe.com writes:
 I agree exporting 'chapters' in a single Org document to separate html
 files would be a nice option to have.

 Pending someone writing an export function for this, you could
 [...]

 That sort of already exists, I've been using that to some good
 effect... from the documentation:

When exporting only a single subtree by selecting it with `C-c @'
 before calling an export command, the subtree can overrule some of the
 file's export settings with properties `EXPORT_FILE_NAME',
 `EXPORT_TITLE', `EXPORT_TEXT', `EXPORT_AUTHOR', `EXPORT_DATE', and
 `EXPORT_OPTIONS'.

 The only thing missing is a function to export all (not excluded)
 subtrees one by one and honor the properties slapped onto each subtree.


`org-map-entries' should satisfy this need. -- Eric

,
| org-map-entries is a Lisp function in `org.el'.
| 
| (org-map-entries FUNC optional MATCH SCOPE rest SKIP)
| 
| Call FUNC at each headline selected by MATCH in SCOPE.
| 
| FUNC is a function or a lisp form.  The function will be called without
| arguments, with the cursor positioned at the beginning of the headline.
| The return values of all calls to the function will be collected and
| returned as a list.
| 
| The call to FUNC will be wrapped into a save-excursion form, so FUNC
| does not need to preserve point.  After evaluation, the cursor will be
| moved to the end of the line (presumably of the headline of the
| processed entry) and search continues from there.  Under some
| circumstances, this may not produce the wanted results.  For example,
| if you have removed (e.g. archived) the current (sub)tree it could
| mean that the next entry will be skipped entirely.  In such cases, you
| can specify the position from where search should continue by making
| FUNC set the variable `org-map-continue-from' to the desired buffer
| position.
| 
| MATCH is a tags/property/todo match as it is used in the agenda tags view.
| Only headlines that are matched by this query will be considered during
| the iteration.  When MATCH is nil or t, all headlines will be
| visited by the iteration.
| 
| SCOPE determines the scope of this command.  It can be any of:
| 
| nil The current buffer, respecting the restriction if any
| treeThe subtree started with the entry at point
| fileThe current buffer, without restriction
| file-with-archives
| The current buffer, and any archives associated with it
| agenda  All agenda files
| agenda-with-archives
| All agenda files with any archive files associated with them
| (file1 file2 ...)
| If this is a list, all files in the list will be scanned
| 
| The remaining args are treated as settings for the skipping facilities of
| the scanner.  The following items can be given here:
| 
|   archiveskip trees with the archive tag.
|   commentskip trees with the COMMENT keyword
|   function or Emacs Lisp form:
|  will be used as value for `org-agenda-skip-function', so whenever
|  the function returns t, FUNC will not be called for that
|  entry and search will continue from the point where the
|  function leaves it.
| 
| If your function needs to retrieve the tags including inherited tags
| at the *current* entry, you can use the value of the variable
| `org-scanner-tags' which will be much faster than getting the value
| with `org-get-tags-at'.  If your function gets properties with
| `org-entry-properties' at the *current* entry, bind `org-trust-scanner-tags'
| to t around the call to `org-entry-properties' to get the same speedup.
| Note that if your function moves around to retrieve tags and properties at
| a *different* entry, you cannot use these techniques.
`

___
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: [babel][patch] C++ inconsistencies

2011-02-20 Thread Eric Schulte
[...]

 Hi 

 After further inspection and testing the following patch is more
 complete (apologies for the noise).

 In addition I have a very simple Yaml template if it is of any interest
 to anybody. I have a strong use case for tangling Yaml for 'literate
 configuration' purposes since I come across some particularly hairy yaml
 configuration files for the unit-test libraries Unity, CMock and
 Ceedling. 

 Regards

 Martyn


Hi Martyn,

Thanks for sharing this patch, it looks great.  Also, I would love to
include your YAML support.  It's better to have partial YAML support
than none, and any skeleton can serve as the foundation for more
sophisticated support.

Would you be willing to sign the FSF copyright attribution?  If so then
I can apply the patch and add the YAML support as soon as the process
begins.  See http://orgmode.org/worg/org-contribute.html

Thanks! -- Eric




 diff --git a/lisp/ob-C.el b/lisp/ob-C.el
 index da0e768..5aa750c 100644
 --- a/lisp/ob-C.el
 +++ b/lisp/ob-C.el
 @@ -38,7 +38,7 @@
  (declare-function org-entry-get org
   (pom property optional inherit literal-nil))
  
 -(add-to-list 'org-babel-tangle-lang-exts '(c++ . cpp))
 +(add-to-list 'org-babel-tangle-lang-exts '(C++ . cpp))
  
  (defvar org-babel-default-header-args:C '())
  
 @@ -46,8 +46,8 @@
Command used to compile a C source code file into an
executable.)
  
 -(defvar org-babel-c++-compiler g++
 -  Command used to compile a c++ source code file into an
 +(defvar org-babel-C++-compiler g++
 +  Command used to compile a C++ source code file into an
executable.)
  
  (defvar org-babel-c-variant nil
 @@ -56,15 +56,15 @@ is currently being evaluated.)
  
  (defun org-babel-execute:cpp (body params)
Execute BODY according to PARAMS.  This function calls
 -`org-babel-execute:C'.
 -  (org-babel-execute:C body params))
 +`org-babel-execute:C++'.
 +  (org-babel-execute:C++ body params))
  
 -(defun org-babel-execute:c++ (body params)
 +(defun org-babel-execute:C++ (body params)
  Execute a block of C++ code with org-babel.  This function is
  called by `org-babel-execute-src-block'.
(let ((org-babel-c-variant 'cpp)) (org-babel-C-execute body params)))
  
 -(defun org-babel-expand-body:c++ (body params)
 +(defun org-babel-expand-body:C++ (body params)
Expand a block of C++ code with org-babel according to it's
  header arguments (calls `org-babel-C-expand').
(let ((org-babel-c-variant 'cpp)) (org-babel-C-expand body params)))
 @@ -81,7 +81,7 @@ header arguments (calls `org-babel-C-expand').
  
  (defun org-babel-C-execute (body params)
This function should only be called by `org-babel-execute:C'
 -or `org-babel-execute:c++'.
 +or `org-babel-execute:C++'.
(let* ((tmp-src-file (org-babel-temp-file
 C-src-
 (cond
 @@ -98,7 +98,7 @@ or `org-babel-execute:c++'.
  (format %s -o %s %s %s
  (cond
   ((equal org-babel-c-variant 'c) org-babel-C-compiler)
 - ((equal org-babel-c-variant 'cpp) 
 org-babel-c++-compiler))
 + ((equal org-babel-c-variant 'cpp) 
 org-babel-C++-compiler))
  (org-babel-process-file-name tmp-bin-file)
  (mapconcat 'identity
 (if (listp flags) flags (list flags))  )

 ---

 Org-mode version 7.4
 GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.0) of
 2011-02-18



 ___
 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


Re: [Orgmode] Re: [babel] How to kill two birds with one stone?

2011-02-20 Thread Eric Schulte
Hi,

I haven't followed this discussion very closely, but I'm not sure why it
would be necessary to pass data through STDIN rather than through a
variable or an external file.

I took a shot at the dot graph example you proposed, the following works
for me over a simple example directory.

Best -- Eric

directory to search
#+results: graph-dir
: graph-dir

list all files in dir
#+source: graph-files
#+begin_src sh :results vector :var dir=graph-dir
  find $dir -type f -exec basename {} \;
#+end_src

#+results: graph-files
| other |
| dan   |
| eric  |
| seb   |

association of files with mentions
#+source: graph-associations
#+begin_src sh :var dir=graph-dir :var files=graph-files
  for i in $files; do
  for j in `grep -l -r $i $dir`;do
  echo $i, `basename $j`
  done
  done
#+end_src

#+results: graph-associations
| other | eric |
| other | seb  |
| dan   | eric |
| eric  | seb  |
| seb   | dan  |

graphing with dot
#+source: to-dot
#+begin_src sh :var associations=graph-associations :results scalar
  echo $associations|awk '{print $1, -, $2}'
#+end_src

#+results: to-dot
: other - eric
: other - seb
: dan - eric
: eric - seb
: seb - dan

#+begin_src dot :var data=to-dot :file files.png
  digraph G{
$data
  }
#+end_src

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

Sébastien Vauban wxhgmqzgw...@spammotel.com writes:

 Hi Dan,

 Dan Davison wrote:
 Cool post. I hope someone has some good ideas in this thread. Some quick
 responses / questions below.

 Note, in the latter code block, that I did not even tried to really chain
 steps 2 and 3: I'm rewriting step 3, including step 2 inside it.

 *I certainly miss a smarter way* to achieve the above.

 I think a relevant point here is that Org doesn't yet have the ability to
 pass data on standard input to a code block. I.e. a :stdin header arg. I
 don't think it's that hard, someone would just need to rework
 `org-babel-eval' so that it puts the code into a temporary file, freeing up
 stdin to be used for data

 I think you exactly spotted the problem.

 (and therefore we would no longer be able to use
 shell-command-on-region but some other command (call-process I think?).)

 I just don't understand this last sentence, by lack of knowledge on Babel's
 internals.

 Then you'd be able to do something like

 #+srcname: search-links-and-generate-dot-arrow
 #+header: :stdin search-files-pointing-to-this-file
 #+begin_src sh :results output :var f=charge_dim
 while read f; do
 echo $(basename $i) - $f;
 done
 #+end_src

 I'll be interested to see the solution to all this.

 I've tried to rewrite the example in a much cleaner way, showing what it
 should like in the best of the worlds, with a working code at hand...

 BTW, I think the following could be of use, with maybe slight modifications,
 even for projects like Worg: identifying all relationships between files,
 showing files that aren't referenced, etc.

 #+TITLE: Graph file dependencies
 #+DATE:  2011-02-06
 #+BABEL::dir ~/src/Worg

 * Context

 We want to demonstrate how to document a script in a very neat way (IMHO),
 that is:

 - By defining and explaining multiple small code blocks, using them later in a
   tangle file for constructing the full code.

 - By showing the effect of every small code block, that is what it returns
   when applied on test input data.

 The latter is the problem, as the code has to be able to take a results set as
 if it would come from =stdin=.

 * Code

 For the sake of clarity, a real-life example that graph dependencies between
 files (based on their /basename/).

 ** List all files

 Simple file command, ignoring =.svn= directories.

 #+srcname: file-tree
 #+begin_src sh :results output
 find . -not \( -name .svn -prune \) -type f -print | head -n 5
 #+end_src

 #+results: file-tree
 #+begin_example
 ./digraph.dot
 ./full-code.sh
 ./graph-circo.pdf
 ./graph-dot.pdf
 ./graph-fdp.pdf
 #+end_example

 ** Search recursively for anything about a file

 Grep-search through files, ignoring =.svn= directories.

 #+srcname: search-files-pointing-to-this-file
 #+begin_src sh :results output :var toname=charge_dim
 find . -not \( -name .svn -prune \) -type f -print0 |\
 xargs -0 grep -i --files-with-matches $toname
 #+end_src

 #+results: search-files-pointing-to-this-file
 : ./graph-file-dependencies.txt

 ** Convert to DOT

 In real life, the following block of code must read its input from =stdin=.

 For /in situ execution/, I should be able to say that =stdin= is equal to any
 results set (here: =search-files-pointing-to-this-file=).

 #+srcname: make-dot-arrow-for-files-pointing-to-this-file
 #+begin_src sh :results output :var toname=charge_dim
 while read -r fromname
 do
 echo \${fromname##*/}\ - \$toname\
 done
 #+end_src

 #+results: make-dot-arrow-for-files-pointing-to-this-file

 ** Full code: generate the DOT file

 #+begin_src sh :results output :file digraph.dot :noweb yes :tangle 
 full-code.sh
 echo 'digraph G {'
 echo 'node 

Re: [Orgmode] Re: org-babel: Bugs with inline src_* blocks

2011-02-20 Thread Eric Schulte
Dan Davison dandavis...@gmail.com writes:

 Paul Sexton psex...@xnet.co.nz writes:

 Eric Schulte schulte.eric at gmail.com writes:
 Hi, I agree with your intuition here, but I changed the default inline
 header argument so that others would be able to use inline code blocks
 and have the results inserted.  To regain the behavior you describe,
 simply adjust the value of `org-babel-default-inline-header-args' as
 follows in your .emacs file.
 
 #+begin_src emacs-lisp
   (setf org-babel-default-inline-header-args
 '((:session . none)
   (:results . silent)
   (:exports . results)))
 #+end_src

 Thanks Eric. The 'default' behaviour I experienced where inline blocks
 were inheriting behaviour from elsewhere seems odd however.

 Hi Paul, Eric,

 Paul -- I do agree with you. I've had to manually delete unwanted inline
 src output a few times in the last few days.

 I think we did have the behaviour we want before -- replacement during
 export but no modification of the buffer in interactive use. Could we
 make the default behave so that it does replace during export and
 silent during normal interactive evaluation? (Or some similar change
 to ob-exp.el?)


The easiest way to have header argument values vary between interactive
and export evaluation is to place raw elisp in the header argument
value.  The following (after pulling the latest version of Org-mode)
results in the behavior you describe.

#+begin_src emacs-lisp :results silent
  (setf org-babel-default-inline-header-args
'((:session . none)
  (:results . (if (boundp 'org-current-export-file) replace silent))
  (:exports . results)))
#+end_src

I think this is generally the most desirable behavior, and I'd vote that
this become the default header argument value for inline code blocks.

Best -- Eric


 Dan


 Is it intended
 to work this way?

 Paul


___
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: ePub and Org mode

2011-02-20 Thread Alan Tyree
On Sun, Feb 20, 2011 at 6:53 PM, Achim Gratz strom...@nexgo.de wrote:

 Christian Moe m...@christianmoe.com writes:
  I agree exporting 'chapters' in a single Org document to separate html
  files would be a nice option to have.
 
  Pending someone writing an export function for this, you could
 [...]

 That sort of already exists, I've been using that to some good
 effect... from the documentation:

 --8---cut here---start-8---
   When exporting only a single subtree by selecting it with `C-c @'
 before calling an export command, the subtree can overrule some of the
 file's export settings with properties `EXPORT_FILE_NAME',
 `EXPORT_TITLE', `EXPORT_TEXT', `EXPORT_AUTHOR', `EXPORT_DATE', and
 `EXPORT_OPTIONS'.
 --8---cut here---end---8---

 The only thing missing is a function to export all (not excluded)
 subtrees one by one and honor the properties slapped onto each subtree.

 True. I also use the subtree export function often. I is easy to define a
keyboard macro to deal with the problem. If I had to do it more than once,
I'm sure that it is not too hard to write an elisp function to do it.

I think that Christian is proably right: for ePub generation, there are
other tools that do the job. Two ways that are easy:

org - html - tidy -m -asxhtml - (calibre || sigil)

I have had trouble getting the calibre ePub to validate, but it is more
straightforward than Sigil. On the other hand, Sigil is easier to use to add
editing to the basic text and always seems to pass the validation tests.

To get proper validation, I have found that the tidy step is necessary.
Not sure why - tidy always replaces lots of characters, but I haven't had
the time to work out what is going on.

Cheers,
Alan



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

 SD adaptation for Waldorf microQ V2.22R2:
 http://Synth.Stromeko.net/Downloads.html#WaldorfSDada


 ___
 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




-- 
Alan L Tyreehttp://www2.austlii.edu.au/~alan
Tel:  04 2748 6206
___
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] Can I archive into datetree based on CLOSED date property

2011-02-20 Thread Urs Rau (UK)
Hi
I would quite like to have a function that would work on a region , or on a 
whole org file of todos and archive completed todos or a selected region into a 
datetree in the archive file in such a way that all completed todo items would 
be filed under the date on which their property says they were completed or 
closed.
Maybe it can already do it and I just need to learn how?
Thanks for pointers or counter suggestions.

Regards

-- 
Urs Rau 


___
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] Can I archive into datetree based on CLOSED date property

2011-02-20 Thread Puneeth Chaganti
On Sun, Feb 20, 2011 at 3:58 PM, Urs Rau (UK) urs@om.org wrote:
 Hi
 I would quite like to have a function that would work on a region , or on a 
 whole org file of todos and archive completed todos or a selected region into 
 a datetree in the archive file in such a way that all completed todo items 
 would be filed under the date on which their property says they were 
 completed or closed.
 Maybe it can already do it and I just need to learn how?

Worg has a hack [1] by Osamu Okanu, that modifies the
org-archive-subtree function to archive into a datetree. Combining
this with the org-map-entries function, you should be able to achieve
what you want.

Hope this helps,
Puneeth

[1] - http://orgmode.org/worg/org-hacks.html#sec-1_3_2

___
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: indentation for section headings vs bulleted lists

2011-02-20 Thread Nicolas
Hello,

Linus Arver linusar...@gmail.com writes:

 Again, I'm very curious why org-mode's indenting code treats bulleted
 lists differently than section headings.

This is due to a combination of org-indent-mode and visual-line-mode.
Actually, it's a a two-parts problem. 

Firstly, org-indent-mode only works by sections. That means the whole
section gets the same indent prefix, whatever can be inside. Thus, lists
cannot be treated differently for now.

Secondly, org-indent-mode is not indenting anything: it only fakes it.
While this is fine for headings, this causes problems with lists, which
are depending on real indentation.

Anyway, I'm on it. I'll post a patch as soon as I find and implement a
decent way to solve this.


Regards,

-- 
Nicolas

___
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: indentation for section headings vs bulleted lists

2011-02-20 Thread Carsten Dominik


On Feb 20, 2011, at 1:19 PM, Nicolas wrote:


Hello,

Linus Arver linusar...@gmail.com writes:


Again, I'm very curious why org-mode's indenting code treats bulleted
lists differently than section headings.


This is due to a combination of org-indent-mode and visual-line-mode.
Actually, it's a a two-parts problem.

Firstly, org-indent-mode only works by sections. That means the whole
section gets the same indent prefix, whatever can be inside. Thus,  
lists

cannot be treated differently for now.

Secondly, org-indent-mode is not indenting anything: it only fakes it.
While this is fine for headings, this causes problems with lists,  
which

are depending on real indentation.

Anyway, I'm on it. I'll post a patch as soon as I find and implement a
decent way to solve this.


Hi Nicolas,
while it might be posible to add additional line-prefix stuff to
plain lists, you need to be careful about performance.
I wrote several (I believe 4) different versions of
org-indent-mode before behavior was reasonably consistent
and fast enough.

Cheers

- 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: convert orgmode to docx

2011-02-20 Thread Fabian Braennstroem

Hi,

looks quite nice! Thanks to you both!

Fabian
On 02/19/2011 12:35 PM, Jambunathan K wrote:


Bastienbastien.gue...@wikimedia.fr  writes:


Hi Fabian,

Fabian Braennstroemf.braennstr...@gmx.de  writes:


I wonder, if anyone tried to convert orgmode to docx format yet!?

Please see Jambunathan's announce here:

   http://article.gmane.org/gmane.emacs.orgmode/36781

You can then convert .odt to .docx from OpenOffice/LibreOffice.


The above instructions assumes that you are comfortable using git. If
you are not comfortable using git you can try downloading a snapshot
from:

http://repo.or.cz/w/org-mode/org-jambu.git

(search for snapshot in the above web page)

Jambunathan K.

___
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: convert orgmode to docx

2011-02-20 Thread Fabian Braennstroem
Oh, one question... does this mean, it would be easier to use the 
orgmode-version for everything or can I just add your odt-implementation 
to my existing orgmode installation!?

Thanks! Fabian

On 02/19/2011 12:35 PM, Jambunathan K wrote:

Bastienbastien.gue...@wikimedia.fr  writes:


Hi Fabian,

Fabian Braennstroemf.braennstr...@gmx.de  writes:


I wonder, if anyone tried to convert orgmode to docx format yet!?

Please see Jambunathan's announce here:

   http://article.gmane.org/gmane.emacs.orgmode/36781

You can then convert .odt to .docx from OpenOffice/LibreOffice.


The above instructions assumes that you are comfortable using git. If
you are not comfortable using git you can try downloading a snapshot
from:

http://repo.or.cz/w/org-mode/org-jambu.git

(search for snapshot in the above web page)

Jambunathan K.

___
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: indentation for section headings vs bulleted lists

2011-02-20 Thread Nicolas
Hello,

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

 while it might be posible to add additional line-prefix stuff to plain
 lists, you need to be careful about performance.

Yes, this is my main concern actually. When I speak about a decent
solution, I'm really thinking about a sufficiently reactive one,
provided such a thing exists.

As far as I can tell, line-prefix is fine as it is. Lists just need to
take it as real indentation before processing. Alas, wrap-prefix is the
real problem.

A solution would be to distinguish if org-indent-refresh-section is
called with point in a list or not. In the former case, it would skip
lists when changing warp-prefix in the section. In the latter situation,
it would only set warp-prefix for the list at point.

But then, hooks like org-after-demote-entry-hook would need to call
org-indent-refresh-section with an argument telling it to redefine
warp-prefix for everything in section, lists included. After all, a
small delay is acceptable for interactive use.

Does it sound decent?


Regards,

-- 
Nicolas

___
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] [REGRESSION] org-html.el (targets)

2011-02-20 Thread Jambunathan K

I am attaching the bug.org file and the html exports as done by git
versions 048f32 (approx a month old) and 77c278 (very recent).

Put the html file in nxml-mode and do a C-c C-n to check for validation
errors.

Click on the associated links in the html browser and you would notice
that there is a regression.

I don't haven't tried git bisection. I hope someone fixes these
regressions  malformed htmls.

Jambunathan K.

#+TITLE: Testfile for OpenDocumentText Exporter
#+AUTHOR:Jambunathan K
#+EMAIL: kjambunat...@gmail.com
#+DATE:  2010-10-26 Sat
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t  \n:nil @:t ::t |:t ^:t -:t f:t *:t :t
#+OPTIONS:   LaTeX:dvipng
#+STARTUP:   inlineimages showall

* Links
** Targets
*** Fuzzy Target
*** Target with CUSTOMID
:PROPERTIES:
:CUSTOM_ID: aabbccddeeff
:END:

*** Dedicated Target Style1
#   Dedicated Target

*** Dedicated Target Style2

There is a dedicated target at the end of this sentence -
Dedicated Target1.

*** Radioed Target

** References
*** References to Fuzzy Target

This is a link to [[Fuzzy Target]].

*** References to CUSTOMID links

This is a link to [[#aabbccddeeff][Target with CUSTOMID]]. This is nodesc 
link to [[#aabbccddeeff]].

*** References to Dedicated Target

There is a link to nodesc [[Dedicated Target]] here. There is a link
to [[Dedicated%20Target][Jump to Dedicated Target]] here.

There is a link to [[Dedicated%20Target1][Dedicated Target1]] here.

*** References to Radioed Links

This section has references to Radioed Target. One more reference
to Radioed Target.

* Tables
** A simple Orgmode Table
   
   | EST | New York | -5:00 |
   | IST | Madras   | +5:30 |
   | AST | Bahrain  | +3:00 |

** A formatted Orgmode Table

#+CAPTION: An Example Table
#+LABEL:   table:10

  | Labels | Column1| Column2   |  Column3 |
  |++---+--|
  |  / |   |  ||
  |r | l| c   |  r |
  | Row1Row1Row1 Right | R1C1  Left | R1C2R1C2R1C2 Centered |  R1C3  Right |
  |++---+--|
  |   Row2Row2 | R2C1R2C1   | R2C2R2C2  | R2C3R2C3R2C3R2C3 |
  |||   |  |
  |++---+--|

   
** Table.el Table with no Spanning
   +---+---+
   |Term   |Percentage |
   +---+---+
   |Quarter|25%|
   |One-Fourth |   |
   +---+---+
   |Half   |50%|
   |One-by-Two |   |
   +---+---+
   |Three-Quarters |75%|
   |Three-Fourths  |   |
   +---+---+
   |Full   |100%   |
   |Whole  |   |
   +---+---+
   
** COMMENT Table.el Table with Spanning

   +--+-+--+
   |Name  |cmdcalls |Percentage|
   +--+ +--+
   |rgb   |93 534   |46%   |
   +--+ +--+
   |Xah   |82 090   |40%   |
   +--+ +--+
   |total |203118   |100%  |
   +--+-+--+
   
** COMMENT Another Table.el Table with Spanning
   
   +--+--+
   | Header 1 | Header 2 |
   +--+--+
   | R1 C1-2 |
   +--+--+
   | R2 C1| R2-3 C2  |
   +  +--+
   |  |  |
   +--+--+
   
* Table Referenced

  Please refer to \ref{table:10} for further information.

Title: Testfile for OpenDocumentText Exporter







Testfile for OpenDocumentText Exporter



Table of Contents


1 Links 

1.1 Targets 

1.1.1 Fuzzy Target 
1.1.2 Target with CUSTOMID 
1.1.3 Dedicated Target Style1 
1.1.4 Dedicated Target Style2 
1.1.5 Radioed Target 


1.2 References 

1.2.1 References to Fuzzy Target 
1.2.2 References to CUSTOMID links 
1.2.3 References to Dedicated Target 
1.2.4 References to Radioed Links 



2 Tables 

2.1 A simple Orgmode Table 
2.2 A formatted Orgmode Table 
2.3 Table.el Table with no Spanning 


3 Table Referenced 





1 Links 






1.1 Targets 






1.1.1 Fuzzy Target 







1.1.2 Target with CUSTOMID 








1.1.3 Dedicated Target Style1 








1.1.4 Dedicated Target Style2 




There is a dedicated target at the end of this sentence -
Dedicated Target1 .






1.1.5 Radioed Target  









1.2 References 






1.2.1 References to Fuzzy Target 




This is a link to Fuzzy Target.






1.2.2 

[Orgmode] Re: indentation for section headings vs bulleted lists

2011-02-20 Thread Linus Arver
On Sun, Feb 20, 2011 at 01:19:43PM +0100, Nicolas wrote:
 Firstly, org-indent-mode only works by sections. That means the whole
 section gets the same indent prefix, whatever can be inside. Thus, lists
 cannot be treated differently for now.

While I am not technically knowledgeable with org-mode's internals, it
surprises me that lists and section headings are treated differently for
org-indent-mode. I guess I won't be able to use lists for a while...
(I suppose the other option is to use real indentation, manually, to
break up a long list line into smaller chunks, but that solution to me
is just ugly and hacky. It would be great to get uniform behavior for
both sections as well as lists.)

 Secondly, org-indent-mode is not indenting anything: it only fakes it.
 While this is fine for headings, this causes problems with lists, which
 are depending on real indentation.

I did not know that lists were dependant on real indentation. Now I
know.

 Anyway, I'm on it. I'll post a patch as soon as I find and implement a
 decent way to solve this.
 
 
 Regards,
 
 -- 
 Nicolas

Thanks for taking up the challenge, Nicolas!

-Linus

___
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] Symbol's function definition is void: org-datetree-find-year-create / autoload org-datetree library?

2011-02-20 Thread Urs Rau (UK)
On latest git version release_7.4-419-g68114f, [Org-mode version 7.4 
(release_7.4.419.g68114f)] , I am trying to archive to a date-tree and get the 
error: 

Symbol's function definition is void: org-datetree-find-year-create

I found that if I '(load org-datetree.el)' in the scratch buffer, it then 
succeeds. 

Does org-datetree not get auto-loaded?

Also I have searched the *.el files to find the definition of 
org-datetree-find-year-create and found inconsistent use of the 
keep-restriction check, sometimes it is all lower case, sometimes it is all 
uppercase, I guess lisp is not case sensitive?

$ find ./ -type f -exec grep -i keep-restriction {} /dev/null \; 
./lisp/org-agenda.el: (date optional keep-restriction))
./lisp/org-capture.el:(DATE optional KEEP-RESTRICTION))
./lisp/org-datetree.el:(defun org-datetree-find-date-create (date optional 
keep-restriction)
./lisp/org-datetree.el:If KEEP-RESTRICTION is non-nil, do not widen the buffer.
./lisp/org-datetree.el:(or keep-restriction (widen))

Regards,

-- 
Urs Rau


___
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: [babel] Suggestions: GRASS GIS und Lilypond

2011-02-20 Thread Shelagh Manton
On Thu, 17 Feb 2011 18:40:23 +, Martyn Jago wrote:

 Hi
 
 I would be interested in a solution to lilypond within org, and would be
 happy to fork on github and help out (I currently have some time too).
 
 Martyn

Ok Martyn,

I've put what I have done in a git repo on github.

g...@github.com:sshelagh/ob-lilypond.git

Things that need looking into.

The paths that are being generated so that the results block can find the 
images.

The lilypond commands that tell it to make a snippet picture. I started 
looking into this as it seems to have changed since I last used lilypond 
this way. I researched the switches but never actually tested them. -D 
preview.

I wonder how the changing syntax of lilypond can be dealt with? Will we 
need to test for lilypond versions? 

Best wishes

Shelagh


 
 Shelagh Manton shelagh.man...@gmail.com writes:
 
 On Tue, 15 Feb 2011 10:59:19 +0100, Christian Moe wrote:

 Earlier thread on Lilypond:
 http://comments.gmane.org/gmane.emacs.orgmode/31324
 
 
 I did end up doing some work on this. I got it to the stage of creating
 the lilypond images but having some difficulties with paths etc. ie the
 file exists but not where org-babel expects to find it. So it does not
 show up in the file in a results block.

 I've been so busy, I have not visited this problem at all recently.
 Perhaps if someone is interested to help we could work on this
 together. I could put it on github. Let me know.

 Shelagh

 CM
 
 On 2/15/11 2:02 AM, Thorsten wrote:
 Hello Babel developers,
 just two suggestions for new languages: 1. GRASS GIS As far as I know
 there is no grass-mode in emacs, but some expert people are
 successful running grass processes together with R processes in ESS.
 Since GRASS and R are natural allies, it would be great to use the
 GRASS engine in an org-file to retrieve spatial data and then analyse
 the data with R in the same file - would make Org a kind of
 emacs-grassmode replacement.
 2. Lilypond
 A nice to have for all the music lovers in the org community. Regards
 Thorsten


 ___ 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



 ___ 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



___
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: [babel] Suggestions: GRASS GIS und Lilypond

2011-02-20 Thread Shelagh Manton
On Sun, 20 Feb 2011 20:37:19 +, Shelagh Manton wrote:

 On Thu, 17 Feb 2011 18:40:23 +, Martyn Jago wrote:
 
 Hi
 
 I would be interested in a solution to lilypond within org, and would
 be happy to fork on github and help out (I currently have some time
 too).
 
 Martyn
 
 Ok Martyn,
 
 I've put what I have done in a git repo on github.
 
 g...@github.com:sshelagh/ob-lilypond.git
 
 Things that need looking into.
 
 The paths that are being generated so that the results block can find
 the images.
 
 The lilypond commands that tell it to make a snippet picture. I
 started looking into this as it seems to have changed since I last used
 lilypond this way. I researched the switches but never actually tested
 them. -D preview.
 
 I wonder how the changing syntax of lilypond can be dealt with? Will we
 need to test for lilypond versions?
 
 Best wishes
 
 Shelagh
 
 
 
 Shelagh Manton shelagh.man...@gmail.com writes:
 
 On Tue, 15 Feb 2011 10:59:19 +0100, Christian Moe wrote:

 Earlier thread on Lilypond:
 http://comments.gmane.org/gmane.emacs.orgmode/31324
 
 

Oops! I think this is the write access address. The following is the non-
write access address.

git://github.com/sshelagh/ob-lilypond.git

Shelagh
[snip]


___
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: Context-sensitive word count in org mode (elisp)

2011-02-20 Thread Paul Sexton
Bastien bastien.guerry at wikimedia.fr writes:
 #+begin_src emacs-lisp
   (when (looking-at org-bracket-link-analytic-regexp)
 (match-string-no-properties 5))
 #+end_src emacs-lisp

Thanks. Here is version 3 if the function, which is now able to count 
words in link descriptions.

The code to advance to the next word has been moved to the end of the 
loop, which improves accuracy.

Paul

--

(defun org-word-count (beg end
   optional count-latex-macro-args?
   count-footnotes?)
  Report the number of words in the Org mode buffer or selected region.
Ignores:
- comments
- tables
- source code blocks (#+BEGIN_SRC ... #+END_SRC, and inline blocks)
- hyperlinks (but does count words in hyperlink descriptions)
- tags, priorities, and TODO keywords in headers
- sections tagged as 'not for export'.

The text of footnote definitions is ignored, unless the optional argument
COUNT-FOOTNOTES? is non-nil.

If the optional argument COUNT-LATEX-MACRO-ARGS? is non-nil, the word count
includes LaTeX macro arguments (the material between {curly braces}).
Otherwise, and by default, every LaTeX macro counts as 1 word regardless
of its arguments.
  (interactive r)
  (unless mark-active
(setf beg (point-min)
  end (point-max)))
  (let ((wc 0)
(latex-macro-regexp [A-Za-z]+\\(\\[[^]]*\\]\\|\\){\\([^}]*\\)}))
(save-excursion
  (goto-char beg)
  (while ( (point) end)
(cond
 ;; Ignore comments.
 ((or (org-in-commented-line) (org-at-table-p))
  nil)
 ;; Ignore hyperlinks. But if link has a description, count
 ;; the words within the description.
 ((looking-at org-bracket-link-analytic-regexp)
  (when (match-string-no-properties 5)
(let ((desc (match-string-no-properties 5)))
  (save-match-data 
(incf wc (length (remove  (org-split-string
 desc \\W)))
  (goto-char (match-end 0)))
 ((looking-at org-any-link-re)
  (goto-char (match-end 0)))
 ;; Ignore source code blocks.
 ((org-in-regexps-block-p ^#\\+BEGIN_SRC\\W ^#\\+END_SRC\\W)
  nil)
 ;; Ignore inline source blocks, counting them as 1 word.
 ((save-excursion
(backward-char)
(looking-at org-babel-inline-src-block-regexp))
  (goto-char (match-end 0))
  (setf wc (+ 2 wc)))
 ;; Count latex macros as 1 word, ignoring their arguments.
 ((save-excursion
(backward-char)
(looking-at latex-macro-regexp))
  (goto-char (if count-latex-macro-args?
 (match-beginning 2)
   (match-end 0)))
  (setf wc (+ 2 wc)))
 ;; Ignore footnotes.
 ((and (not count-footnotes?)
   (or (org-footnote-at-definition-p)
   (org-footnote-at-reference-p)))
  nil)
 (t
  (let ((contexts (org-context)))
(cond
 ;; Ignore tags and TODO keywords, etc.
 ((or (assoc :todo-keyword contexts)
  (assoc :priority contexts)
  (assoc :keyword contexts)
  (assoc :checkbox contexts))
  nil)
 ;; Ignore sections marked with tags that are
 ;; excluded from export.
 ((assoc :tags contexts)
  (if (intersection (org-get-tags-at) org-export-exclude-tags
:test 'equal)
  (org-forward-same-level 1)
nil))
 (t
  (incf wc))
(re-search-forward \\w+\\W*)))
(message (format %d words in %s. wc
 (if mark-active region buffer)





___
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] source code and parameters

2011-02-20 Thread Andreas Leha
Hi all experts,

When working with source code in org mode I like to keep the parameters
in org-tables.  Especially since I have code in different languages that
should share the same set of parameters.

Problem is: When I tangle my source code blocks the tangled files loose
the parameters.

How do I deel best with parameters and source code blocks?

Regards,
Andreas

attachment: andreas_leha.vcf

smime.p7s
Description: S/MIME Cryptographic Signature
___
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] Two questions about using a =#+begin_src emacs-lisp= block

2011-02-20 Thread Chris Malone
Hi,

First off, my =org-mode= is up-to-date - just did a =git pull  make clean
 make=.  Needless to say, the following were an issue before then...

* Question 1:
Is there a way to force, upon export, an =emacs-lisp= session to be run
within the current buffer?  For instance, the following code

===
#+begin_src emacs-lisp :exports
both
 (buffer-file-name)

#+end_src
===

exports to LaTeX as

===
\begin{verbatim}

(buffer-file-name)

\end{verbatim}




===

In other words, as far as I can tell, the code is passed to the interpreter,
which does not know about the current buffer information, and therefore the
result of the =emacs-lisp= code is an empty string.  By contrast, if I use
=C-c C-c= to evaluate the code block, then I get the proper result printed
in the =.org= buffer:

===
#+results:

: /home/cmalone/org_tests/python_class_lstings.org
===

Ultimately, I'd like to, upon export, have a =emacs-lisp= code block that
does a regexp search on the file and returns a list of matches, which can
then be placed in a =latex= code block.  This sort of action suffers from
the same issue as the =(buffer-file-name)= code - in essence this is a
minimal (non)working example.

* Question 2:
Why does the following code, upon export, ask if I want to evaluate the
=emacs-lisp= code *TWICE* and then give a /Invalid read syntax: #/ error
in the message window?:

===
#+begin_src emacs-lisp :exports
both
 (buffer-file-name)

#+end_src



#+begin_src sh :exports
both
  ls
-l
#+end_src
===

Note that this works fine as long as the =:exports= tag for the =emacs-lisp=
code block is *NOT* =both= or =results=.  Also note that the value of the
=:exports= tag on the =sh= code block is irelevant for this error to
appear.  Also, it doesn't have to be this particular combination of
=emacs-lisp= and =sh= blocks; for instance it fails with an =emacs-lisp= and
a =python= source block.

Is this a bug?

Chris
___
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] [babel] Including TikZ diagrams as figures in export

2011-02-20 Thread Jeffrey Horn
Hey orgsters,

I'm having a hard time fitting TikZ into my workflow. I spent a little time 
learning TikZ recently and have all the diagrams working in a tex file.

Now, I'd like to integrate them into an org document. I'd like:
1) To use babel to handle the TikZ source
2) To wrap the resulting drawing in a figure environment for automatic 
numbering and centering
3) To be able to refer to the figure elsewhere in the document
4) (optional) To be able to seamlessly export to both LaTeX and HTML

I don't really care about 4 right now, but the others are frustrating me a bit. 
I expected this would do what I wanted:

#+caption: This is a figure.
#+label: fig:ref
#+begin_src latex
TikZ source goes here
#+end_src 

No dice. I get all sorts of unresolved references, no figures, no centering. 
I'm guess the exporter doesn't know how to integrate TikZ graphics with the 
#+caption and #+label options. I could create a separate file for holding my 
diagrams and use babel to spit them out as files, or just use LaTeX and forget 
about org, but I'd rather not.

So I googled around, thought I had an answer, then tried this:

#+source: a-name
#+begin_src latex
TikZ source goes here
#+end_src 

#+caption: This is a figure.
#+label: fig:ref
#+begin_src emacs-lisp :var path=a-name :results latex 
(format input{%s} path) #+end_src 




I'm not getting what I expect. What do I need to do differently?

And somewhat unrelated, is :results now deprecated in favor of :exports? 
What about :file? I'm sufficiently new to babel that these all seem like they 
could be taken care of with a single header argument with many options...

Thanks for the help!

-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

Sent with Sparrow


___
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: [PATCH] indentation for section headings vs bulleted lists

2011-02-20 Thread Nicolas
Hello,

Here is an attempt to solve the problem at hand.

Linus, would you mind testing it and reporting back?

From 77aad13b9a322032763148b17dd9cb3073bdbf23 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou n.goaz...@gmail.com
Date: Sun, 20 Feb 2011 13:44:00 +0100
Subject: [PATCH] Integrate lists with org-indent-mode and visual-line-mode

* lisp/org-list.el (org-list-insert-item): keep prefix properties when
  inserting a new item.
  (org-list-struct-apply-struct): keep prefix properties when
  modifying an item.
* lisp/org-indent.el (org-indent-mode): promoting and demoting should
  refresh subtree.
  (org-indent-add-properties): Add lists support. Refactor and comment
  code.
  (org-indent-refresh-subtree): No need to remove properties before
  refreshing. Also, make sure beg is at beginning of line.
  (org-indent-refresh-to, org-indent-refresh-section): Refactor. No
  need to remove properties before refreshing either.
---
 lisp/org-indent.el |  132 ++-
 lisp/org-list.el   |   18 ++-
 2 files changed, 73 insertions(+), 77 deletions(-)

diff --git a/lisp/org-indent.el b/lisp/org-indent.el
index a177a6f..4411cd2 100644
--- a/lisp/org-indent.el
+++ b/lisp/org-indent.el
@@ -39,6 +39,7 @@
   (require 'cl))
 
 (defvar org-inlinetask-min-level)
+(declare-function org-in-item-p org-list ())
 (declare-function org-inlinetask-get-task-level org-inlinetask ())
 (declare-function org-inlinetask-in-task-p org-inlinetask ())
 
@@ -161,13 +162,12 @@ FIXME:  How to update when broken?
 (add-to-list 'buffer-substring-filters
 		 'org-indent-remove-properties-from-string)
 (org-add-hook 'org-after-demote-entry-hook
-		  'org-indent-refresh-section nil 'local)
+		  'org-indent-refresh-subtree nil 'local)
 (org-add-hook 'org-after-promote-entry-hook
-		  'org-indent-refresh-section nil 'local)
+		  'org-indent-refresh-subtree nil 'local)
 (org-add-hook 'org-font-lock-hook
 		  'org-indent-refresh-to nil 'local)
-(and font-lock-mode (org-restart-font-lock))
-)
+(and font-lock-mode (org-restart-font-lock)))
(t
 ;; mode was turned off (or we refused to turn it on)
 (save-excursion
@@ -181,9 +181,9 @@ FIXME:  How to update when broken?
 	  (delq 'org-indent-remove-properties-from-string
 		buffer-substring-filters))
 	(remove-hook 'org-after-promote-entry-hook
-		 'org-indent-refresh-section 'local)
+		 'org-indent-refresh-subtree 'local)
 	(remove-hook 'org-after-demote-entry-hook
-		 'org-indent-refresh-section 'local)
+		 'org-indent-refresh-subtree 'local)
 	(and font-lock-mode (org-restart-font-lock))
 	(redraw-display))
 
@@ -222,82 +222,66 @@ useful to make it ever so slightly different.
 
 (defun org-indent-add-properties (beg end)
   Add indentation properties between BEG and END.
-Assumes that BEG is at the beginning of a line.
+Assume BEG is at an headline, inline task, or at beginning of buffer.
   (let* ((inhibit-modification-hooks t)
 	 (inlinetaskp (featurep 'org-inlinetask))
-	 (get-real-level (lambda (pos lvl)
-			   (save-excursion
-			 (goto-char pos)
-			 (if (and inlinetaskp (org-inlinetask-in-task-p))
- (org-inlinetask-get-task-level)
-			   lvl
-	 (b beg)
-	 (e end)
-	 (level 0)
-	 (n 0)
-	 exit nstars)
+	 (m end))
 (with-silent-modifications
+  ;; 1. Starting from END, move to each headline and inline task,
+  ;;and set prefixes point and the headline/inline task below
+  ;;(saved in M). `line-prefix' property is only set on inner
+  ;;part of that area, not on headlines.
   (save-excursion
+	(goto-char end)
+	(while (re-search-backward org-indent-outline-re beg 'move)
+	  (let ((pf (aref org-indent-strings
+			  (if (and inlinetaskp (org-inlinetask-at-task-p))
+			  (1+ (org-inlinetask-get-task-level))
+			(1+ (org-current-level))
+	(add-text-properties (point) m `(wrap-prefix ,pf))
+	(add-text-properties (point-at-eol) m `(line-prefix ,pf))
+	(setq m (point
+	;; Special case for area before first headline.
+	(when (bobp)
+	  (add-text-properties (point) m '(wrap-prefix nil line-prefix nil)))
+	;; 2. Set `wrap-prefix' in lists between BEG and END. For each
+	;;item, length of prefix is the sum of length of
+	;;`line-prefix', indentation and size of bullet.
 	(goto-char beg)
-	(while (not exit)
-	  (setq e end)
-	  (if (not (re-search-forward org-indent-outline-re nil t))
-	  (setq e (point-max) exit t)
-	(setq e (match-beginning 0))
-	(if (= e end) (setq exit t))
-	(unless (and inlinetaskp (org-inlinetask-in-task-p))
-	  (setq level (- (match-end 0) (match-beginning 0) 1)))
-	(setq nstars (* (1- (funcall get-real-level e level))
-			(1- org-indent-indentation-per-level)))
-	(add-text-properties
-	 (point-at-bol) (point-at-eol)
-	 (list 'line-prefix
-		   (aref org-indent-stars nstars)
-		   'wrap-prefix
-		   (aref org-indent-strings
-			 (* (funcall 

[Orgmode] Re: ePub and Org mode

2011-02-20 Thread Richard Lawrence
Eric Schulte schulte.e...@gmail.com writes:

 The only thing missing is a function to export all (not excluded)
 subtrees one by one and honor the properties slapped onto each subtree.


 `org-map-entries' should satisfy this need. -- Eric

I have been doing something similar with LaTeX export.  Here is my
(pretty hacky) code; it should be easy to adapt to HTML export.  It
does the following:

1) export each subtree of the current tree as a separate PDF (there's
some validation here, to make sure each of these trees has properties
that I need to produce the output I want)

2) concatenates the resulting PDFs into a single PDF for printing (this
requires the pdftk package)

Good luck!

Richard


(defun org-export-individual-pdfs-and-concat ()
  (interactive)
  (setq export-files nil
pdf-files nil
; point must be in main tree to be exported (not a subtree)
concat-pdf-name (get-property-or-fail (point) CONCATENATED_PDF_NAME))
  (progn
(org-map-entries
 (lambda ()
   (setq org-map-continue-from (outline-next-heading))
   (org-mark-subtree)
   ; org-map-entries positions point at the beginning of each subtree
   (let ((org-trust-scanner-tags t))
 (push (get-property-or-fail (point) EXPORT_FILE_NAME) export-files))
   (org-export-as-pdf nil))
 nil 'tree)
(concat-pdfs (nreverse (mapcar 'tex-name-to-pdf-name export-files))
 concat-pdf-name)))

(defun get-property-or-fail (pom property)
  (or
   ; probably some opportunity for optimization here...see function
   ; documentation for org-map-entries
   (org-entry-get pom property)
   (error (format Entry at %s does not define property %s 
(org-heading-components) property

(defun tex-name-to-pdf-name (filename)
  (concat (file-name-sans-extension filename) .pdf))

(defun concat-pdfs (in-files out-file)
  (shell-command
   (format pdftk %s cat output %s
   (mapconcat (lambda (s) s) in-files  ) ; join pdf names with spaces
   out-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] [babel] Including TikZ diagrams as figures in export

2011-02-20 Thread Erik Iverson

Jeffrey,


Now, I'd like to integrate them into an org document. I'd like:
1) To use babel to handle the TikZ source


This is possible.


2) To wrap the resulting drawing in a figure environment for automatic 
numbering and centering


See http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html and 
search for tikz for an example.  I think you do need to use the :file argument

for this to have org-mode take care of it automatically.

Alternatively, you could just include *all* the latex you want, including
constructing your own figure environment and caption and refs, in the latex
code block.


3) To be able to refer to the figure elsewhere in the document


Should be possible with either approach above.


4) (optional) To be able to seamlessly export to both LaTeX and HTML


So should the HTML exporter generate a PNG file then, as opposed to PDF?
This is possible, but requires some 'conditional' elisp code in your :file
source block argument.  I think I can help if that's indeed what you want.


And somewhat unrelated, is :results now deprecated in favor of :exports? What about 
:file? I'm sufficiently new to babel that these all seem like they could be taken care of with a 
single header argument with many options...


Not deprecated at all according to my understanding:

:results determines how the results are collected from a process. So, in R, we
might want the standard output ':results output' or we might just want the last
value returned by the code block, ':results value'.  This determines what is
inserted into the org-mode buffer or the export stream when the code block
is evaluated.

:exports determines if the code and/or the results will be inserted upon
exporting. *If* the results are inserted, then :results will determine how.

:file is useful for code blocks that generate graphical output, such as tikz.
This will divert the output into the named file, and exporting will insert
that file.  In the org-mode buffer, a link will be inserted. If a png file is
generated, it can even be displayed inline in the org-mode buffer if you turn
on that functionality.


___
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] [babel] some lisp/slime progress

2011-02-20 Thread Erik Iverson

Hello,

I recently posted on the inability of ob-lisp.el to
submit multiple forms to a running CL session and return
the result.

http://permalink.gmane.org/gmane.emacs.orgmode/37325

I have made some progress in fixing this, but it *required
defining a new function in SLIME, so I do not post this
as a patch to org-mode, since it depends on more than
org-mode*.  I don't know if this is something that truly
belongs in SLIME, so I may follow-up on that mailing list.

NB: this only works when :session is specified.

In SLIME swank.lisp, I define:

(defslimefun interactive-eval-region-orgmode (string)
  (with-buffer-syntax ()
(with-retry-restart (:msg Retry SLIME interactive evaluation request.)
  (list (format nil ~{~S~^~%~} (eval-region string))


Then, in ob-lisp.el, apply the following patch.

diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
index 600b79e..2980cc8 100644
--- a/lisp/ob-lisp.el
+++ b/lisp/ob-lisp.el
@@ -78,7 +78,11 @@ This function is called by `org-babel-execute-src-block'
  (if session
  ;; session evaluation
  (save-window-excursion
-   (cadr (slime-eval `(swank:eval-and-grab-output ,full-body
+  (with-temp-buffer
+(insert full-body)
+(slime-eval
+ `(swank:interactive-eval-region-orgmode
+   ,(buffer-substring-no-properties (point-min) (point-max))
;; external evaluation
(let ((script-file (org-babel-temp-file lisp-script-)))
  (with-temp-file script-file

Then, things like the following work, where I assume you've already
started M-x slime.

#+begin_src emacs-lisp :session

(defvar test1 test1 value)
(defvar test2 test2 value)
test2

#+end_src

#+results:
: test2 value


Best Regards,
--Erik Iverson

___
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] [babel] some lisp/slime progress

2011-02-20 Thread Erik Iverson



Then, things like the following work, where I assume you've already
started M-x slime.

#+begin_src emacs-lisp :session

(defvar test1 test1 value)
(defvar test2 test2 value)
test2

#+end_src

#+results:
: test2 value


Er, not emacs-lisp, just lisp... like the following

#+begin_src lisp :session

(defvar test1 test1 value)
(defvar test2 test2 value)
test2

#+end_src

#+results:
: test2 value

___
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] TOC

2011-02-20 Thread Myriam Abramson

Hello,

I've only started with orgmode recently. When exporting to HTML, how
do I suppress the table of content? 

TIA
-- 
   myriam


___
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] TOC

2011-02-20 Thread Alan L Tyree
On Sun, 20 Feb 2011 21:32:26 -0500
Myriam Abramson mabram...@gmail.com wrote:

 
 Hello,
 
 I've only started with orgmode recently. When exporting to HTML, how
 do I suppress the table of content? 

See the Manual under Exporting; Export Options for full details.

In the OPTIONS line, set toc:nil.

Cheers,
Alan

 
 TIA
 -- 
myriam
 
 
 ___
 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
 


-- 
Alan L Tyreehttp://www2.austlii.edu.au/~alan
Tel:  04 2748 6206


___
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