Re: [O] source block variable expansion

2012-01-12 Thread Sebastien Vauban
Hi Rick,

Rick Frankel wrote:
 Since org-mode v7.8, editing a code block in an indirect buffer causes
 any referenced code blocks to be executed. While this behavior is
 desired for viewing code in an indirect buffer (as the behavior has
 always been) it is not for editing (esp. if the named block takes a
 long time to run).

 Given a referenced source block:

 #+name: var
 #+begin_src elisp
   you shouldn't see this in the mini-buffer
 #+end_src

 When editing the followiing code block (via =C-c '=), the above block
 (=var=) will be executed. The message =executing Elisp code block
 (var)...= will appear in the =*Message*= buffer and the message above
 will appear in the mini-buffer.

 #+name: edit-test(var=var)
 #+begin_src perl
   $var;
 #+end_src

Just FYI, note that this variable assignment is/shoud be deprecated: you have
to use:

  #+name: edit-test
  #+headers: :var var=var
  #+begin_src perl
$var;
  #+end_src

or

  #+name: edit-test
  #+begin_src perl :var var=var
$var;
  #+end_src

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Org-edit-special and C-x C-s strange behavior

2012-01-12 Thread Eric S Fraga
Leo Alekseyev dnqu...@gmail.com writes:

 Eric S Fraga e.fr...@ucl.ac.uk writes:

 What version of org are you using?  I ask because I used to experience

 the annoyance you describe a while back; more recently (since at least a
 few months ago), hitting C-x C-s no longer has any negative impact: it
 saves the file, or at least appears to.

 You still have to C-c ' to get back to the full buffer, mind you, but
 that's better, IMO, than changing the behaviour of such a fundamental
 key binding as C-x C-s.

 It appears that this bug is Emacs-version dependent: it functions as
 you describe with 23.2, but the buffer gets buried (with an error
 message basic-save-buffer: Wrong type argument: stringp, nil) in
 24.0.92.  Org mode is the current git HEAD.  I tried to step through
 basic-save-buffer in edebug, but I couldn't catch the error (I'm not
 very experienced with edebug).  Can someone test this on Emacs 24 and
 confirm what I'm seeing?

I am using 24.0.92 and I have no problems at all (just tried right
now).  

One difference, however, could be the window configurations we
use.  Specifically, I have

  (setq org-src-window-setup (quote current-window))
  
in my configuration: the special editing window replaces the current
window entirely.  When I hit C-x C-s, the buffer is saved but nothing
changes (nothing is buried, etc.).  Maybe you have the default
configuration which is to reorganize-frame and maybe that is where the
problem is?

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.106.gc835)



Re: [O] Including source when exporting in PDF

2012-01-12 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/01/12 03:06, Frozenlock wrote:
 To include multiple files, I export all of the required files
 before the PDF creation and zip them. This way, I only need to
 include a single zip file.

Good idea.

 
 #+BEGIN_SRC emacs-lisp :exports none ;; various exports 
 (save-window-excursion (org-export-as-ascii
 org-export-headline-levels)) (save-window-excursion 
 (org-export-as-html org-export-headline-levels))
 
 ;;zip the required files (let ((filename (file-name-sans-extension
 (file-name-nondirectory (buffer-file-name) (shell-command 
 (concat zip  filename .zip  (mapconcat '(lambda (arg) arg) 
 (remove-if '(lambda (filename) (string-match
 \\.$\\|\\.pdf$\\|\\.atfi$\\|# filename)) (directory-files
 (file-name-directory (buffer-file-name   #+END_SRC
 
 (I've added this code in a babel block to evaluate just before the
 PDF export.)

I actually did not want to fiddle with the file names, as it is to
easy to forget some: this concerns in my case literate programming of
a simulation model in R, resul;ting in several files of different
extensions - it is to easy to forget one.

If I tangle, I get all the names of the tangled files, but I do not
know how I can feed them into the zip file.

 
 As you can see, I make sure I don't include a previous PDF, or any 
 other useless file.

True.

 
 If you wish to add only a single type of file, simply replace 
 remove-if by remove-if-not and change the value in the 
 string-match function. For example,
 \\.$\\|\\.pdf$\\|\\.atfi$\\|# would become \\.lisp$ to include
 all your exported lisp files.
 
 Hope this helps!
 
 
 By the way, I can't get the code block to be evaluated
 automatically when I export to PDF, any clue on how to do that?

I assume, it is caused by the :exports none - so no evaluation is done
on export. Try changing it to :exports result and then generate an
empty result, or a list of files included in the zip file.

Cheers,

Rainer


 
 
 
 On Wed, Jan 11, 2012 at 10:28 AM, Rainer M Krug
 r.m.k...@gmail.com wrote: On 06/01/12 08:45, Eric Schulte wrote:
 Frozenlock frozenl...@gmail.com writes:
 
 I am a strong advocate in keeping the source of
 everything.
 
 However, Â a source can easily be lost if it doesn't follow
 the document. In LaTeX, there's a package to attach a file
 to a PDF (like when you attach a file to an email). By
 doing so, the source will follow the PDF even if the common
 reader have no clue what it's for, or even how to use it.
 
 
 This sounds like a great Reproducible Research practice.
 
 
 Here is how I attach my org source to every document I
 export to PDF:
 
 ;; Include the source file for every exported PDF
 (org-mode) (eval-after-load org-exp '(defadvice
 org-export-as-latex (around org-export-add-source-pdf
 activate) Add the source (org file) to the resulting pdf
 file (let ((filename (buffer-name))) ad-do-it ;do the
 function (let ((latex-buffer ad-return-value)) (set-buffer
 latex-buffer) (while (re-search-forward 
 usepackage{.+} nil t)); go to the end of packages
 (insert \n\\usepackage{attachfile2}); the package needed
 to attach files (when (re-search-forward
 end{document} nil t) (forward-line -1) (insert
 (concat \\vfill\n \\footnotesize\n The source of this
 document is an Org-Mode file attached here: 
 \n\\attachfile { filename }))) (save-buffer)
 
 
 This is by no mean a patch, but rather a quick hack.
 Perhaps someone with a working knowledge of the org-export
 could find a way to add a source option?
 
 
 I think this practice may not actually require any changes to
 the Org-mode core. Â The attached small Org-mode file will
 attach itself to pdf exports using only features already
 present in Org-mode.
 
 Following this idea - how can I easily attach all files created by 
 tangling? Is there a programmatic way, without having to specify
 them manually?
 
 Thanks,
 
 Rainer
 
 
 
 
 
 
 
 Thanks for sharing this idea!
 
 
 
 Cheers!
 
 
 
 

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

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEUEARECAAYFAk8Oo7UACgkQoYgNqgF2egpg9wCfTq04zAVki+Oh1g97/C3FERf3
Ej0Al30dF8xQdyHNOmOK8y7ZolA0dzE=
=IUuN
-END PGP SIGNATURE-



Re: [O] Org-edit-special and C-x C-s strange behavior

2012-01-12 Thread Andreas Leha
Eric S Fraga e.fr...@ucl.ac.uk writes:

 Leo Alekseyev dnqu...@gmail.com writes:

 Eric S Fraga e.fr...@ucl.ac.uk writes:

 What version of org are you using?  I ask because I used to experience

 the annoyance you describe a while back; more recently (since at least a
 few months ago), hitting C-x C-s no longer has any negative impact: it
 saves the file, or at least appears to.

 You still have to C-c ' to get back to the full buffer, mind you, but
 that's better, IMO, than changing the behaviour of such a fundamental
 key binding as C-x C-s.

 It appears that this bug is Emacs-version dependent: it functions as
 you describe with 23.2, but the buffer gets buried (with an error
 message basic-save-buffer: Wrong type argument: stringp, nil) in
 24.0.92.  Org mode is the current git HEAD.  I tried to step through
 basic-save-buffer in edebug, but I couldn't catch the error (I'm not
 very experienced with edebug).  Can someone test this on Emacs 24 and
 confirm what I'm seeing?

 I am using 24.0.92 and I have no problems at all (just tried right
 now).  

 One difference, however, could be the window configurations we
 use.  Specifically, I have

   (setq org-src-window-setup (quote current-window))
   
 in my configuration: the special editing window replaces the current
 window entirely.  When I hit C-x C-s, the buffer is saved but nothing
 changes (nothing is buried, etc.).  Maybe you have the default
 configuration which is to reorganize-frame and maybe that is where the
 problem is?

Thanks for this Eric!
I can confirm, that the problem does not occur with this setting here,
too (emacs 24.0.92 as well).




Re: [O] inline src_R also in latex src block

2012-01-12 Thread Michael Bach
Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 yes, that should work.  Try to export the following several times.  The
 first number should not change.
 (note: maybe you'd have to execute the inner_test_cached once on your
 system)

 #+name: inner_test_cached
 #+begin_src R :cache yes :exports none
   rnorm(1)
 #+end_src

 #+results[dbeb7280be41fdc949815808cf601a6d01a400bb]: inner_test_cached
 : 1.12399967834262

 #+name: inner_test_not_cached
 #+begin_src R :exports none
   rnorm(1)
 #+end_src

 #+results: inner_test_not_cached
 : -0.562660468468834
 #+name: test
 #+begin_src latex :noweb yes
   \begin{equation}
 inner_test_cached()
 !=
 inner_test_not_cached()
   \end{equation}
 #+end_src

Thanks for the testing code.  Having R and LaTeX inside org this way is
just pure fun.

Michael



[O] LaTeX export: Keep point position in TeX file

2012-01-12 Thread Michael Bach
Hello everyone,

The way I am now doing LaTeX export is that I have the exported tex
buffer below the org buffer.  When I do an export via `C-c C-e l' the
.tex buffer gets updated, but point jumps to beginning of buffer instead
of staying where it was.  (How) Can I changed that so point stays near
where it was before I exported again?

Best Regards,
Michael





[O] Synctex -- Syncorg?

2012-01-12 Thread Michael Bach
Hello Everyone,

I am interested whether something like synctex search and inverse search
can be cooked up to work with org-mode.  The codename `syncorg' was used
in this conversation [1].  Would this be hard to implement?  Just
curious.

Kind Regards,
Michael

Footnotes:
[1]  http://lists.gnu.org/archive/html/emacs-orgmode/2010-08/msg01253.html



[O] Rsquared for reproductible research

2012-01-12 Thread Stephen Eglen
Following on from an old thread about self-configuring org files for
reproducible research, R users might be interested to see the following web site
which is exactly what I was thinking of for org mode (but of course, works
only for R packages.)

  http://rsquared.stat.uni-muenchen.de/index.rhtml

Stephen





[O] Bug: exporting ical files from read-only buffers [7.8.03 (release_7.8.03.112.g8861)]

2012-01-12 Thread Stephen Eglen
I've found a small bug with exporting ical files from read-only org
buffers.  Create a simple buffer, e.g.:

* test1
  2012-01-12 Thu

and then hit C-x C-q to make the buffer read-only.  Then do C-c C-e i
to export an ical file.  You get an error that the buffer is read-only.

I think this is due to the call to org-refresh-category-properties,
which can't update text proprties.  

My workaround is to do:
(setq inhibit-read-only nil)

so that text properties can be added to read-only buffers.  This could
be done locally within the ical export functions if others thought
sensible, for which I can send a patch if desired.

Stephen





--
Emacs  : GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.5)
 of 2011-08-14 on allspice, modified by Debian
Package: Org-mode version 7.8.03 (release_7.8.03.112.g8861)



Re: [O] LaTeX export: Keep point position in TeX file

2012-01-12 Thread Eric S Fraga
Michael Bach pha...@gmail.com writes:

 Hello everyone,

 The way I am now doing LaTeX export is that I have the exported tex
 buffer below the org buffer.  When I do an export via `C-c C-e l' the
 .tex buffer gets updated, but point jumps to beginning of buffer instead
 of staying where it was.  (How) Can I changed that so point stays near
 where it was before I exported again?

 Best Regards,
 Michael

I think this behaviour arises because the exporter exports to a buffer
which it first empties.  So the behaviour you see is very different from
when Emacs reverts a buffer when the file changes out from under it.

If so, I suggest you could achieve what you want by using the
org-export-* hooks to, for instance, save current position before export
and then jump to that position after export?  Maybe
org-export-first-hook and org-export-latex-final-hook could be used?

Untried and obviously untested!  And likely beyond my elisp capabilities
so I'd be very keen on seeing a solution.  This behaviour has also
bothered me (well, very minor irritation) for a long time as I often
export to latex when debugging the export to PDF.

HTH,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.106.gc835)



Re: [O] Bug: exporting ical files from read-only buffers [7.8.03 (release_7.8.03.112.g8861)]

2012-01-12 Thread Eric S Fraga
Stephen Eglen s.j.eg...@damtp.cam.ac.uk writes:

 I've found a small bug with exporting ical files from read-only org
 buffers.  Create a simple buffer, e.g.:

 * test1
   2012-01-12 Thu

 and then hit C-x C-q to make the buffer read-only.  Then do C-c C-e i
 to export an ical file.  You get an error that the buffer is read-only.

 I think this is due to the call to org-refresh-category-properties,
 which can't update text proprties.  

 My workaround is to do:
 (setq inhibit-read-only nil)

 so that text properties can be added to read-only buffers.  This could
 be done locally within the ical export functions if others thought
 sensible, for which I can send a patch if desired.

Could this be done more generally?  I think I've run into this for other
export targets as well, although it may be my memory that is faulty
here.  I use RCS for version control for standalone files and often have
files read-only from which I want to export.

Thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.106.gc835)



Re: [O] Bug: exporting ical files from read-only buffers [7.8.03 (release_7.8.03.112.g8861)]

2012-01-12 Thread Stephen Eglen
 Could this be done more generally?  I think I've run into this for other
 export targets as well, although it may be my memory that is faulty
 here.  I use RCS for version control for standalone files and often have
 files read-only from which I want to export.

I also use RCS, which is how I got caught out today (trying to set up
Eric's neat guide for gettting org-ical- google calendar; thanks for
that Eric.)  Before sending the bug, I tried exporting to pdf, which
worked fine; what other exporters do you use?

Stephen



Re: [O] Bug: exporting ical files from read-only buffers [7.8.03 (release_7.8.03.112.g8861)]

2012-01-12 Thread Eric S Fraga
Stephen Eglen s.j.eg...@damtp.cam.ac.uk writes:

 Could this be done more generally?  I think I've run into this for other
 export targets as well, although it may be my memory that is faulty
 here.  I use RCS for version control for standalone files and often have
 files read-only from which I want to export.

 I also use RCS, which is how I got caught out today (trying to set up
 Eric's neat guide for gettting org-ical- google calendar; thanks for
 that Eric.)  Before sending the bug, I tried exporting to pdf, which
 worked fine; what other exporters do you use?

 Stephen

Mostly, I export to PDF but also less frequently to HTML, ODT and
ICAL...  I had imagined this to be a generic issue as I could not
imagine that there would be anything special about exporting to ICAL... 
I have just tried a read-only document I have and everything has worked
fine.  Strange.  Definitely faulty (wetware) memory; time for a RAM
upgrade ;-)

Apologies for the noise.

And you're very welcome, by the way!

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.106.gc835)



Re: [O] Org-edit-special and C-x C-s strange behavior

2012-01-12 Thread Leo Alekseyev
On Thu, Jan 12, 2012 at 4:14 AM, Andreas Leha
andreas.l...@med.uni-goettingen.de wrote:
 Eric S Fraga e.fr...@ucl.ac.uk writes:

 Leo Alekseyev dnqu...@gmail.com writes:

 Eric S Fraga e.fr...@ucl.ac.uk writes:

 What version of org are you using?  I ask because I used to experience

 the annoyance you describe a while back; more recently (since at least a
 few months ago), hitting C-x C-s no longer has any negative impact: it
 saves the file, or at least appears to.

 You still have to C-c ' to get back to the full buffer, mind you, but
 that's better, IMO, than changing the behaviour of such a fundamental
 key binding as C-x C-s.

 It appears that this bug is Emacs-version dependent: it functions as
 you describe with 23.2, but the buffer gets buried (with an error
 message basic-save-buffer: Wrong type argument: stringp, nil) in
 24.0.92.  Org mode is the current git HEAD.  I tried to step through
 basic-save-buffer in edebug, but I couldn't catch the error (I'm not
 very experienced with edebug).  Can someone test this on Emacs 24 and
 confirm what I'm seeing?

 I am using 24.0.92 and I have no problems at all (just tried right
 now).

 One difference, however, could be the window configurations we
 use.  Specifically, I have

       (setq org-src-window-setup (quote current-window))

Yes, this works. It's also a more sensible default. However, it
doesn't change the fact that there's a bug, it just switches to a case
where the bug isn't triggered :)



Re: [O] Including source when exporting in PDF

2012-01-12 Thread Frozenlock
The code block I previously sent only require you to specify which
_extension_ you want or don't want. No need to include any specific
filename (other than the .zip file in the latex include command).

Am I to understand you want something to include *all and only* tangled files?

--

I tried :exports result with no success. I'll try to send a minimum
working example shortly.

On Thu, Jan 12, 2012 at 4:11 AM, Rainer M Krug r.m.k...@gmail.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 12/01/12 03:06, Frozenlock wrote:
 To include multiple files, I export all of the required files
 before the PDF creation and zip them. This way, I only need to
 include a single zip file.

 Good idea.


 #+BEGIN_SRC emacs-lisp :exports none ;; various exports
 (save-window-excursion (org-export-as-ascii
 org-export-headline-levels)) (save-window-excursion
 (org-export-as-html org-export-headline-levels))

 ;;zip the required files (let ((filename (file-name-sans-extension
 (file-name-nondirectory (buffer-file-name) (shell-command
 (concat zip  filename .zip  (mapconcat '(lambda (arg) arg)
 (remove-if '(lambda (filename) (string-match
 \\.$\\|\\.pdf$\\|\\.atfi$\\|# filename)) (directory-files
 (file-name-directory (buffer-file-name   #+END_SRC

 (I've added this code in a babel block to evaluate just before the
 PDF export.)

 I actually did not want to fiddle with the file names, as it is to
 easy to forget some: this concerns in my case literate programming of
 a simulation model in R, resul;ting in several files of different
 extensions - it is to easy to forget one.

 If I tangle, I get all the names of the tangled files, but I do not
 know how I can feed them into the zip file.


 As you can see, I make sure I don't include a previous PDF, or any
 other useless file.

 True.


 If you wish to add only a single type of file, simply replace
 remove-if by remove-if-not and change the value in the
 string-match function. For example,
 \\.$\\|\\.pdf$\\|\\.atfi$\\|# would become \\.lisp$ to include
 all your exported lisp files.

 Hope this helps!


 By the way, I can't get the code block to be evaluated
 automatically when I export to PDF, any clue on how to do that?

 I assume, it is caused by the :exports none - so no evaluation is done
 on export. Try changing it to :exports result and then generate an
 empty result, or a list of files included in the zip file.

 Cheers,

 Rainer





 On Wed, Jan 11, 2012 at 10:28 AM, Rainer M Krug
 r.m.k...@gmail.com wrote: On 06/01/12 08:45, Eric Schulte wrote:
 Frozenlock frozenl...@gmail.com writes:

 I am a strong advocate in keeping the source of
 everything.

 However, Â a source can easily be lost if it doesn't follow
 the document. In LaTeX, there's a package to attach a file
 to a PDF (like when you attach a file to an email). By
 doing so, the source will follow the PDF even if the common
 reader have no clue what it's for, or even how to use it.


 This sounds like a great Reproducible Research practice.


 Here is how I attach my org source to every document I
 export to PDF:

 ;; Include the source file for every exported PDF
 (org-mode) (eval-after-load org-exp '(defadvice
 org-export-as-latex (around org-export-add-source-pdf
 activate) Add the source (org file) to the resulting pdf
 file (let ((filename (buffer-name))) ad-do-it ;do the
 function (let ((latex-buffer ad-return-value)) (set-buffer
 latex-buffer) (while (re-search-forward
 usepackage{.+} nil t)); go to the end of packages
 (insert \n\\usepackage{attachfile2}); the package needed
 to attach files (when (re-search-forward
 end{document} nil t) (forward-line -1) (insert
 (concat \\vfill\n \\footnotesize\n The source of this
 document is an Org-Mode file attached here:
 \n\\attachfile { filename }))) (save-buffer)


 This is by no mean a patch, but rather a quick hack.
 Perhaps someone with a working knowledge of the org-export
 could find a way to add a source option?


 I think this practice may not actually require any changes to
 the Org-mode core. Â The attached small Org-mode file will
 attach itself to pdf exports using only features already
 present in Org-mode.

 Following this idea - how can I easily attach all files created by
 tangling? Is there a programmatic way, without having to specify
 them manually?

 Thanks,

 Rainer







 Thanks for sharing this idea!



 Cheers!





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

 Centre of Excellence for Invasion Biology
 Stellenbosch University
 South Africa

 Tel :       +33 - (0)9 53 10 27 44
 Cell:       +33 - (0)6 85 62 59 98
 Fax :       +33 - (0)9 58 10 27 44

 Fax (D):    +49 - (0)3 21 21 25 22 44

 email:      rai...@krugs.de

 Skype:      RMkrug
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.11 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEUEARECAAYFAk8Oo7UACgkQoYgNqgF2egpg9wCfTq04zAVki+Oh1g97/C3FERf3

Re: [O] Including source when exporting in PDF

2012-01-12 Thread Rainer M Krug
On 12 January 2012 14:54, Frozenlock frozenl...@gmail.com wrote:
 The code block I previously sent only require you to specify which
 _extension_ you want or don't want. No need to include any specific
 filename (other than the .zip file in the latex include command).

 Am I to understand you want something to include *all and only* tangled files?

Yes - and the files do have different extensions (e.g. .R, .sh, .sub,
none) and are not tangled necessarily in a specific directory.

and the original org file, but that is not a problem.

Rainer


 --

 I tried :exports result with no success. I'll try to send a minimum
 working example shortly.

 On Thu, Jan 12, 2012 at 4:11 AM, Rainer M Krug r.m.k...@gmail.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 12/01/12 03:06, Frozenlock wrote:
 To include multiple files, I export all of the required files
 before the PDF creation and zip them. This way, I only need to
 include a single zip file.

 Good idea.


 #+BEGIN_SRC emacs-lisp :exports none ;; various exports
 (save-window-excursion (org-export-as-ascii
 org-export-headline-levels)) (save-window-excursion
 (org-export-as-html org-export-headline-levels))

 ;;zip the required files (let ((filename (file-name-sans-extension
 (file-name-nondirectory (buffer-file-name) (shell-command
 (concat zip  filename .zip  (mapconcat '(lambda (arg) arg)
 (remove-if '(lambda (filename) (string-match
 \\.$\\|\\.pdf$\\|\\.atfi$\\|# filename)) (directory-files
 (file-name-directory (buffer-file-name   #+END_SRC

 (I've added this code in a babel block to evaluate just before the
 PDF export.)

 I actually did not want to fiddle with the file names, as it is to
 easy to forget some: this concerns in my case literate programming of
 a simulation model in R, resul;ting in several files of different
 extensions - it is to easy to forget one.

 If I tangle, I get all the names of the tangled files, but I do not
 know how I can feed them into the zip file.


 As you can see, I make sure I don't include a previous PDF, or any
 other useless file.

 True.


 If you wish to add only a single type of file, simply replace
 remove-if by remove-if-not and change the value in the
 string-match function. For example,
 \\.$\\|\\.pdf$\\|\\.atfi$\\|# would become \\.lisp$ to include
 all your exported lisp files.

 Hope this helps!


 By the way, I can't get the code block to be evaluated
 automatically when I export to PDF, any clue on how to do that?

 I assume, it is caused by the :exports none - so no evaluation is done
 on export. Try changing it to :exports result and then generate an
 empty result, or a list of files included in the zip file.

 Cheers,

 Rainer





 On Wed, Jan 11, 2012 at 10:28 AM, Rainer M Krug
 r.m.k...@gmail.com wrote: On 06/01/12 08:45, Eric Schulte wrote:
 Frozenlock frozenl...@gmail.com writes:

 I am a strong advocate in keeping the source of
 everything.

 However, Â a source can easily be lost if it doesn't follow
 the document. In LaTeX, there's a package to attach a file
 to a PDF (like when you attach a file to an email). By
 doing so, the source will follow the PDF even if the common
 reader have no clue what it's for, or even how to use it.


 This sounds like a great Reproducible Research practice.


 Here is how I attach my org source to every document I
 export to PDF:

 ;; Include the source file for every exported PDF
 (org-mode) (eval-after-load org-exp '(defadvice
 org-export-as-latex (around org-export-add-source-pdf
 activate) Add the source (org file) to the resulting pdf
 file (let ((filename (buffer-name))) ad-do-it ;do the
 function (let ((latex-buffer ad-return-value)) (set-buffer
 latex-buffer) (while (re-search-forward
 usepackage{.+} nil t)); go to the end of packages
 (insert \n\\usepackage{attachfile2}); the package needed
 to attach files (when (re-search-forward
 end{document} nil t) (forward-line -1) (insert
 (concat \\vfill\n \\footnotesize\n The source of this
 document is an Org-Mode file attached here:
 \n\\attachfile { filename }))) (save-buffer)


 This is by no mean a patch, but rather a quick hack.
 Perhaps someone with a working knowledge of the org-export
 could find a way to add a source option?


 I think this practice may not actually require any changes to
 the Org-mode core. Â The attached small Org-mode file will
 attach itself to pdf exports using only features already
 present in Org-mode.

 Following this idea - how can I easily attach all files created by
 tangling? Is there a programmatic way, without having to specify
 them manually?

 Thanks,

 Rainer







 Thanks for sharing this idea!



 Cheers!





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

 Centre of Excellence for Invasion Biology
 Stellenbosch University
 South Africa

 Tel :       +33 - (0)9 53 10 27 44
 Cell:       +33 - (0)6 85 62 59 98
 Fax :       +33 - (0)9 58 10 27 44

 Fax (D):    +49 

[O] BUG: C-c C-c no longer renumbers ordered lists

2012-01-12 Thread Anthony Lander
Hi list,

It seems that C-c C-c no longer renumbers ordered lists (today's git pull). I'm 
not sure when this behaviour disappeared, but it is still referenced in the 
manual[1], so I assume it is a bug. I apologize that I don't have time to 
narrow down which commit introduced the change.

  -Anthony

[1] http://www.gnu.org/software/emacs/manual/html_node/org/Plain-lists.html





Re: [O] Rsquared for reproductible research

2012-01-12 Thread brian powell
Wow! http://rsquared.stat.uni-muenchen.de/index.rhtml looks great--very
interesting--thanks for the heads-up on that link.

Worked with R/S/S-PLUS in grad school--easily my favorite
language/system--especially like its ease of extensibility--reminds me of
EMACS LISP!

I recognized your name, Stephen, as the long-time maintainer of the Emacs
Lisp List--thanks for that too.
Are you envisioning a repository beyond Emacs Lisp List for OrgMode
implementations and/or Babel examples.
Or maybe optional extensions to OrgMode itself? Both?

Also, I very much agree that a near exact replica of the
http://rsquared.stat.uni-muenchen.de/index.rhtml for OrgMode would be great.

Read the 3 papers on the site and came across this reference that may be
interesting to OrgMode/R/Literate Programming persons:

http://cran.r-project.org/web/packages/roxygen/index.html

Maybe that could be a focus of such a site if it were made?: OrgMode =
LiterateProgramming = R/Bable/whatever other languages.

--where such topics intersect.

On Thu, Jan 12, 2012 at 7:38 AM, Stephen Eglen sj...@cam.ac.uk wrote:

 Following on from an old thread about self-configuring org files for
 reproducible research, R users might be interested to see the following
 web site
 which is exactly what I was thinking of for org mode (but of course, works
 only for R packages.)

  http://rsquared.stat.uni-muenchen.de/index.rhtml

 Stephen






[O] how to get \circ symbol in odt export?

2012-01-12 Thread Eric S Fraga
Hi,

I usually export to PDF via LaTeX.  One of the symbols I use a lot is
the degree symbol (as in degrees C) and typically do this with a
latex-ism:

  ^{\circ}C

This doesn't export well to ODT.  Can anybody suggest what I can use
that would?  Using ^{o}C works but doesn't look very nice (lower case
o is not a circle, more of an oval).

Not a critical issue but I *am* curious!

Thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.106.gc835)



Re: [O] how to get \circ symbol in odt export?

2012-01-12 Thread Eric S Fraga
Eric S Fraga e.fr...@ucl.ac.uk writes:

 Hi,

 I usually export to PDF via LaTeX.  One of the symbols I use a lot is
 the degree symbol (as in degrees C) and typically do this with a
 latex-ism:

   ^{\circ}C

 This doesn't export well to ODT.  Can anybody suggest what I can use
 that would?  Using ^{o}C works but doesn't look very nice (lower case
 o is not a circle, more of an oval).

 Not a critical issue but I *am* curious!

 Thanks,
 eric

I've answered my own question: simply resort to UTF characters!
Replacing ^{\circ} with the DEGREE SIGN unicode character (°) does the
trick for both latex/pdf and odt exports!  *And* looks good in the org
buffer as well.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.106.gc835)



Re: [O] Rsquared for reproductible research

2012-01-12 Thread Stephen Eglen

 I recognized your name, Stephen, as the long-time maintainer of the Emacs
 Lisp List--thanks for that too.  
 Are you envisioning a repository beyond Emacs Lisp List for OrgMode
 implementations and/or Babel examples.

I am interested in maintaining a collection of nice org-babel-R
examples, given my interest in R and Emacs; I made a small start last
year for my tutorial notes on ESS for the useR meeting, but I'd like to
update that.  The key problem I found with learning org-babel was worked
examples, given that the syntax was changing rapidly.  I hope that has
now stabilised, and I should followup with Eric about this.

(I also hope to kill off the Emacs Lisp List once the ELPA has taken
off.)

 Also, I very much agree that a near exact replica of the http://
 rsquared.stat.uni-muenchen.de/index.rhtml for OrgMode would be great.
Yes!  Any takers?!?

 http://cran.r-project.org/web/packages/roxygen/index.html

Note that ESS has limited support for editing roxygen tags.

Stephen




Re: [O] BUG: C-c C-c no longer renumbers ordered lists

2012-01-12 Thread Bastien
Hi Anthony,

Anthony Lander anth...@landerfamily.ca writes:

 It seems that C-c C-c no longer renumbers ordered lists (today's git
 pull). I'm not sure when this behaviour disappeared, but it is still
 referenced in the manual[1], so I assume it is a bug. I apologize that I
 don't have time to narrow down which commit introduced the change.

I confirm this bug. 

As a workaround, moving one item up or down fixes the numbers.

Thanks for reporting this,

-- 
 Bastien



Re: [O] inline src_R also in latex src block

2012-01-12 Thread Michael Bach



Sebastien Vauban
wxhgmqzgwmuf-genee64ty+gs+fvcfc7...@public.gmane.org writes:

 That's perfectly correct: as long as your input code block does not change
 (options on the meta line and/or contents), your results will be taken as
 is, instead of being recomputed every time.

Very nice, Thanks for confirmation!  

Michael





Re: [O] how to get \circ symbol in odt export?

2012-01-12 Thread Carson Chittom
Eric S Fraga e.fr...@ucl.ac.uk writes:

 Eric S Fraga e.fr...@ucl.ac.uk writes:

 Hi,

 I usually export to PDF via LaTeX.  One of the symbols I use a lot is
 the degree symbol (as in degrees C) and typically do this with a
 latex-ism:

   ^{\circ}C

 This doesn't export well to ODT.  Can anybody suggest what I can use
 that would?  Using ^{o}C works but doesn't look very nice (lower case
 o is not a circle, more of an oval).

 Not a critical issue but I *am* curious!

 Thanks,
 eric

 I've answered my own question: simply resort to UTF characters!
 Replacing ^{\circ} with the DEGREE SIGN unicode character (°) does the
 trick for both latex/pdf and odt exports!  *And* looks good in the org
 buffer as well.

For the sake of completeness, I'll mention that Scott Pakin's
Comprehensive LaTeX Symbol List[1] lists several packages which include
\degree or something similar.

[1] http://www.ctan.org/tex-archive/info/symbols/comprehensive/




Re: [O] how to get \circ symbol in odt export?

2012-01-12 Thread Eric S Fraga
Carson Chittom car...@wistly.net writes:

 Eric S Fraga e.fr...@ucl.ac.uk writes:

 Eric S Fraga e.fr...@ucl.ac.uk writes:

 Hi,

 I usually export to PDF via LaTeX.  One of the symbols I use a lot is
 the degree symbol (as in degrees C) and typically do this with a
 latex-ism:

   ^{\circ}C

 This doesn't export well to ODT.  Can anybody suggest what I can use
 that would?  Using ^{o}C works but doesn't look very nice (lower case
 o is not a circle, more of an oval).

 Not a critical issue but I *am* curious!

 Thanks,
 eric

 I've answered my own question: simply resort to UTF characters!
 Replacing ^{\circ} with the DEGREE SIGN unicode character (°) does the
 trick for both latex/pdf and odt exports!  *And* looks good in the org
 buffer as well.

 For the sake of completeness, I'll mention that Scott Pakin's
 Comprehensive LaTeX Symbol List[1] lists several packages which include
 \degree or something similar.

 [1] http://www.ctan.org/tex-archive/info/symbols/comprehensive/

Thanks Carsten; this is a useful link indeed for latex users!

I'm not sure if any of these symbols, in general, export well to ODT?
At least the UTF solution seems to work in my specific case!

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.106.gc835)



Re: [O] Rsquared for reproductible research

2012-01-12 Thread Eric Schulte
Stephen Eglen s.j.eg...@damtp.cam.ac.uk writes:

 I recognized your name, Stephen, as the long-time maintainer of the Emacs
 Lisp List--thanks for that too.  
 Are you envisioning a repository beyond Emacs Lisp List for OrgMode
 implementations and/or Babel examples.

 I am interested in maintaining a collection of nice org-babel-R
 examples, given my interest in R and Emacs; I made a small start last
 year for my tutorial notes on ESS for the useR meeting, but I'd like to
 update that.  The key problem I found with learning org-babel was worked
 examples, given that the syntax was changing rapidly.  I hope that has
 now stabilised, and I should followup with Eric about this.


The syntax is now stabilized (we wanted to get this sorted before the
final Emacs24 merge).  That which is currently described in the manual
is and should remain the proper Org-mode code block syntax.

For many small examples, please see [1] which I (unfortunately) haven't
been adding to recently, but I will try to once again start using for
all of my small generally-mailing-list-inspired Babel one-offs.


 (I also hope to kill off the Emacs Lisp List once the ELPA has taken
 off.)

 Also, I very much agree that a near exact replica of the http://
 rsquared.stat.uni-muenchen.de/index.rhtml for OrgMode would be great.
 Yes!  Any takers?!?


From looking at the fairly terse web site for R^2 it is not clear to me
exactly what the system includes (I'm sure I'm missing something
obvious).  It seems to be the addition of a packaging system over-top of
R source files.  What would a potential Org-mode based system provide
which is not already possible with Org-mode text files, Org-mode
publishing and a version control repository.

Perhaps the benefit would simply be a system which eases the integration
of Org, publishing, version control, and possibly automatic Makefile
creation with tasks like publish, clean etc...

Best,


 http://cran.r-project.org/web/packages/roxygen/index.html

 Note that ESS has limited support for editing roxygen tags.

 Stephen




Footnotes: 
[1]  http://eschulte.me/org-scraps/

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



Re: [O] BUG: C-c C-c no longer renumbers ordered lists

2012-01-12 Thread Nicolas Goaziou
Hello,

Anthony Lander anth...@landerfamily.ca writes:

 It seems that C-c C-c no longer renumbers ordered lists.

True. This should now be fixed.

Thanks for reporting it.


Regards,

-- 
Nicolas Goaziou



Re: [O] how to get \circ symbol in odt export?

2012-01-12 Thread Christian Moe

On 1/12/12 5:22 PM, Eric S Fraga wrote:

I'm not sure if any of these symbols, in general, export well to ODT?
At least the UTF solution seems to work in my specific case!



Hi,

I prefer utf-8 myself, but should it be impractical for any reason,
Org's built-in \deg entity is another possibility.

Terminate with {} before non-space character, e.g.:

  Global mean temperature rose 0.74 \deg{}C over 1906--2005.

See the manual, 11.7.1 for pretty inline display.

Yours,
Christian




Re: [O] Rsquared for reproductible research

2012-01-12 Thread Thomas S. Dye
Eric Schulte eric.schu...@gmx.com writes:

 Stephen Eglen s.j.eg...@damtp.cam.ac.uk writes:

 I recognized your name, Stephen, as the long-time maintainer of the Emacs
 Lisp List--thanks for that too.  
 Are you envisioning a repository beyond Emacs Lisp List for OrgMode
 implementations and/or Babel examples.

 I am interested in maintaining a collection of nice org-babel-R
 examples, given my interest in R and Emacs; I made a small start last
 year for my tutorial notes on ESS for the useR meeting, but I'd like to
 update that.  The key problem I found with learning org-babel was worked
 examples, given that the syntax was changing rapidly.  I hope that has
 now stabilised, and I should followup with Eric about this.


 The syntax is now stabilized (we wanted to get this sorted before the
 final Emacs24 merge).  That which is currently described in the manual
 is and should remain the proper Org-mode code block syntax.

 For many small examples, please see [1] which I (unfortunately) haven't
 been adding to recently, but I will try to once again start using for
 all of my small generally-mailing-list-inspired Babel one-offs.


 (I also hope to kill off the Emacs Lisp List once the ELPA has taken
 off.)

 Also, I very much agree that a near exact replica of the http://
 rsquared.stat.uni-muenchen.de/index.rhtml for OrgMode would be great.
 Yes!  Any takers?!?


 From looking at the fairly terse web site for R^2 it is not clear to me
 exactly what the system includes (I'm sure I'm missing something
 obvious).  It seems to be the addition of a packaging system over-top of
 R source files.  What would a potential Org-mode based system provide
 which is not already possible with Org-mode text files, Org-mode
 publishing and a version control repository.

One thing that caught my eye was the facility that compared results
across operating systems.

Tom


 Perhaps the benefit would simply be a system which eases the integration
 of Org, publishing, version control, and possibly automatic Makefile
 creation with tasks like publish, clean etc...

 Best,


 http://cran.r-project.org/web/packages/roxygen/index.html

 Note that ESS has limited support for editing roxygen tags.

 Stephen




 Footnotes: 
 [1]  http://eschulte.me/org-scraps/

-- 
Thomas S. Dye
http://www.tsdye.com



[O] [babel] org mode tables and tangling

2012-01-12 Thread Andreas Leha
Hi all,

What is the suggested way to use org mode tables in connection with tangling?

Example:  If I tangle this org mode file

/org-file=\
| * org-tables and reproducibility  |
|   #+name: params  |
|   | number | param |  |
|   |+---|  |
|   |  0 | 1 |  |
|   |  1 | 1 |  |
|   |
|   #+begin_src R :var params=params :tangle test.R |
| apply(params, 1, print)   |
|   #+end_src   |
\/org-file/

the tangled file looks like

/test.R===\
| params - read.table(/tmp/babel-19196cip/R-import-19196ILE, |
|header=TRUE, row.names=NULL, sep=\t, as.is=TRUE) |
| attach(params)|
| apply(params, 1, print)   |
\/test.R==/

which depends on a temporary file.  I could distribute that along with the
tangled file, of course.

But I'd like a distributable, ideally self-contained version, that my
co-workers can work with.

Something like this, maybe:

/sample.R===\
| # generated with R dput()...|
| babel_tmp_1238h098 - structure(list(means = 0:1, sds = c(1L, 1L)), |
| .Names = c(means, sds), |
| class = data.frame,   |
| row.names = c(NA, -2L)) |
| params - dget(textConnection(babel_tmp_1238h098, r))   |
\/sample.R==/

Is such a mode of tangling already available for R?

Best,
Andreas




[O] Way to replace normal tabular env with booktabs?

2012-01-12 Thread John Hendy
Greetings,


I was using wikibooks for some formatting assistance on tables the other
day and ran into mention of the booktabs package in the Professional
tables section. [1] [2]

I really, really liked it's formatting, especially since one of my column
headers was a fraction. The standard tabular package places the \hlines
extremely close to the top and bottom of my header row vs., as the booktabs
package says, having extremely nice looking spacing for the table. I ended
up doing the table manually inside #+begin_latex block.

Would there be any way to specify that booktabs should be used? The
formatting is literally identical except for 1) including the booktabs
package and 2) using \toprule, \midrule and \bottomrule instead of \hlines.
In fact, even with booktabs included, if you use \hlines instead of the
booktab specific lines, you'll get a regular tabular table.

Any thoughts on this?


Best regards,
John

-
[1] http://en.wikibooks.org/wiki/LaTeX/Tables#Professional_tables
[2] http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/


Re: [O] how to get \circ symbol in odt export?

2012-01-12 Thread Carson Chittom
Christian Moe m...@christianmoe.com writes:

 I prefer utf-8 myself, but should it be impractical for any reason,
 Org's built-in \deg entity is another possibility.

 Terminate with {} before non-space character, e.g.:

   Global mean temperature rose 0.74 \deg{}C over 1906--2005.

 See the manual, 11.7.1 for pretty inline display.

Oh, hey, neat!  (I'm definitely going to have to back over the manual.)





Re: [O] Rsquared for reproductible research

2012-01-12 Thread brian powell
 Also, I very much agree that a near exact replica of the http://
 rsquared.stat.uni-muenchen.de/index.rhtml for OrgMode would be great.
 Yes!  Any takers?!?

...
Eric questioned:
From looking at the fairly terse web site for R^2 it is not clear to me
exactly what the system includes (I'm sure I'm missing something
obvious).  It seems to be the addition of a packaging system over-top of
R source files.  What would a potential Org-mode based system provide
which is not already possible with Org-mode text files, Org-mode
publishing and a version control repository.
...

* I mostly agree with your statements. Good challenges. I did more
investigation: This link to the paper that  Friedrich Leischa, , Manuel
Eugsterb, Torsten Hothornb put together may make things clearer--this
paper really seems to be the justification/impetus for the R^2 website--it
has made things clearer and more exciting for me:

http://www.sciencedirect.com/science/article/pii/S1877050911001232

= Executable Papers for the R Community: The R2 Platform for
Reproducible Research

** So papers in R (and maybe other languages--maybe languages run thru
Babel in OrgMode) could be executed by people in the community--one could
verify research studies and papers interactively, ad hoc.

*** They mention in the paper that they use several key tools:

R: the lingua franca of statistics and data analysis
Sweave: the most popular format for executable papers in the R community
CRAN: package building and checking system has been developed for more then
a decade and copes successfully
with the exponential growth of the number of packages

 Weave/CWEB/CWEAVE/CTANGLE=NOWEB (Knuth) comes to mind here--i.e.
Literate Programming

* http://www-cs-staff.stanford.edu/~uno/cweb.html =

CTANGLE
converts a source file foo.w to a compilable program file foo.c;
CWEAVE
converts a source file foo.w to a prettily-printable and cross-indexed
document file foo.tex.

* Exactly the paper can be found at:

http://www.sciencedirect.com/science\
?_ob=MiamiImageURL_cid=280203_user=10_pii=S1877050911001232\
_check=y_origin=article_zone=toolbar_coverDate=\
31-Dec-2011view=coriginContentFamily=serialwchp=\
dGLbVlS-zSkWbmd5=4681e5babd7822f321d2a0dd3a9f11cf/\
1-s2.0-S1877050911001232-main.pdf

* I agree Eric that the website is a bit terse; but, for the most part I
was excited about (and I think Stephen is interested in--he suggested it is
something the community might do) the general ideas, the structure of the
website's process OrgMode=TeX paper
in--...process...--Executable/verifiable code interaction a user might
experience/stored on-line for researchers (one thing I always enjoy a lot
when working with e.g. R/S-PLUS and PYTHON's interactive CLI, etc.)

** They even publish the minute details of the settings on the
machines--the local environment variables, etc.--the devil is in the
details!

* Thanks for the link Eric to your OrgMode scraps--they could be very
useful:

http://eschulte.me/org-scraps/

* Lastly, most importantly I'll repeat the link and query to the community:
...
 Also, I very much agree that a near exact replica of the
http://rsquared.stat.uni-muenchen.de/index.rhtml
for OrgMode would be great.
 Yes!  Any takers?!?---(Stephen Eglen)


Re: [O] how to get \circ symbol in odt export?

2012-01-12 Thread Eric S Fraga
Christian Moe m...@christianmoe.com writes:

 On 1/12/12 5:22 PM, Eric S Fraga wrote:
 I'm not sure if any of these symbols, in general, export well to ODT?
 At least the UTF solution seems to work in my specific case!


 Hi,

 I prefer utf-8 myself, but should it be impractical for any reason,
 Org's built-in \deg entity is another possibility.

Thanks.  \deg works well.  

Is there a list for symbols that will translate properly in ODT export,
akin to the org-entities variable?  That variable knows about latex,
ascii, html, ... but not ODT!

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.117.ga7389)



[O] leave inactive timestamp inactive

2012-01-12 Thread Michael Brand
Hi all

When one does Shift-right on an inactive timestamp it remains
inactive. When one does C-c . S-right RET the inactive timestamp
changes to active but I would like it also to remain inactive. What
are the opinions on this?

My frequent use case is changing an inactive timestamp left over from
a copy/paste to today with C-c . . RET.

The behavior could be changed very easily by just uncommenting this
line:

http://orgmode.org/w/?p=org-mode.git;a=blob;f=lisp/org.el;h=e878626d6e6ae68781546a270ae1020c477581fd;hb=HEAD#l14792

;  (setq inactive (eq (char-after (match-beginning 0)) ?\[))

which has been inserted with release_6.07b-42-gd043e31:

commit d043e31182595983df3d191e80ca941ee171c400
Author: Carsten Dominik carsten.domi...@gmail.com
Date:   Wed Oct 1 09:25:18 2008 +0200

Integrate John Wiegley's org-attach.el.

Michael



Re: [O] Way to replace normal tabular env with booktabs?

2012-01-12 Thread Thomas S. Dye
Hi John,

Agreed, booktabs makes good looking tables.  

Check out your Library of Babel.  There should  be a couple of functions
there that will help you go from Org mode to booktabs.

hth,
Tom
 
John Hendy jw.he...@gmail.com writes:

 Greetings,


 I was using wikibooks for some formatting assistance on tables the other
 day and ran into mention of the booktabs package in the Professional
 tables section. [1] [2]

 I really, really liked it's formatting, especially since one of my column
 headers was a fraction. The standard tabular package places the \hlines
 extremely close to the top and bottom of my header row vs., as the booktabs
 package says, having extremely nice looking spacing for the table. I ended
 up doing the table manually inside #+begin_latex block.

 Would there be any way to specify that booktabs should be used? The
 formatting is literally identical except for 1) including the booktabs
 package and 2) using \toprule, \midrule and \bottomrule instead of \hlines.
 In fact, even with booktabs included, if you use \hlines instead of the
 booktab specific lines, you'll get a regular tabular table.

 Any thoughts on this?


 Best regards,
 John

 -
 [1] http://en.wikibooks.org/wiki/LaTeX/Tables#Professional_tables
 [2] http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/
 Greetings,I was using wikibooks for some formatting assistance on tables the 
 other day and ran into mention of the booktabs package in the Professional 
 tables section. [1] [2]
 I really, really liked it#39;s formatting, especially since one of my column 
 headers was a fraction. The standard tabular package places the \hlines 
 extremely close to the top and bottom of my header row vs., as the booktabs 
 package says, having extremely nice looking spacing for the table. I ended up 
 doing the table manually inside #+begin_latex block.
 Would there be any way to specify that booktabs should be used? The 
 formatting is literally identical except for 1) including the booktabs 
 package and 2) using \toprule, \midrule and \bottomrule instead of \hlines. 
 In fact, even with booktabs included, if you use \hlines instead of the 
 booktab specific lines, you#39;ll get a regular tabular table.
 Any thoughts on this?Best 
 regards,John-[1] http://en.wikibooks.org/wiki/LaTeX/Tables#Professional_tables
 [2] http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] how to get \circ symbol in odt export?

2012-01-12 Thread Christian Moe

On 1/12/12 8:49 PM, Eric S Fraga wrote:

Is there a list for symbols that will translate properly in ODT export,
akin to the org-entities variable?  That variable knows about latex,
ascii, html, ... but not ODT!


Not to worry, org-entities and ODT both speak utf-8.

Yours,
Christian




Re: [O] Rsquared for reproductible research

2012-01-12 Thread Eric Schulte
brian powell briangpowel...@gmail.com writes:

 Also, I very much agree that a near exact replica of the http://
 rsquared.stat.uni-muenchen.de/index.rhtml for OrgMode would be great.
 Yes!  Any takers?!?

 ...
 Eric questioned:
 From looking at the fairly terse web site for R^2 it is not clear to me
 exactly what the system includes (I'm sure I'm missing something
 obvious).  It seems to be the addition of a packaging system over-top of
 R source files.  What would a potential Org-mode based system provide
 which is not already possible with Org-mode text files, Org-mode
 publishing and a version control repository.
 ...

 * I mostly agree with your statements. Good challenges. I did more
 investigation: This link to the paper that  Friedrich Leischa, , Manuel
 Eugsterb, Torsten Hothornb put together may make things clearer--this
 paper really seems to be the justification/impetus for the R^2 website--it
 has made things clearer and more exciting for me:

 http://www.sciencedirect.com/science/article/pii/S1877050911001232


Ah, thank you for linking to this paper.  It seems I was missing was the
package-management aspect provided by R2 through CRAN.  The instillation
of all software dependencies is a huge benefit exactly as installing
software with apt-get or pacman is simpler than running ./configure 
make and manually resolving dependencies.

While such a tool makes sense for a single language system like R, I
fear an Org-mode version of such a system would have too wide of a
scope.  Given that code blocks may contain arbitrary languages, and that
sh blocks can freely call any command-line executable such a system
would turn into a system-wide package management tool.

Perhaps there already exists a portable package management system
designed for local installs which could handle most of the heavy
lifting.

As another option, distributing Virtual Machine images are one solution
which I think work well and are increasingly realistic.  Or similarly
providing the research environment as a cloud server image (e.g., Amazon
EC2).

Certainly an interesting area for further work!

Best,

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



Re: [O] Rsquared for reproductible research

2012-01-12 Thread Stephen Eglen

 The syntax is now stabilized (we wanted to get this sorted before the
 final Emacs24 merge).  That which is currently described in the manual
 is and should remain the proper Org-mode code block syntax.

Thanks Eric, this is great news.  I'll ensure my examples from last year
still work with the current org-mode syntax.


 For many small examples, please see [1] which I (unfortunately) haven't

That's a nice site, thanks!

 From looking at the fairly terse web site for R^2 it is not clear to me
 exactly what the system includes (I'm sure I'm missing something
 obvious).  It seems to be the addition of a packaging system over-top of
 R source files.  What would a potential Org-mode based system provide
 which is not already possible with Org-mode text files, Org-mode
 publishing and a version control repository.

The accompanying paper from 2011 goes into detail as to what it does.
But in essence, the website is supposed to be 'neutral', in that it is
not your local system.  A document may compile on my system, but not for
others, because it depends on my local configuration.  Having a neutral
system will avoid such problems.

A neutral system could also have support for all babel languages, so
that I can use it to compile someone's document without e.g. having a
common-lisp compiler on my system.

 Perhaps the benefit would simply be a system which eases the integration
 of Org, publishing, version control, and possibly automatic Makefile
 creation with tasks like publish, clean etc...

yes, that too!

best wishes,
Stephen



[O] Quoting characters?

2012-01-12 Thread Yu
Hello!

When working with Org-mode I sometimes run into oddities, when a
character I need clashes with org-mode syntax. Is there a way to avoid
this?

Examples would be:

Writing a macro that expands to `$\neg$':
#+macro: not $\neg$
expands to
$
eg$
even if I write it as \\neg. Writing the macro in the C-c C-' buffer
produces \n, but when editing it again, it is displayed as a newline.

Similiarily, I found no way to have \^ or \_ appear in the export,
when I wanted to write about escaping ^ and _ as =\^= and =\_=
respectively. Here as well, writing multiple backslashes wouldn't
change the output.


Maybe related, I found that when editing an block
: #+foo: bar
: This is an org-mode example
with C-c C-', the result text will be
: ,#+foo: bar
: This is an org-mode example
The extra comma generated will still be there also in the C-c C-'
editing buffer.

In a source code block, that is declared to be of the language org,
this behaviour doesn't appear, but it reappears for other languages.

When exporting to html or pdf, the comma isn't present for src
blocks, but it is for the colon blocks.


kind regards, Yu



[O] Syntax error warnings? (Especially important with :noweb-ref's)

2012-01-12 Thread Yu
Hello!

I was wondering, if there is a way to get warnings for typos (e.g.
when specifying invalid properties or header arguments). It can just
easily happen that I mix up e.g. :exports and :export (though
that's probably a very harmless example).

More important it gets though, when trying to use the literate
programming facilities.

Say I have a source code

#+begin_src sh :noweb tangle :tangle foo.sh
  foo
#+end_src
#+begin_src sh :noweb-ref fo
  echo '... how are you?';
#+end_src

then tangling would run through without any indication of the typo in
the name of the foo block. Such errors might be hard to debug,
because there is no indication of the error, maybe nothing other than
runtime errors.

An error message for the /use/ of undefined references only wouldn't
avoid such problems either, e.g. consider

#+begin_src sh :noweb tangle :tangle foo.sh
  foo
#+end_src
#+begin_src sh :noweb-ref foo
  echo 'Hello World...';
#+end_src
#+begin_src sh :noweb-ref fo
  echo 'Hello World...';
#+end_src

where the only detectable error is, that fo was never used anywhere.

A similiar question (though without the second part) was asked here:
http://lists.gnu.org/archive/html/emacs-orgmode/2009-11/msg00273.html
As far as I can tell, it stands unanswered.

On a side note: What is the customary way to mention the
noweb-relevant name of a source block in the html/pdf export? After
all, if a code-block states
: task1
: task2
the reader needs to know, which code blocks define these.


kind regards, Yu



Re: [O] How to debug org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61

2012-01-12 Thread Gregor Zattler
Hi Bernt, org-mode developers,
* Bernt Hansen be...@norang.ca [05. Jan. 2012]:
 Gregor Zattler telegr...@gmx.net writes:
 I use org-mode to record my working time.  If I want to know the
 total time worked on a project I do a M-X org-clock-display.

 But this suddenly gives me this error message:

 org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 
 0 ...], 61

 I checked the org file but do not find any irregularities in the
 clock tables.  I even deleted all individual `= HH:MM' time
 ranges but this did not help.

With something like bisecting I narrowed the problem down to a
few headlines consisting of subheadings, bullet lists, checkboxed
lists a few inline tasks etc.  All in all 253 lines of text.  It
looks totally harmless to me.

 This happens with emacs23.3, org-mode 6.33 as with Emacs-snapshot
 and newest org-mode so I assume it is something like a syntax
 error in my org file.

In both cases I startet Emacs with -Q so this is not a
configuration issue -- besides a few #+STARTUP lines at the
beginning orf the org file.

 Any idea where to look for the cause of the error?
 
 If you generate a backtrace with uncompiled org source files you should
 get an indication of where the problem is.

I did as you said but the backtrace is totally opaque to me:

Debugger entered--Lisp error: (args-out-of-range [49569 49569 49569 39957 39957 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 61)
  aref([49569 49569 49569 39957 39957 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0] 61)
  ( (aref ltimes level) 0)
  (or ( t1 0) ( (aref ltimes level) 0))
  (if (or ( t1 0) ( (aref ltimes level) 0)) (progn (when (or 
headline-included headline-forced) (if headline-included (loop for l from 0 to 
level do (aset ltimes l (+ (aref ltimes l) t1 (setq time (aref ltimes 
level)) (goto-char (match-beginning 0)) (put-text-property (point) 
(point-at-eol) :org-clock-minutes time) (if headline-filter (save-excursion 
(save-match-data (while ( ... 1) (outline-up-heading 1 t) (put-text-property 
... ... :org-clock-force-headline-inclusion t)) (setq t1 0) (loop for l 
from level to (1- lmax) do (aset ltimes l 0
  (when (or ( t1 0) ( (aref ltimes level) 0)) (when (or headline-included 
headline-forced) (if headline-included (loop for l from 0 to level do (aset 
ltimes l (+ (aref ltimes l) t1 (setq time (aref ltimes level)) (goto-char 
(match-beginning 0)) (put-text-property (point) (point-at-eol) 
:org-clock-minutes time) (if headline-filter (save-excursion (save-match-data 
(while ( (funcall outline-level) 1) (outline-up-heading 1 t) 
(put-text-property (point) (point-at-eol) :org-clock-force-headline-inclusion 
t)) (setq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0)))
  (let* ((headline-forced (get-text-property (point) 
:org-clock-force-headline-inclusion)) (headline-included (or (null 
headline-filter) (save-excursion (save-match-data (funcall 
headline-filter)) (setq level (- (match-end 1) (match-beginning 1))) (when 
(or ( t1 0) ( (aref ltimes level) 0)) (when (or headline-included 
headline-forced) (if headline-included (loop for l from 0 to level do (aset 
ltimes l (+ (aref ltimes l) t1 (setq time (aref ltimes level)) (goto-char 
(match-beginning 0)) (put-text-property (point) (point-at-eol) 
:org-clock-minutes time) (if headline-filter (save-excursion (save-match-data 
(while ( ... 1) (outline-up-heading 1 t) (put-text-property ... ... 
:org-clock-force-headline-inclusion t)) (setq t1 0) (loop for l from level 
to (1- lmax) do (aset ltimes l 0
  (cond ((match-end 2) (setq ts (match-string 2) te (match-string 3) ts 
(org-float-time (apply (quote encode-time) (org-parse-time-string ts))) te 
(org-float-time (apply (quote encode-time) (org-parse-time-string te))) ts (if 
tstart (max ts tstart) ts) te (if tend (min te tend) te) dt (- te ts) t1 (if ( 
dt 0) (+ t1 (floor (/ dt 60))) t1))) ((match-end 4) (setq t1 (+ t1 
(string-to-number (match-string 5)) (* 60 (string-to-number (match-string 
4)) (t (when (and org-clock-report-include-clocking-task (equal 
(org-clocking-buffer) (current-buffer)) (equal (marker-position 
org-clock-hd-marker) (point)) tstart tend (= (org-float-time 
org-clock-start-time) tstart) (= (org-float-time org-clock-start-time) tend)) 
(let ((time (floor (- ... ...) 60))) (setq t1 (+ t1 time (let* 
((headline-forced (get-text-property (point) 
:org-clock-force-headline-inclusion)) (headline-included (or (null 
headline-filter) (save-excursion (save-match-data ...) (setq level (- 
(match-end 1) (match-beginning 1))) (when (or ( t1 0) ( (aref ltimes level) 
0)) (when (or headline-included headline-forced) (if headline-included (loop 
for l from 0 to level do (aset ltimes l ...))) (setq time (aref ltimes level)) 
(goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) 
:org-clock-minutes time) (if headline-filter (save-excursion (save-match-data 
... (setq t1 0) (loop for l from level to 

[O] [Bug] Auto-fill and *bold-face* at line-begin

2012-01-12 Thread Maximilian Matthe
Hi,

Filling paragraphs where the first word is *bold-face* fills the
following lines beginning in the 2nd column. See attached file for
details.

Regards, Max

* A
*this is a test* where the line begins with a bold-face-star. When the
 line is auto-filled, it starts in the 2nd column.

Here's another paragraph starting without bold-face and filling it
starts lines in 1st column.


Re: [O] org-babel order of evaluation

2012-01-12 Thread Leo Alekseyev
 Therefore, when executing an entire buffer, there is no way to have
 the execution of a call block dependent on the prior execution of a
 source block.


 It would be better to make the dependency explicit by passing the
 results of the call line as a (potentially unused) variable to the code
 block.  For example;
[snip]

 There is (at least currently) no guarantee that evaluation order will be
 buffer order.

I've been extremely confused by this in the past; this should be
prominently documented.  In the long run, I would like to see this
behavior changed.  One would intuitively expect all the source code in
the file to be evaluated in order.  This is how it works in pretty
much any other interpreter, why should org-babel be different?

(I'm a big fan of the principle of least surprise, and this behavior
violates it with vengeance :)  )

This is particularly nasty because many users start by treating an
org-babel file as a fancier version of the original source code with
nice annotations and outline levels; typically in a single language.
Thus, operationally, there isn't a distinction between tangling the
blocks into a single source file and feeding that to the interpreter
and running execute on the whole buffer.  But then, of course, one
might start using named blocks, variables, and #+call directives.  It
achieves the same effect as writing wrapper functions (or issuing
statements like source(somefile)) in the original language.  So,
when it results in a completely different execution order, it's a huge
surprise.

Even if this can be fixed by putting dummy dependencies in by hand,
this fix  seems inelegant and hacky.

Is there some deep rationale for the current behavior that I'm not
seeing?  Are there big obstacles to enforcing ligeral execution order?

--Leo



Re: [O] How to debug org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61

2012-01-12 Thread Nick Dokos
Gregor Zattler telegr...@gmx.net wrote:


 Debugger entered--Lisp error: (args-out-of-range [49569 49569 49569 39957 3=
 9957 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 61)
   aref([49569 49569 49569 39957 39957 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0=
  0 0 0 0 0 0] 61)

This tries to get the 61st element of a vector that has at most 30 or so
elements, hence the complaint. But of course, that's hardly
enlightening.  However, the backtrace shows that this code is inside the
function org-clock-sum (in org-clock.el).  And if you look at that
function, you see (where I have elided large swathes of code):

  (let* (...
 (lmax 30)
 (ltimes (make-vector lmax 0))
 ...

So ltimes is a vector with *exactly* 30 elements. I would change that 30
to 100 or so (something greater than 61 in any case) and retest. If that
fixes it, then we know the culprit and then we can dedice which is the
unreasonable one: the code or your subtree :-)

Nick


   ( (aref ltimes level) 0)
   (or ( t1 0) ( (aref ltimes level) 0))
   (if (or ( t1 0) ( (aref ltimes level) 0)) (progn (when (or headline-inc=
 luded headline-forced) (if headline-included (loop for l from 0 to level do=
  (aset ltimes l (+ (aref ltimes l) t1 (setq time (aref ltimes level)) (=
 goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) :o=
 rg-clock-minutes time) (if headline-filter (save-excursion (save-match-data=
  (while ( ... 1) (outline-up-heading 1 t) (put-text-property ... ... :org-=
 clock-force-headline-inclusion t)) (setq t1 0) (loop for l from level t=
 o (1- lmax) do (aset ltimes l 0
   (when (or ( t1 0) ( (aref ltimes level) 0)) (when (or headline-included=
  headline-forced) (if headline-included (loop for l from 0 to level do (ase=
 t ltimes l (+ (aref ltimes l) t1 (setq time (aref ltimes level)) (goto-=
 char (match-beginning 0)) (put-text-property (point) (point-at-eol) :org-cl=
 ock-minutes time) (if headline-filter (save-excursion (save-match-data (whi=
 le ( (funcall outline-level) 1) (outline-up-heading 1 t) (put-text-propert=
 y (point) (point-at-eol) :org-clock-force-headline-inclusion t)) (setq =
 t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0)))
   (let* ((headline-forced (get-text-property (point) :org-clock-force-headl=
 ine-inclusion)) (headline-included (or (null headline-filter) (save-excursi=
 on (save-match-data (funcall headline-filter)) (setq level (- (match-en=
 d 1) (match-beginning 1))) (when (or ( t1 0) ( (aref ltimes level) 0)) (w=
 hen (or headline-included headline-forced) (if headline-included (loop for =
 l from 0 to level do (aset ltimes l (+ (aref ltimes l) t1 (setq time (a=
 ref ltimes level)) (goto-char (match-beginning 0)) (put-text-property (poin=
 t) (point-at-eol) :org-clock-minutes time) (if headline-filter (save-excurs=
 ion (save-match-data (while ( ... 1) (outline-up-heading 1 t) (put-text-pr=
 operty ... ... :org-clock-force-headline-inclusion t)) (setq t1 0) (loo=
 p for l from level to (1- lmax) do (aset ltimes l 0
   (cond ((match-end 2) (setq ts (match-string 2) te (match-string 3) ts (or=
 g-float-time (apply (quote encode-time) (org-parse-time-string ts))) te (or=
 g-float-time (apply (quote encode-time) (org-parse-time-string te))) ts (if=
  tstart (max ts tstart) ts) te (if tend (min te tend) te) dt (- te ts) t1 (=
 if ( dt 0) (+ t1 (floor (/ dt 60))) t1))) ((match-end 4) (setq t1 (+ t1 (s=
 tring-to-number (match-string 5)) (* 60 (string-to-number (match-string 4))=
  (t (when (and org-clock-report-include-clocking-task (equal (org-clock=
 ing-buffer) (current-buffer)) (equal (marker-position org-clock-hd-marker) =
 (point)) tstart tend (=3D (org-float-time org-clock-start-time) tstart) (=
 =3D (org-float-time org-clock-start-time) tend)) (let ((time (floor (- ... =
 =2E..) 60))) (setq t1 (+ t1 time (let* ((headline-forced (get-text-prop=
 erty (point) :org-clock-force-headline-inclusion)) (headline-included (or (=
 null headline-filter) (save-excursion (save-match-data ...) (setq level=
  (- (match-end 1) (match-beginning 1))) (when (or ( t1 0) ( (aref ltimes =
 level) 0)) (when (or headline-included headline-forced) (if headline-includ=
 ed (loop for l from 0 to level do (aset ltimes l ...))) (setq time (aref lt=
 imes level)) (goto-char (match-beginning 0)) (put-text-property (point) (po=
 int-at-eol) :org-clock-minutes time) (if headline-filter (save-excursion (s=
 ave-match-data ... (setq t1 0) (loop for l from level to (1- lmax) do (=
 aset ltimes l 0))
   (while (re-search-backward re nil t) (cond ((match-end 2) (setq ts (match=
 -string 2) te (match-string 3) ts (org-float-time (apply (quote encode-time=
 ) (org-parse-time-string ts))) te (org-float-time (apply (quote encode-time=
 ) (org-parse-time-string te))) ts (if tstart (max ts tstart) ts) te (if ten=
 d (min te tend) te) dt (- te ts) t1 (if ( dt 0) (+ t1 (floor (/ dt 60))) t=
 1))) ((match-end 4) (setq t1 (+ t1 

[O] [OT] Emacs (elisp) as a scripting language

2012-01-12 Thread Marcelo de Moraes Serpa
Just thought I'd share:

http://www.leancrew.com/all-this/2008/04/emacs-lisp-as-a-scripting-language/

Simple and interesting. I can see the potential with orgmode!

- Marcelo.


Re: [O] org-babel order of evaluation

2012-01-12 Thread Rick Frankel
On Thu, Jan 12, 2012 at 04:35:31PM -0600, Leo Alekseyev wrote:
  Therefore, when executing an entire buffer, there is no way to have
  the execution of a call block dependent on the prior execution of a
  source block.
 
 
  It would be better to make the dependency explicit by passing the
  results of the call line as a (potentially unused) variable to the code
  block.  For example;
 [snip]

The problem w/ this is that the (potentially time consuming) dependent
will be executed twice when doing a buffer eval.

  There is (at least currently) no guarantee that evaluation order will be
  buffer order.
 
 Is there some deep rationale for the current behavior that I'm not
 seeing?  Are there big obstacles to enforcing ligeral execution order?

It's because prior to 7.8, call blocks were not executed during a
buffer execute. The solution was to execute all the call blocks after
executing the src block. (Eric would have to comment on how hard it
would be to merge the two functions :).

rick



Re: [O] how to get \circ symbol in odt export?

2012-01-12 Thread Eric S Fraga
Christian Moe m...@christianmoe.com writes:

 On 1/12/12 8:49 PM, Eric S Fraga wrote:
 Is there a list for symbols that will translate properly in ODT export,
 akin to the org-entities variable?  That variable knows about latex,
 ascii, html, ... but not ODT!

 Not to worry, org-entities and ODT both speak utf-8.

 Yours,
 Christian

Excellent.  Thanks.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.117.ga7389)



Re: [O] How to debug org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61

2012-01-12 Thread Nick Dokos
Nick Dokos nicholas.do...@hp.com wrote:

 Gregor Zattler telegr...@gmx.net wrote:
 
 
  Debugger entered--Lisp error: (args-out-of-range [49569 49569 49569 39957 3=
  9957 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 61)
aref([49569 49569 49569 39957 39957 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0=
   0 0 0 0 0 0] 61)
 
 This tries to get the 61st element of a vector that has at most 30 or so
 elements, hence the complaint. But of course, that's hardly
 enlightening.  However, the backtrace shows that this code is inside the
 function org-clock-sum (in org-clock.el).  And if you look at that
 function, you see (where I have elided large swathes of code):
 
   (let* (...
(lmax 30)
(ltimes (make-vector lmax 0))
...
 
 So ltimes is a vector with *exactly* 30 elements. I would change that 30
 to 100 or so (something greater than 61 in any case) and retest. If that
 fixes it, then we know the culprit and then we can dedice which is the
 unreasonable one: the code or your subtree :-)
 

Or maybe that 61 is way off base. After all, there are only 5 non-trivial
entries in the vector.

The code that sets the level seems suspect to me:

  (let* ((headline-forced
  (get-text-property (point)
 :org-clock-force-headline-inclusion))
 (headline-included
  (or (null headline-filter)
  (save-excursion
(save-match-data (funcall headline-filter))
(setq level (- (match-end 1) (match-beginning 1)))

What do match-beginning/match-end return if headline-filter is nil?
The save-match-data is not done, so we get the results of whatever
random  search was done last before this code executed.

Nick




Re: [O] Minor org mode for achieve code folding effects

2012-01-12 Thread David Rogoff

Carlos Russo mestre.adamastor at gmail.com writes:
I have used both Carsten's and Eric's solution, as well as
hideshow-org (https://github.com/secelis/hideshow-org), which works
rather well and deserves a mention.

Expanding a bit on Carsten's post: Tassilo Horn wrote some convenience
functions to set the outline minor mode regexps to correspond to the
current comment syntax.  Thus, if I'm (for instance) in shell-script
mode, # * and # ** become the outline level 1 and 2 markers.

I have all this working and it's great.  But...This is using 
outline-minor-mode.  Like Giovanni, who started this thread,  I'm used 
to orgmode, which is a little different although it uses outline mode.  
I tried hacking the code to use orgstruct-mode, which is the minor mode 
version of orgmode.  I got a little figured out, but got lost.  I would 
think all of Tassilo's code to automatically set up outline-regexp would 
still be valid, but I'm not doing something right. I saw Carsten's 
message to look at the visibility cycling and understand that, but the 
keymaps are not working right and the outline-regexp isn't being set 
right.  I've worked around the latter with a quick function I can call 
from the file buffer. However, I don't know what's going on with the 
keymap.  It looks right. For example, c-h k TAB gives this:


tab runs the command orgstruct-hijacker-command-102, which is an 
interactive Lisp function.

It is bound to tab.
(orgstruct-hijacker-command-102 ARG)
In Structure, run `org-cycle'.
Outside of structure, run the binding of `[(tab)]' or `'.

However, it doesn't seem to recognize when it's in a structure. M-x 
org-cycle works as does M-x org-global-cycle.


I only need this for emacs-lisp-mode and verilog-mode so I simplified 
Tassilo's code like this:

(when (eq major-mode 'emacs-lisp-mode)
  (setq outline-regexp ;; [*]+ ))
(when (eq major-mode 'verilog-mode)
  (setq outline-regexp \\s-*// [*]+ ))

Help Please!

Thanks!

 David



Re: [O] Way to replace normal tabular env with booktabs?

2012-01-12 Thread John Hendy
On Thu, Jan 12, 2012 at 2:12 PM, Thomas S. Dye t...@tsdye.com wrote:

 Hi John,

 Agreed, booktabs makes good looking tables.

 Check out your Library of Babel.  There should  be a couple of functions
 there that will help you go from Org mode to booktabs.


Haven't done much with babel other than writing code blocks. Do you mean
this page?
--- http://orgmode.org/worg/org-contrib/babel/library-of-babel.html

Thanks for the suggestion. Feeling a bit lost, but am happy to look around
for something that seems similar. I have no elisp-fu, so it'll need to be
pretty darn similar :)


John


 hth,
 Tom

 John Hendy jw.he...@gmail.com writes:

  Greetings,
 
 
  I was using wikibooks for some formatting assistance on tables the other
  day and ran into mention of the booktabs package in the Professional
  tables section. [1] [2]
 
  I really, really liked it's formatting, especially since one of my column
  headers was a fraction. The standard tabular package places the \hlines
  extremely close to the top and bottom of my header row vs., as the
 booktabs
  package says, having extremely nice looking spacing for the table. I
 ended
  up doing the table manually inside #+begin_latex block.
 
  Would there be any way to specify that booktabs should be used? The
  formatting is literally identical except for 1) including the booktabs
  package and 2) using \toprule, \midrule and \bottomrule instead of
 \hlines.
  In fact, even with booktabs included, if you use \hlines instead of the
  booktab specific lines, you'll get a regular tabular table.
 
  Any thoughts on this?
 
 
  Best regards,
  John
 
  -
  [1] http://en.wikibooks.org/wiki/LaTeX/Tables#Professional_tables
  [2] http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/
  Greetings,I was using wikibooks for some formatting assistance on tables
 the other day and ran into mention of the booktabs package in the
 Professional tables section. [1] [2]
  I really, really liked it#39;s formatting, especially since one of my
 column headers was a fraction. The standard tabular package places the
 \hlines extremely close to the top and bottom of my header row vs., as the
 booktabs package says, having extremely nice looking spacing for the table.
 I ended up doing the table manually inside #+begin_latex block.
  Would there be any way to specify that booktabs should be used? The
 formatting is literally identical except for 1) including the booktabs
 package and 2) using \toprule, \midrule and \bottomrule instead of \hlines.
 In fact, even with booktabs included, if you use \hlines instead of the
 booktab specific lines, you#39;ll get a regular tabular table.
  Any thoughts on this?Best regards,John-[1]
 http://en.wikibooks.org/wiki/LaTeX/Tables#Professional_tables
  [2] http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/

 --
 Thomas S. Dye
 http://www.tsdye.com



[O] Invalid capture template with pull of Org 7.8.03?

2012-01-12 Thread Damon Haley

Hi I was wondering if someone could point me in the right direction
because one of my Org capture templates, that I use to feed questions to
myself (for later use with org-drill) just broke with the most recent
bzr pull of emacs.

Now, when I try to use the capture template, I only get this header in
my target org file.

** Invalid capture template

I'm on the 24.0.92.1 version of emacs which ships with Org 7.8.03.

Here's the template, which I stole from:
http://orgmode.org/worg/org-contrib/org-drill.html

(add-to-list 'org-capture-templates
 '
 (W
  Capture web snippet
  entry
  (file+headline ~/git/org/learn-emacs.org Emacs mastery)
  ,(concat * Fact: '%:description':
   (format %s org-drill-question-tag)
   :\n:PROPERTIES:\n:DATE_ADDED: %u\n:SOURCE_URL: 
%c\n:END:\n\n%i\n%?\n)

  :empty-lines 1
  :immediate-finish t))

Is there any obvious reason this template would break?

I know I could read the capture documentation further but I don't have a
few hours to spend on this right now (plus I'm extremely beginner with
lisp). But I'm pretty sure it just broke with a recent pull of emacs
without me changing any other settings.

Thanks for any help,

Damon

p.s. Here's the complete config that I used to try to debug the problem.

(require 'org-install)
(add-to-list 'auto-mode-alist '(\\.\\(org\\|org_archive\\|txt\\)$ . 
org-mode))

(global-set-key \C-ca 'org-agenda)
(global-set-key \C-cb 'org-iswitchb)
(global-set-key (kbd C-c r) 'org-capture)

;; Capture templates for: TODO tasks, Notes, appointments, phone calls, 
and org-protocol

  (setq org-capture-templates
  (quote ((t todo entry (file ~/git/org/refile.org)
   * TODO %?\n%U\n%a\n  %i :clock-in t :clock-resume t)
  (n note entry (file ~/git/org/refile.org)
   * %? :NOTE:\n%U\n%a\n  %i :clock-in t :clock-resume t)
  (j Journal entry (file+datetree ~/git/org/diary.org)
   * %?\n%U\n  %i :clock-in t :clock-resume t)
  (w org-protocol entry (file ~/git/org/refile.org)
   * TODO Review %c\n%U\n  %i :immediate-finish t)
  (p Phone call entry (file ~/git/org/refile.org)
   * PHONE %? :PHONE:\n%U :clock-in t :clock-resume t)
  (h Habit entry (file ~/git/org/refile.org)
   * NEXT %?\n%U\n%a\nSCHEDULED: %t 
.+1d/3d\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n  
%i


(add-to-list 'org-capture-templates
   '
   (W
Capture web snippet
entry
(file+headline ~/git/org/learn-emacs.org Emacs mastery)
,(concat * Fact: '%:description':
 (format %s org-drill-question-tag)
 :\n:PROPERTIES:\n:DATE_ADDED: %u\n:SOURCE_URL: 
%c\n:END:\n\n%i\n%?\n)

:empty-lines 1
:immediate-finish t))







Re: [O] leave inactive timestamp inactive

2012-01-12 Thread John Wiegley
 Michael Brand michael.ch.br...@gmail.com writes:

 When one does Shift-right on an inactive timestamp it remains
 inactive. When one does C-c . S-right RET the inactive timestamp changes
 to active but I would like it also to remain inactive. What are the opinions
 on this?

C-c . is the keystroke for inserting an active timestamp.  Why would you want
it to keep an inactive timestamp inactive?  I'd use C-c ! S-right RET to do
what you're suggesting.

John



Re: [O] Invalid capture template with pull of Org 7.8.03?

2012-01-12 Thread Nick Dokos
Damon Haley n...@vinylisland.org wrote:

 Hi I was wondering if someone could point me in the right direction
 because one of my Org capture templates, that I use to feed questions to
 myself (for later use with org-drill) just broke with the most recent
 bzr pull of emacs.
 

Probably not - see below.

 Now, when I try to use the capture template, I only get this header in
 my target org file.
 
 ** Invalid capture template
 
 I'm on the 24.0.92.1 version of emacs which ships with Org 7.8.03.
 
 Here's the template, which I stole from:
 http://orgmode.org/worg/org-contrib/org-drill.html
 
 (add-to-list 'org-capture-templates
  vvv
  ' THIS SHOULD BE A BACKQUOTE
  ^^^   
  (W
   Capture web snippet
   entry
   (file+headline ~/git/org/learn-emacs.org Emacs mastery)
   ,(concat * Fact: '%:description':
(format %s org-drill-question-tag)
:\n:PROPERTIES:\n:DATE_ADDED: %u\n:SOURCE_URL:
 %c\n:END:\n\n%i\n%?\n)
   :empty-lines 1
   :immediate-finish t))
 
 Is there any obvious reason this template would break?

You are quoting the entry but including a , before the concat. That
indicates that instead of the quote ', you need to use a backquote ` to
allow the comma to evaluate the (concat ...)  expression at definition
time.

I checked the webpage you refer to and there is a backquote there, so I
can only surmise that you changed it by mistake recently.

Nick



Re: [O] Way to replace normal tabular env with booktabs?

2012-01-12 Thread Thomas S. Dye
Hi John,

The Library of Babel comes with your Org-mode distribution.

You'll find it at /contrib/babel/library-of-babel.org

In the org file, look for 
* Tables
** LaTeX Table Export

There should be functions booktabs and booktabs-notes.

One way to use booktabs is described here:

http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-13-2

hth,
Tom

John Hendy jw.he...@gmail.com writes:

 On Thu, Jan 12, 2012 at 2:12 PM, Thomas S. Dye t...@tsdye.com wrote:

 Hi John,

 Agreed, booktabs makes good looking tables.

 Check out your Library of Babel.  There should  be a couple of functions
 there that will help you go from Org mode to booktabs.


 Haven't done much with babel other than writing code blocks. Do you mean
 this page?
 --- http://orgmode.org/worg/org-contrib/babel/library-of-babel.html

 Thanks for the suggestion. Feeling a bit lost, but am happy to look around
 for something that seems similar. I have no elisp-fu, so it'll need to be
 pretty darn similar :)


 John


 hth,
 Tom

 John Hendy jw.he...@gmail.com writes:

  Greetings,
 
 
  I was using wikibooks for some formatting assistance on tables the other
  day and ran into mention of the booktabs package in the Professional
  tables section. [1] [2]
 
  I really, really liked it's formatting, especially since one of my column
  headers was a fraction. The standard tabular package places the \hlines
  extremely close to the top and bottom of my header row vs., as the
 booktabs
  package says, having extremely nice looking spacing for the table. I
 ended
  up doing the table manually inside #+begin_latex block.
 
  Would there be any way to specify that booktabs should be used? The
  formatting is literally identical except for 1) including the booktabs
  package and 2) using \toprule, \midrule and \bottomrule instead of
 \hlines.
  In fact, even with booktabs included, if you use \hlines instead of the
  booktab specific lines, you'll get a regular tabular table.
 
  Any thoughts on this?
 
 
  Best regards,
  John
 
  -
  [1] http://en.wikibooks.org/wiki/LaTeX/Tables#Professional_tables
  [2] http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/
  Greetings,I was using wikibooks for some formatting assistance on tables
 the other day and ran into mention of the booktabs package in the
 Professional tables section. [1] [2]
  I really, really liked it#39;s formatting, especially since one of my
 column headers was a fraction. The standard tabular package places the
 \hlines extremely close to the top and bottom of my header row vs., as the
 booktabs package says, having extremely nice looking spacing for the table.
 I ended up doing the table manually inside #+begin_latex block.
  Would there be any way to specify that booktabs should be used? The
 formatting is literally identical except for 1) including the booktabs
 package and 2) using \toprule, \midrule and \bottomrule instead of \hlines.
 In fact, even with booktabs included, if you use \hlines instead of the
 booktab specific lines, you#39;ll get a regular tabular table.
  Any thoughts on this?Best regards,John-[1]
 http://en.wikibooks.org/wiki/LaTeX/Tables#Professional_tables
  [2] http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/

 --
 Thomas S. Dye
 http://www.tsdye.com

 On Thu, Jan 12, 2012 at 2:12 PM, Thomas S. Dye span 
 dir=ltrmailto:t...@tsdye.com/span wrote:
 Hi John,

 Agreed, booktabs makes good looking tables.

 Check out your Library of Babel.  There should  be a couple of functions
 there that will help you go from Org mode to booktabs.
 Haven#39;t done much with babel other than writing code blocks. Do you mean 
 this page?--- http://orgmode.org/worg/org-contrib/babel/library-of-babel.html
 Thanks for the suggestion. Feeling a bit lost, but am happy to look around 
 for something that seems similar. I have no elisp-fu, so it#39;ll need to be 
 pretty darn similar :)
 John 
 hth,
 Tom

 John Hendy mailto:jw.he...@gmail.com writes:

 Greetings,


 I was using wikibooks for some formatting assistance on tables the other
 day and ran into mention of the booktabs package in the Professional
 tables section. [1] [2]

 I really, really liked it#39;s formatting, especially since one of my column
 headers was a fraction. The standard tabular package places the \hlines
 extremely close to the top and bottom of my header row vs., as the booktabs
 package says, having extremely nice looking spacing for the table. I ended
 up doing the table manually inside #+begin_latex block.

 Would there be any way to specify that booktabs should be used? The
 formatting is literally identical except for 1) including the booktabs
 package and 2) using \toprule, \midrule and \bottomrule instead of \hlines.
 In fact, even with booktabs included, if you use \hlines instead of the
 booktab specific lines, you#39;ll get a regular tabular table.

 Any thoughts on this?


 Best regards,
 John

 -
 [1] 

Re: [O] Invalid capture template with pull of Org 7.8.03?

2012-01-12 Thread Damon Haley
Nick Dokos nicholas.do...@hp.com writes:

 You are quoting the entry but including a , before the concat. That
 indicates that instead of the quote ', you need to use a backquote ` to
 allow the comma to evaluate the (concat ...)  expression at definition
 time.

 I checked the webpage you refer to and there is a backquote there, so I
 can only surmise that you changed it by mistake recently.


Thanks Nick.

You're probably right that I changed it some time ago and thought it was
working, but it wasn't.

Glad to have it working again.

Damon

-- 
   ___ 
  /    -[]--. \ \/ I /\/ Y |_ I S |_ A |\| |}  @  ssl-mail.com   
 / ,-' `-.   \ \ Send me long text - http://www.asciiribbon.org  
/ (   o   )  _) \ http://email.is-not-s.ms 
   /   `-._,-'_ /_/-.\ \/ I /\/ Y |_ I S |_  @  jabber.sdf.org  Jabber 
me
  /  __ _  \ \/ I /\/ Y |_ I S |_  .  netlsd dot com  Check 
out my PGP key 
 /_\
 -=-=-



[O] Help with elisp function

2012-01-12 Thread Marcelo de Moraes Serpa
So, I made a small elisp function that basically creates a reference file
in my org dir and indexes it in an org file, so it can be searchable with
the agenda without the overhead of adding the file to the agenda list:

(defun create-reference-file (filename title tags) Creates a new reference
and file it
  (interactive (list
(read-string Filename: )
(read-string Title: )
(read-string Tags: )
))
  (set-buffer (get-buffer-create filename))
  (beginning-of-buffer)
  (insert (concat * tags  tags))
   ;;saves the buffer
   (when (file-writable-p filename)
  (write-region (point-min) (point-max) (concat
~/org/data/dynamic_reference/ filename .org)))
  (set-buffer (find-file-noselect ~/org/gtd/reference.org))
  (end-of-buffer)
  ;;(create-wiki-page filename)
  (insert (concat **  title   tags :reference:file:\n))
  (org-insert-time-stamp nil t nil)
  (insert \n)
  (insert (concat [[file://~/org/data/dynamic_reference/ filename
.org]]))
  (insert \n)
  (save-buffer)
  )

I'm only beginning with elisp, so bear with me...

Anyway, it works as expected, but I would like the tags prompt to be like
the prompt org uses, with tags auto-completion and adding the : :
automatically around the tags. Right now, I have to type the : around the
words.

Any hints appreciated!

Marcelo.


Re: [O] org-babel order of evaluation

2012-01-12 Thread Eric Schulte
Rick Frankel r...@rickster.com writes:

 On Thu, Jan 12, 2012 at 04:35:31PM -0600, Leo Alekseyev wrote:
  Therefore, when executing an entire buffer, there is no way to have
  the execution of a call block dependent on the prior execution of a
  source block.
 
 
  It would be better to make the dependency explicit by passing the
  results of the call line as a (potentially unused) variable to the code
  block.  For example;
 [snip]

 The problem w/ this is that the (potentially time consuming) dependent
 will be executed twice when doing a buffer eval.

  There is (at least currently) no guarantee that evaluation order will be
  buffer order.
 
 Is there some deep rationale for the current behavior that I'm not
 seeing?  Are there big obstacles to enforcing ligeral execution order?

 It's because prior to 7.8, call blocks were not executed during a
 buffer execute. The solution was to execute all the call blocks after
 executing the src block. (Eric would have to comment on how hard it
 would be to merge the two functions :).


Turns out it was not that difficult to change this behavior.  You and
Leo are both correct that in-buffer-order evaluation is more natural and
expected than the previous behavior.  I've just pushed up a fix after
which evaluating the following

#+Title: Execute all executables in Order
#+Property: results silent

#+name: foo
#+BEGIN_SRC sh :var it=one
  echo $it  debug
#+END_SRC

#+call: foo(two)

#+BEGIN_SRC sh
  echo three  debug
#+END_SRC

results in the creation of a debug file in the same directory reading;

,
| one
| two
| three
`

Thanks for bringing this up,


 rick


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


[O] all org files load :recursive?

2012-01-12 Thread Richard Riley

Coming back to org, I see Im using find-lisp-find-file to set
org-agenda-files at each emacs start.

Is there a better built in way to say load all org and gpg files under
this directory than this? I'm not sure I follow the docstring for 
org-agenda-file-regexp as I kind of hope something like 

,
| org-agenda-file-regexp is a variable defined in `org.el'.
| Its value is \\(projects|\\.org|\\.gpg\\)
`

would work, where projects is a sub dir containg org and gpg files under
org-directory. Undoubtely my escaping is all wrong again.

So, How best to achieve a recrusive load of all org and gpg files under
org-directory now? Keep using find-lisp-find-files?

thanks

r.











Re: [O] org-babel order of evaluation

2012-01-12 Thread Rick Frankel
On Thu, Jan 12, 2012 at 06:07:41PM -0700, Eric Schulte wrote:
 Rick Frankel r...@rickster.com writes:
 
 Turns out it was not that difficult to change this behavior.  You and
 Leo are both correct that in-buffer-order evaluation is more natural and
 expected than the previous behavior.  I've just pushed up a fix after
 which evaluating the following
 

Brillant! thank you Eric. This saves me much pain.

rick



[O] Referring to the Last Row of a Remote Table using @

2012-01-12 Thread Sankalp
Hi,
I have the following situation :

#+TBLNAME: Totals
|+|
| Name   | Amount |
|+|
| xyz| 90 |  *-- should evaluate to 130, not 90*
|+|
| TOTAL  ||
|+|
#+TBLFM: @2$2=remote(xyz,@$4)  *-- I'm trying to refer to the last row,
4th column in table xyz*

#+TBLNAME: xyz
|+--+--+|
| Title  | Description  | Date | Amount |
|+--+--+|
| Trichy Tickets | Trichy Gig Travel|  |   1200 |
| PAID   |  | [2011-10-16 Sun] |  -1000 |
| Blah   | Prior to Inorbit Gig | [2011-11-11 Fri] | 90 |
| InOrbit Money  | Payment for Gig  | [2011-11-11 Fri] |   -200 |
| Biryani| Al-Saba  | [2012-01-07 Sat] |120 |
| Sub| Chicken Ham  | [2012-01-12 Thu] |-75 |
| Blah   | I had asdad  | [2012-01-12 Thu] | -5 |
|+--+--+|
| TOTAL  |  |  |130 |
|+--+--+|
#+TBLFM: $4=vsum(@2..@-1)

Instead of showing 130, the formula in the Totals table is showing 90.

Upon some investigation, it becomes apparent that even though the formula *
should* point to the last row in the remote table
(value 130), @ in the remote table reference is actually evaluating to
@3 (since the current table has 3 rows) instead
of evaluating to @9 as expected (since the remote table has 9 rows).

Is this a bug? or am I making some mistake in the formula.

---
Sankalp


Re: [O] Referring to the Last Row of a Remote Table using @

2012-01-12 Thread Sankalp
Here's a screenshot, for those who cannot see the table spacing properly in
the email

http://imgur.com/4W75H

---
Sankalp


On 13 January 2012 07:42, Sankalp sankalpkh...@gmail.com wrote:

 Hi,
 I have the following situation :

 #+TBLNAME: Totals
 |+|
 | Name   | Amount |
 |+|
 | xyz| 90 |  *-- should evaluate to 130, not 90*
 |+|
 | TOTAL  ||
 |+|
 #+TBLFM: @2$2=remote(xyz,@$4)  *-- I'm trying to refer to the last row,
 4th column in table xyz*

 #+TBLNAME: xyz
 |+--+--+|
 | Title  | Description  | Date | Amount |
 |+--+--+|
 | Trichy Tickets | Trichy Gig Travel|  |   1200 |
 | PAID   |  | [2011-10-16 Sun] |  -1000 |
 | Blah   | Prior to Inorbit Gig | [2011-11-11 Fri] | 90 |
 | InOrbit Money  | Payment for Gig  | [2011-11-11 Fri] |   -200 |
 | Biryani| Al-Saba  | [2012-01-07 Sat] |120 |
 | Sub| Chicken Ham  | [2012-01-12 Thu] |-75 |
 | Blah   | I had asdad  | [2012-01-12 Thu] | -5 |
 |+--+--+|
 | TOTAL  |  |  |130 |
 |+--+--+|
 #+TBLFM: $4=vsum(@2..@-1)

 Instead of showing 130, the formula in the Totals table is showing 90.

 Upon some investigation, it becomes apparent that even though the formula
 *should* point to the last row in the remote table
 (value 130), @ in the remote table reference is actually evaluating to
 @3 (since the current table has 3 rows) instead
 of evaluating to @9 as expected (since the remote table has 9 rows).

 Is this a bug? or am I making some mistake in the formula.

 ---
 Sankalp



Re: [O] Referring to the Last Row of a Remote Table using @

2012-01-12 Thread Sankalp
Hi,
Just saw this : http://thread.gmane.org/gmane.emacs.orgmode/50991

Apologies for initiating a new thread when the issue was already being
discussed.

Sincerely,
---
Sankalp


On 13 January 2012 07:47, Sankalp sankalpkh...@gmail.com wrote:

 Here's a screenshot, for those who cannot see the table spacing properly
 in the email

 http://imgur.com/4W75H

 ---
 Sankalp



 On 13 January 2012 07:42, Sankalp sankalpkh...@gmail.com wrote:

 Hi,
 I have the following situation :

 #+TBLNAME: Totals
 |+|
 | Name   | Amount |
 |+|
 | xyz| 90 |  *-- should evaluate to 130, not 90*
 |+|
 | TOTAL  ||
 |+|
 #+TBLFM: @2$2=remote(xyz,@$4)  *-- I'm trying to refer to the last
 row, 4th column in table xyz*

 #+TBLNAME: xyz
 |+--+--+|
 | Title  | Description  | Date | Amount |
 |+--+--+|
 | Trichy Tickets | Trichy Gig Travel|  |   1200 |
 | PAID   |  | [2011-10-16 Sun] |  -1000 |
 | Blah   | Prior to Inorbit Gig | [2011-11-11 Fri] | 90 |
 | InOrbit Money  | Payment for Gig  | [2011-11-11 Fri] |   -200 |
 | Biryani| Al-Saba  | [2012-01-07 Sat] |120 |
 | Sub| Chicken Ham  | [2012-01-12 Thu] |-75 |
 | Blah   | I had asdad  | [2012-01-12 Thu] | -5 |
 |+--+--+|
 | TOTAL  |  |  |130 |
 |+--+--+|
 #+TBLFM: $4=vsum(@2..@-1)

 Instead of showing 130, the formula in the Totals table is showing 90.

 Upon some investigation, it becomes apparent that even though the
 formula *should* point to the last row in the remote table
 (value 130), @ in the remote table reference is actually evaluating to
 @3 (since the current table has 3 rows) instead
 of evaluating to @9 as expected (since the remote table has 9 rows).

 Is this a bug? or am I making some mistake in the formula.

 ---
 Sankalp





Re: [O] Using last row in remote table references

2012-01-12 Thread Sankalp
On 11 January 2012 23:04, Michael Brand michael.ch.br...@gmail.com wrote:

 Hi Phil

 On Tue, Jan 10, 2012 at 14:39, Phil (Philip) Mason
 phil.ma...@broadcom.com wrote:
  Should I be able to use @ in references to remote tables?

 Yes, this issue has been resolved by Carsten with
 release_7.7-420-g1432e4b


I'm using org 7.8.03 but the issue is still there.


   Is there a syntax I should be using if I want to get all the entries
  in a table below a certain row without explicitly entering the
  number of the last row?

 The general solution for a Calc formula is e. g. with subvec as I
 described here:
 http://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00562.html
 and in a similar sense as I described for subscr in the subsection
 Dynamic variation of ranges here:
 http://orgmode.org/worg/org-hacks.html#field-coordinates-in-formulas

 The general solution for a Lisp formula is e. g. with calc-subvector I
 guess.

 The following simpler solution is only possible when the range is
 relative to the field where the formula is evaluated in and when the
 offset to the range border is static:

 |---+-|
 | a | abc |
 | b | bcd |
 | c | cde |
 | d | |
 | e | |
 |---+-|
 #+TBLFM: @$2..@$2 = '(concat @0$1..@+2$1)

 With a remote table you can not use the simple solution.

 Michael


As mentioned in my emails a while ago, @ still evaluates to the number of
rows in the current table (from where the reference is being made) instead
of the number of rows in the remote table being referenced.

http://imgur.com/4W75H

Sincerely,
--
Sankalp


Re: [O] Using last row in remote table references

2012-01-12 Thread Michael Brand
Hi Sankalp

On Fri, Jan 13, 2012 at 04:30, Sankalp sankalpkh...@gmail.com wrote:
 I'm using org 7.8.03 but the issue is still there.

I can not reproduce with release_7.8.02-13-g0c09a.dirty:

||
| Amount |
||
|130 |
||
||
||
#+TBLFM: @2$1=remote(xyz,@$1)

#+TBLNAME: xyz
||
|   -200 |
|120 |
|-75 |
| -5 |
|130 |
||

Maybe check your Org mode installation upgrade, make etc. Search for
M-x locate-library RET org for more information.

Michael



Re: [O] leave inactive timestamp inactive

2012-01-12 Thread Michael Brand
Hi John

On Fri, Jan 13, 2012 at 00:35, John Wiegley jwieg...@gmail.com wrote:
 Why would you want it to keep an inactive timestamp inactive?

I'd like to update to today and keep inactive e. g. [2012-01-11 Wed]
just below a heading or the property :Opened: [2012-01-11 Wed] left
from a copy/paste.

 I'd use C-c ! S-right RET to do what you're suggesting.

Of course, how could I miss that... When I think of it not as an edit
but as a re-insert then C-c ! . RET becomes obvious for my use case.
Thanks for bringing my brain back to work.

Michael



[O] Question about repeating events.

2012-01-12 Thread Sam Auciello
I apologize in advance if this is the wrong forum for this question.

I'm trying to set up repeating events to stop repeating after a given
date.  In this case it's classes I'm taking this semester that need to
repeat once a week so I enter them like:

*** Programming Workshop
 2012-01-24 Tue 13:30-14:50 +1w, 2012-01-20 Fri 13:30-14:50 +1w

The agenda shows the class being scheduled each tuesday and friday but I
would like to tell it to stop repeating at the end of the semester.

I didn't see anything helpful here:
http://orgmode.org/manual/Repeated-tasks.html#Repeated-tasks

The options I see here are using C-c C-x c to make a bunch of duplicate
entries (which seems a little messy to me, but perhaps this is just how
it's done) or simply marking the item as DONE at the end of the semester.
The latter option seems a little weird to me too since it would make my
agenda for the following semester cluttered if I was looking at it to plan
future events.  Is there an option I'm overlooking?

Thank you,

Peace
~Sam


Re: [O] Using last row in remote table references

2012-01-12 Thread Sankalp
Hi Michael,

On 13 January 2012 09:21, Michael Brand michael.ch.br...@gmail.com wrote:

 Hi Sankalp

 On Fri, Jan 13, 2012 at 04:30, Sankalp sankalpkh...@gmail.com wrote:
  I'm using org 7.8.03 but the issue is still there.

 I can not reproduce with release_7.8.02-13-g0c09a.dirty:

 ||
 | Amount |
 ||
 |130 |
 ||
 ||
 ||
 #+TBLFM: @2$1=remote(xyz,@$1)

 #+TBLNAME: xyz
 ||
 |   -200 |
 |120 |
 |-75 |
 | -5 |
 |130 |
 ||

 Maybe check your Org mode installation upgrade, make etc. Search for
 M-x locate-library RET org for more information.


Turns out it was indeed the issue.
I was working on one of the machines where I still had an older version of
org.

Thanks,
---
Sankalp


[O] Bug: ob-clojure.el depends on deprecated swank-clojure [7.7]

2012-01-12 Thread Andrew Cheng


Phil Hagelberg has said that the swank-clojure elisp package has been
deprecated and should not be used [1]. My version of ob-clojure.el
requires swank-clojure. If I don't have the swank-clojure package, I
get org-babel-execute:clojure:Cannot open load file: swank-clojure.
If I follow the instructions at [2] and get the swank-clojure package,
I get past this error. Is org using a deprecated package, and is this
a bug? Thanks in advance.

[1] https://groups.google.com/forum/#!starred/clojure/HT8wixvD3GE
[2] http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00629.html

Emacs  : GNU Emacs 23.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.5)
 of 2011-08-14 on rothera, modified by Debian
Package: Org-mode version 7.7

current state:
==
(setq
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-speed-command-hook '(org-speed-command-default-hook
                          org-babel-speed-command-hook)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-babel-tangle-lang-exts '((clojure . clj) (emacs-lisp . el))
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-tab-first-hook '(org-hide-block-toggle-maybe
                      org-src-native-tab-command-maybe
                      org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
                     org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-blank-before-new-entry nil
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
                  org-cycle-show-empty-lines
                  org-optimize-window-after-visibility-change)
 org-publish-project-alist '((org-notes :base-directory /home/notroot/org/
                              :base-extension org :publishing-directory
                              /home/notroot/public_html/ :recursive t
                              :publishing-function org-publish-org-to-html
                              :headline-levels 4 :auto-preamble t)
                             (org-static :base-directory
                              /home/notroot/org/ :base-extension

css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf
:publishing-directory /home/notroot/public_html/ :recursive t
:publishing-function org-publish-attachment)
                             (org :components (org-notes org-static)))
 org-export-preprocess-before-normalizing-links-hook
'(org-remove-file-link-modifiers)
 org-mode-hook '(#[nil \300\301\302\303\304$\207
                   [org-add-hook change-major-mode-hook org-show-block-all
                    append local]
                   5]
                 #[nil \300\301\302\303\304$\207
                   [org-add-hook change-major-mode-hook
                    org-babel-show-result-all append local]
                   5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
                          org-babel-execute-safely-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-export-interblocks '((lob org-babel-exp-lob-one-liners)
                          (src org-babel-exp-inline-src-blocks))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-occur-hook '(org-first-headline-recenter)
 org-export-preprocess-before-selecting-backend-code-hook
'(org-beamer-select-beamer-code)
 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
                               org-beamer-auto-fragile-frames
                               org-beamer-place-default-actions-for-lists)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-export-blocks '((src org-babel-exp-src-block nil)
                     (comment org-export-blocks-format-comment t)
                     (ditaa org-export-blocks-format-ditaa nil)
                     (dot org-export-blocks-format-dot nil))
 )



Re: [O] Bug: ob-clojure.el depends on deprecated swank-clojure [7.7]

2012-01-12 Thread Eric Schulte
I personally no longer use Clojure (having graduated to Common Lisp :))
so I'm not abreast of the current Clojure environment.

The only function ob-clojure uses from swank-clojure is
`swank:interactive-eval-region' (used with `slime-eval') in the
`org-babel-execute:clojure' function.  Which function would now be used
to evaluate a region of clojure code?  Would `slime-eval-region'
suffice?

Thanks,

Andrew Cheng ache...@gmail.com writes:

 

 Phil Hagelberg has said that the swank-clojure elisp package has been
 deprecated and should not be used [1]. My version of ob-clojure.el
 requires swank-clojure. If I don't have the swank-clojure package, I
 get org-babel-execute:clojure:Cannot open load file: swank-clojure.
 If I follow the instructions at [2] and get the swank-clojure package,
 I get past this error. Is org using a deprecated package, and is this
 a bug? Thanks in advance.

 [1] https://groups.google.com/forum/#!starred/clojure/HT8wixvD3GE
 [2] http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00629.html

 Emacs  : GNU Emacs 23.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.5)
  of 2011-08-14 on rothera, modified by Debian
 Package: Org-mode version 7.7

 current state:
 ==
 (setq
  org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
  org-speed-command-hook '(org-speed-command-default-hook
                           org-babel-speed-command-hook)
  org-metaup-hook '(org-babel-load-in-session-maybe)
  org-after-todo-state-change-hook '(org-clock-out-if-current)
  org-babel-tangle-lang-exts '((clojure . clj) (emacs-lisp . el))
  org-export-latex-format-toc-function 'org-export-latex-format-toc-default
  org-tab-first-hook '(org-hide-block-toggle-maybe
                       org-src-native-tab-command-maybe
                       org-babel-hide-result-toggle-maybe)
  org-src-mode-hook '(org-src-babel-configure-edit-buffer
                      org-src-mode-configure-edit-buffer)
  org-confirm-shell-link-function 'yes-or-no-p
  org-export-first-hook '(org-beamer-initialize-open-trackers)
  org-agenda-before-write-hook '(org-agenda-add-entry-text)
  org-blank-before-new-entry nil
  org-babel-pre-tangle-hook '(save-buffer)
  org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
                   org-cycle-show-empty-lines
                   org-optimize-window-after-visibility-change)
  org-publish-project-alist '((org-notes :base-directory /home/notroot/org/
                               :base-extension org :publishing-directory
                               /home/notroot/public_html/ :recursive t
                               :publishing-function org-publish-org-to-html
                               :headline-levels 4 :auto-preamble t)
                              (org-static :base-directory
                               /home/notroot/org/ :base-extension

 css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf
 :publishing-directory /home/notroot/public_html/ :recursive t
 :publishing-function org-publish-attachment)
                              (org :components (org-notes org-static)))
  org-export-preprocess-before-normalizing-links-hook
 '(org-remove-file-link-modifiers)
  org-mode-hook '(#[nil \300\301\302\303\304$\207
                    [org-add-hook change-major-mode-hook org-show-block-all
                     append local]
                    5]
                  #[nil \300\301\302\303\304$\207
                    [org-add-hook change-major-mode-hook
                     org-babel-show-result-all append local]
                    5]
                  org-babel-result-hide-spec org-babel-hide-all-hashes)
  org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
                           org-babel-execute-safely-maybe)
  org-confirm-elisp-link-function 'yes-or-no-p
  org-export-interblocks '((lob org-babel-exp-lob-one-liners)
                           (src org-babel-exp-inline-src-blocks))
  org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
  org-occur-hook '(org-first-headline-recenter)
  org-export-preprocess-before-selecting-backend-code-hook
 '(org-beamer-select-beamer-code)
  org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
                                org-beamer-auto-fragile-frames
                                org-beamer-place-default-actions-for-lists)
  org-metadown-hook '(org-babel-pop-to-session-maybe)
  org-export-blocks '((src org-babel-exp-src-block nil)
                      (comment org-export-blocks-format-comment t)
                      (ditaa org-export-blocks-format-ditaa nil)
                      (dot org-export-blocks-format-dot nil))
  )


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