[O] Re: [Orgmode] [babel] some lisp/slime progress

2011-03-31 Thread Eric Schulte
Hi Erik,

I've had an opportunity to return to Babel support for common lisp
recently.  I just copied over the existing ob-clojure.el file to
ob-lisp.el and changed the clojure/swank specific parts.  The resulting
file seems to work after some initial tests and is exceedingly simple.

If this works for you as well, then I'd propose replacing the existing
ob-lisp.el with this new implementation.

Please let me know what you think.

Thanks -- Eric



ob-lisp.el
Description: application/emacs-lisp

Erik Iverson er...@ccbr.umn.edu writes:

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

 #+begin_src emacs-lisp :session

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

 #+end_src

 #+results:
 : test2 value

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

 #+begin_src lisp :session

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

 #+end_src

 #+results:
 : test2 value

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


[O] Re: [Orgmode] [babel] some lisp/slime progress

2011-03-31 Thread Eric Schulte
This newly attached version includes some slight improvements over the
previous, namely,

- support for declaring the CL package in which evaluation takes place
- support for the :results output header argument
- and better handling of non-elisp-parsable results.

Best -- Eric



ob-lisp.el
Description: application/emacs-lisp

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

 Hi Erik,

 I've had an opportunity to return to Babel support for common lisp
 recently.  I just copied over the existing ob-clojure.el file to
 ob-lisp.el and changed the clojure/swank specific parts.  The resulting
 file seems to work after some initial tests and is exceedingly simple.

 If this works for you as well, then I'd propose replacing the existing
 ob-lisp.el with this new implementation.

 Please let me know what you think.

 Thanks -- Eric



 Erik Iverson er...@ccbr.umn.edu writes:

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

 #+begin_src emacs-lisp :session

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

 #+end_src

 #+results:
 : test2 value

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

 #+begin_src lisp :session

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

 #+end_src

 #+results:
 : test2 value

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


[O] Re: Using babel to generate a commit log

2011-03-31 Thread Luke Crook
Eric Schulte schulte.eric at gmail.com writes:

 Since this could be generally useful would you be willing to add it to
 the library of babel (org/contrib/babel/library-of-babel.org)?  

That would be great.

 If so then if you could supply a few explanatory sentences, I'll add those and
 the code block to the library-of-babel.org distributed with Org-mode.

This function will attempt to retrieve the entire commit log for the file 
associated with the current buffer and insert this log into the export. The 
function uses the Emacs VC commands to interface to the local version control 
system, but has only been tested to work with Git. 'limit' is currently 
unsupported.

-Luke




Re: [O] [BABEL][BUG] Tangle incorrect with variables

2011-03-31 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 30/03/11 22:17, Eric Schulte wrote:
 Hi Rainer,
 
 When I tangle this code block (just slightly reformatted for my own
 readability)
 
 #+headers: :var STATE=(vc-state (or (buffer-file-name) 
 org-current-export-file))
 #+headers: :var REV=(vc-working-revision (or (buffer-file-name) 
 org-current-export-file))
 #+begin_src sh :tangle yes
   rm -rf ./R
   rm -f ./spreadSim.sub
   REVISION=$REV.$STATE
   tar -xf nsa.$REVISION.tar.gz
   $HOME/R/R/R-2.12.0/bin/Rscript --vanilla -e
 source('./R/generateLatinHypercubeScenarios.R'); doIt()
   for SCENARIO in ./R/scenarios/*.R; do
 export SCENARIO=${SCENARIO#./R/scenarios/}
 qsub nsa.sub
   done
 #+end_src
 
 I get the following tangled output
 
 --8---cut here---start-8---
 
 REV=$(cat 'BABEL_TABLE'
 master
 BABEL_TABLE
 )
 STATE=$(cat 'BABEL_TABLE'
 edited
 BABEL_TABLE
 )
   rm -rf ./R
   rm -f ./spreadSim.sub
   REVISION=$REV.$STATE
   tar -xf nsa.$REVISION.tar.gz
   $HOME/R/R/R-2.12.0/bin/Rscript --vanilla -e
 source('./R/generateLatinHypercubeScenarios.R'); doIt()
   for SCENARIO in ./R/scenarios/*.R; do
 export SCENARIO=${SCENARIO#./R/scenarios/}
 qsub nsa.sub
   done
 --8---cut here---end---8---
 
 Which looks right to me.  Could it be something specific about your
 setup which is causing this issue?

Sorry - I did not relize that the way the variables are inserted has
changed - I should have tried the script before asking. It works fine.

Sorry about the noise.

By the way: using
#+headers:
makes the source look much nicer - never used it before, but will
definitely us it now.

Cheers,

Rainer

 
 Cheers -- Eric
 
 Rainer M Krug r.m.k...@gmail.com writes:
 
 Hi

 when I tangle this document, I get the results in the section below.
 This is obviously not correct. This worked in an earlier version.

 Any help appreciated,

 Rainer


 * Run script (./../nsa.sh)
 :PROPERTIES:
 :tangle:   ./nsa.sh
 :exports: code
 :END:
 ** Update and call submit script
 :PROPERTIES:
 :ID: 173c527a-b032-4cc5-89d8-a32c3c0c7cae
 :END:
 #+BEGIN_SRC sh  :var REV=(vc-working-revision (or (buffer-file-name)
 org-current-export-file)) :var STATE=(vc-state (or (buffer-file-name)
 org-current-export-file))
   rm -rf ./R
   rm -f ./spreadSim.sub
   REVISION=$REV.$STATE
   tar -xf nsa.$REVISION.tar.gz
   $HOME/R/R/R-2.12.0/bin/Rscript --vanilla -e
 source('./R/generateLatinHypercubeScenarios.R'); doIt()
   for SCENARIO in ./R/scenarios/*.R; do
 export SCENARIO=${SCENARIO#./R/scenarios/}
 qsub nsa.sub
   done
 #+END_SRC

 * tangled
 #+begin_example
 #!/bin/bash
 REV=$(cat 'BABEL_TABLE'

 BABEL_TABLE
 )
 STATE=$(cat 'BABEL_TABLE'

 BABEL_TABLE
 )
 rm -rf ./R
 rm -f ./spreadSim.sub
 REVISION=$REV.$STATE
 tar -xf nsa.$REVISION.tar.gz
 $HOME/R/R/R-2.12.0/bin/Rscript --vanilla -e
 source('./R/generateLatinHypercubeScenarios.R'); doIt()
 for SCENARIO in ./R/scenarios/*.R; do
   export SCENARIO=${SCENARIO#./R/scenarios/}
   qsub nsa.sub
 done
 #+end_example


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

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:+33 - (0)9 53 10 27 44
Cell:   +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:  rai...@krugs.de

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

iEYEARECAAYFAk2UJOQACgkQoYgNqgF2egqJoACdHYVLbcjry1IPk13AhG7zIrKX
khkAnA0UVYgHnAsDDVSwTpdMKcECcrm3
=iPKh
-END PGP SIGNATURE-



Re: [O] Re: Test framework needed

2011-03-31 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 31/03/11 05:40, Eric Schulte wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 
 On Wed, 30 Mar 2011 15:42:19 -0600
 Eric Schulte schulte.e...@gmail.com wrote:


 This suite should actually be updated with effectively each patch
 which introduces new features and run after each patch.
  

 Agreed, in a perfect world...


 So is it only necessary to add meat to this framework?
  

 Yes, I believe the best way forward would be to add tests to the
 existing framework.

 I have a possibly completely useless idea regarding automatically
 checking regressions. As far I understand the problem now is its not
 very feasible to do automated tests with what ever test suite we have
 (or will have after the improvements) and see the exported results for
 each patch, as at some step it involves human intervention (as in, was
 the export good).

Good or not good is subjective - but *consistent* is not - and
consistency is important. Even if I do not like the default LaTeX output
from org, I can tweak it, but there is a problem if there are unexpected
changes in the export, which break my customizations or make it
difficult to recreate old documents, especially if these changes are not
documented.


 
 I would disagree that we need user interaction in the test suite.  There
 are already fully automated tests which (e.g., export to some backend
 like html or tex and then programatically check for properties of the
 exported results.

Exactly - the tests is R work this way: you have some code which is
executed, and then the resulting *output* is redirected into a file.
these results are then compared to a reference output, and if they are
not *identical* an error is raised.

Similar could be done in org: export to LaTeX should always result in
the same output, unless a change is intended (e.g. additional headers,
improvements, ...). So one could compare the resulting .tex file with a
reference .tex file for this test automatically, without user intervention.

 
 It is certainly likely that I am missing something, but I can't think of
 a situation or a feature of Org-mode which could not be tested under the
 current setup (mainly due to the fact that *every* user action in Emacs
 reduces to a series of function calls which could be programatically
 recreated).
 

 So maybe we can have a directory on the Worg website (not part of the
 Worg git repo) where every week or so the test suites will publish with
 what ever the org-mode head is at the time for all the supported
 formats. Then us puny lisp illiterate users can check up on it over
 the course of the week and report back to the list if there is a
 problem.

 Since this way people can look at the export formats they are
 interested in, none of the formats get treated like a step child
 either. Would that be feasible? Or did I completely misunderstand the
 problem at hand?
 
 I'd think that a better way for contributing to the test suite in a
 non-lisp manner would be to submit test cases, e.g. this block of
 Org-mode text should export to this but sometimes instead exports to
 this, or when I press this key sequence in this place in this org-mode
 text I expect x to happen to the text.

Correct - this is what we would, in addition to programmatic tests of
individual functions, need. I would actually say that the exports /
tangling / agendas / ... are the possibly the more important test cases,
as they 1) only show in a later stage of ones project, and 2) errors in
functions are easily detected by users and reported - and fizxed quite
quickly and finally 3) I guess an export / ... includes quite a lot of
functions, which are therefore tested as well (kind off...).

 
 We could even potentially leverage the existing Emacs macro system to
 build a *record* method so that users could semi-automatically record
 their actions allowing an interactive method of recording tests (or
 submitting a re-creatable bug report).  Or at least recording enough
 information so that someone with a little bit more elisp-fu could wrap
 the recorded actions into a unit test.

That would be brilliant. Like the error reporting:

atach the current buffer, record what was done and *the individual
configuration of org / emacs* and finally email / upload it to an
address, where it is automatically added to other submitted test cases,
might bring us a long way closer to an very useful test base. I am
actually ot aware of any other test framework, which let's normal
users submit test cases via email / internet - I think that would be a
very useful addition.


 
 Hope this is helpful -- Eric

Most definitely,

Rainer

 


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

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:+33 - (0)9 53 10 27 44
Cell:   +27 - 

Re: [O] Perl parser, some questions

2011-03-31 Thread Eric S Fraga
Steven Haryanto stevenharya...@gmail.com writes:

 Hi all,

 I'm writing an Org parser for Perl[1]. There are a few things about the
 syntax which are still unclear to me.

 1. The manual says that multiple (different) in-buffer settings can be
 specified on the same line, but so far I haven't found such example
 anywhere. What is the syntax for this?

If you are referring to lines like this one:

#+OPTIONS: oddeven hideblocks

the syntax is space separated options.

I cannot really help you with the rest of your questions unfortunately.
I do think you may end up getting a little frustrated in the near
future: org has grown organically and so doesn't have a well defined
or consistent syntax across all the features.  This is not a criticism
of org mode, by the way... just an observation!

The only real definition of the syntax is the (ever changing) emacs lisp
code that implements it.

What is the main purpose of your parser?

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.122.g2f72.dirty)



Re: [O] Perl parser, some questions

2011-03-31 Thread Eric S Fraga
Steven Haryanto stevenharya...@gmail.com writes:

[...]

From the manual (emphasis mine): *Several setting words* can be in the same
 line, but you can also have multiple lines for the keyword. So I guess
 setting words mean setting's arguments (and not setting names, like
 specifying OPTIONS and TODO on the same line)?

Yes, I think the manual is trying to say that you can have
multiple #+OPTIONS: lines, say, each of which may have one or more
settings (tags:, t:, toc:, ...).

 What is the main purpose of your parser?


 I first wrote it because I thought it would be fun, and CPAN does not have
 one already. The parser converts Org document into a tree of node objects,
 and can be a base for other efforts, like exporter to HTML/TXT/POD.

I asked because org has multiple uses, from outliner through to project
management, and it may help to concentrate on one particular aspect...

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.122.g2f72.dirty)



Re: [O] Perl parser, some questions

2011-03-31 Thread Steven Haryanto
On Thu, Mar 31, 2011 at 3:21 PM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 Steven Haryanto stevenharya...@gmail.com writes:

  Hi all,
 
  I'm writing an Org parser for Perl[1]. There are a few things about the
  syntax which are still unclear to me.
 
  1. The manual says that multiple (different) in-buffer settings can be
  specified on the same line, but so far I haven't found such example
  anywhere. What is the syntax for this?

 If you are referring to lines like this one:

 #+OPTIONS: oddeven hideblocks

 the syntax is space separated options.


From the manual (emphasis mine): *Several setting words* can be in the same
line, but you can also have multiple lines for the keyword. So I guess
setting words mean setting's arguments (and not setting names, like
specifying OPTIONS and TODO on the same line)?


 What is the main purpose of your parser?


I first wrote it because I thought it would be fun, and CPAN does not have
one already. The parser converts Org document into a tree of node objects,
and can be a base for other efforts, like exporter to HTML/TXT/POD.

--
sh


Re: [O] advice re organizing todo agenda items

2011-03-31 Thread Filippo A. Salustri
Samuel  Nick,

I'm using priorities now, but there's only 3 of 'em.  I would prefer
finer control over them if I were to continue using priorities in this
way.

Q: My reading of the doc is that there's no way to change the number
of priorities org supports: we're stuck with A/B/C.  Right?

Tags may work, but will require more updating than I would prefer.
I come from the world of iPhone apps, and it's quite popular to have
apps that let you cycle through a list of items - essentially a
circular list.
It's also a foundation of Forster's Autofocus task management methods.

I'll take all this under advisement and see what I can think of.

Thanks!
Cheers.
Fil

On 30 March 2011 23:34, Samuel Wales samolog...@gmail.com wrote:
 Yes, use tags, then use a custom sort.  Or, if you do not use
 priorities for local sorting, use priorities.




-- 
Filippo A. Salustri, Ph.D., P.Eng.
Mechanical and Industrial Engineering
Ryerson University
350 Victoria St, Toronto, ON
M5B 2K3, Canada
Tel: 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salus...@ryerson.ca
http://deseng.ryerson.ca/~fil/



Re: [O] advice re organizing todo agenda items

2011-03-31 Thread Steven Haryanto
On Thu, Mar 31, 2011 at 5:11 PM, Filippo A. Salustri salus...@ryerson.cawrote:

 Samuel  Nick,

 I'm using priorities now, but there's only 3 of 'em.  I would prefer
 finer control over them if I were to continue using priorities in this
 way.

 Q: My reading of the doc is that there's no way to change the number
 of priorities org supports: we're stuck with A/B/C.  Right?


I believe you can change the list of priorities with this setting (which you
put in your Org file):

#+PRIORITIES: Low M High Whatever ...

PS: Sorry for the double reply. I usually subscribe to mailing lists which
set its Reply-To to list.

HTH,
Steven


[O] Bug: Bug in editing table.el tables [7.5 (release_7.5.36.g4e24)]

2011-03-31 Thread Shaun Johnson


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

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

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


Editing a table.el table (via C-c ') causes the table to migrate to
the right and also moves any following heading to the right.

The attached t.org is a test file containing a table.el table,
t1.org is the result of editing the table.

Shaun.


Emacs  : GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600)
 of 2011-03-10 on 3249CTO
Package: Org-mode version 7.5 (release_7.5.36.g4e24)

current state:
==
(setq
 org-emphasis-alist '((* bold b /b) (/ italic i /i)
  (_ underline span style=\text-decoration:underline;\ 
/span)
  (= org-code code /code verbatim)
  (~ org-verbatim code /code verbatim))
 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-agenda-files '(e:/Home/Shaun/Org/personal.org 
~/Play/Alexandria/alexandria.org
e:/Home/Shaun/Org/Farrers.org 
e:/Home/Shaun/Org/ScottishWater.org
e:/Home/Shaun/Org/TEV.org e:/Home/Shaun/Org/Tesco.org
e:/Home/Shaun/Org/general.org e:/Home/Shaun/Org/hoj.org
e:/Home/Shaun/Org/thor.org e:/Home/Shaun/Org/Sincal.org)
 org-agenda-include-diary t
 org-src-fontify-natively t
 org-clock-into-drawer CLOCK
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-id-method 'org
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-log-note-clock-out t
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-hide-emphasis-markers t
 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-directory ~/Org
 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-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-emphasis-regexp-components '(('\ - .,:?;'\)_ 
\n,\' . 1)
 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-occur-hook '(org-first-headline-recenter)
 org-export-preprocess-before-selecting-backend-code-hook 
'(org-beamer-select-beamer-code)
 org-modules '(org-bbdb org-bibtex org-gnus org-id org-info org-jsinfo org-irc 
org-mew org-mhe
   org-rmail org-vm org-wl org-w3m)
 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))
 )
* A table

+---+---+---+---+---+
|   |   |   |   |   |
+---+---+---+---+---+
|   |   |   |   |   |
+---+---+---+---+---+

* Another heading
  Blah

* A table

  +-+---+---+---+---+
  |abced|   |   |   |   |
  +-+---+---+---+---+
  | |   |   |   |   |
  +-+---+---+---+---+
  
  * Another heading
  Blah



[O] Re: zotero (or mendeley) integration with org

2011-03-31 Thread Stephen Eglen

 Agreed. Google Scholar citations need very close proofreading, as they
 can be erroneous or poorly formatted. 

Thanks Matt - I'd agree with this, having seen oddities from google
scholar.  I emailed them ages ago about one problem (formatting of
initials in author names), but never heard back... it is a pity that
there is no mechanism for tidying up their references, as it seems to be
the best thing out there that covers all the fields.

Having said that, if google scholar can save me some typing, I'll
happilyuse it as a starting point for a bibtex entry.  I've just started
using pdfmeat -- this is nice, as given a pdf, it outputs the
corresponding bibtex entry from google scholar.  Probably works similar
to the way zotero does it, but can be used straight from the command
line:

  http://code.google.com/p/pdfmeat/

(Warning: I couldn't get one of the python dependencies, unidecode, to
work on mac, but it does work on ubuntu for me.)

 accessed by bibsnarf are limited to math and sciences. Since I use
 biblatex together with the Chicago Manual of Style, any bibtex entry I
 clip has to be edited and tweaked substantially. (Indeed, manual editing
 is unavoidable when using biblatex.)

If its not too tangential, why do you use biblatex -- is it the future
for bibtex?

Thanks for summarising your workflow, very helpful.

Stephen




[O] Re: Timer mode doesn't hyphenate correctly

2011-03-31 Thread Nicolas
Hello,

Mark S throa...@yahoo.com writes:

 Hello Matt,

 --- On Wed, 3/30/11, Matt Lundin m...@imapmail.org wrote:

I cannot reproduce this.
All of the following timer items were entered quickly using
 M-Tab:
  - 0:01:04 :: An item
   - 0:01:07 :: Another item
   - 0:01:10 :: Yet another


 It appears that you can get different results depending on how you
 start the timer and whether there are prior entries there. Basically,
 you need to start on a blank line with no prior timing entries. If you
 start your timer, either with C-c C-x 0 or with C-c C-x - with prior
 timer entries, you are likely to get the results I described before
 (double hyphens), or error messages (not a timer list).

 So to people who know the right incantation, I suppose it looks ok.
 But if you take even a slight detour you may get some strange results.

 Maybe there should be a bit more warning in the manual. But now that
 I've worked out the land-mines, I'm sure its going to be very useful.

I cannot reproduce what you are describing. I may be misunderstanding
you. Could you please post an ECM for that?

Regards,

-- 
Nicolas



Re: [O] advice re organizing todo agenda items

2011-03-31 Thread T Helms


On 03/31/2011 06:41 AM, Steven Haryanto wrote:
On Thu, Mar 31, 2011 at 5:11 PM, Filippo A. Salustri 
salus...@ryerson.ca mailto:salus...@ryerson.ca wrote:


Samuel  Nick,

I'm using priorities now, but there's only 3 of 'em.  I would prefer
finer control over them if I were to continue using priorities in this
way.

Q: My reading of the doc is that there's no way to change the number
of priorities org supports: we're stuck with A/B/C.  Right?

I believe you can change the list of priorities with this setting 
(which you put in your Org file):


#+PRIORITIES: Low M High Whatever ...

PS: Sorry for the double reply. I usually subscribe to mailing lists 
which set its Reply-To to list.


HTH,
Steven


You can change it globally through M-x customize-group RET org-priorities

I use 1-9 for finer control, it looks like you could go crazy with it if 
you really wanted!


Tracy


[O] Question about org-new-numbered-item

2011-03-31 Thread Matt Lundin
Hi Carsten,

I noticed you have added a new function to org.el called
org-new-numbered-item, which inserts items like this:

* TODO Action #1:#1:
* TODO Action #2:#2:

I'd be curious to learn more about possible uses for this feature. For
instance, if one reorganizes items, will the actions be renumbered? Do
you envision additional functionality beyond inserting an incremental
string and tag when inserting a new item? In my own experience, todos
generated when taking notes often have to be reordered and tagged after
the fact. How might this interact with the functionality already offered
by enumerated lists? For instance, might it be helpful to be able to
convert a list to a set of enumerated todos and vice versa?

Thanks in advance for entertaining these questions born of brainstorming
and curiosity! 

Best,
Matt








[O] Re: Question about org-new-numbered-item

2011-03-31 Thread Carsten Dominik
Hi Matt,

On Mar 31, 2011, at 3:31 PM, Matt Lundin wrote:

 Hi Carsten,
 
 I noticed you have added a new function to org.el called
 org-new-numbered-item, which inserts items like this:
 
 * TODO Action #1:#1:
 * TODO Action #2:#2:
 
 I'd be curious to learn more about possible uses for this feature. For
 instance, if one reorganizes items, will the actions be renumbered?

No.  The purpose is exactly to have the old numbers retained
when moving and reorganizing them - a task not well served
by ordered lists.

 Do
 you envision additional functionality beyond inserting an incremental
 string and tag when inserting a new item? In my own experience, todos
 generated when taking notes often have to be reordered and tagged after
 the fact. How might this interact with the functionality already offered
 by enumerated lists? For instance, might it be helpful to be able to
 convert a list to a set of enumerated todos and vice versa?
 
 Thanks in advance for entertaining these questions born of brainstorming
 and curiosity! 


Maybe you can first look at the tutorial which explains how
I am using this.  The function was added to minimize setup
required for this particular use case.

http://orgmode.org/worg/org-tutorials/org-meeting-tasks.html

When you have read this, I am happy to brainstorm more about this
and see if there are other contexts where this might be useful.

- Carsten






Re: [O] advice re organizing todo agenda items

2011-03-31 Thread Filippo A. Salustri
I just found org-{lowest,highest,default}-priority before coming to
work; didn't have time to post about them.  These do in fact let one
change the number of priorities.

I think, for now at least, I fall into the go crazy category.  I
range my priorities from A to Z. Hopefully I'll find a less expansive
way of doing it.

Cheers.
Fil

On 31 March 2011 08:18, T Helms maxco...@gmail.com wrote:

 On 03/31/2011 06:41 AM, Steven Haryanto wrote:

 On Thu, Mar 31, 2011 at 5:11 PM, Filippo A. Salustri salus...@ryerson.ca
 wrote:

 Samuel  Nick,

 I'm using priorities now, but there's only 3 of 'em.  I would prefer
 finer control over them if I were to continue using priorities in this
 way.

 Q: My reading of the doc is that there's no way to change the number
 of priorities org supports: we're stuck with A/B/C.  Right?


 I believe you can change the list of priorities with this setting (which you
 put in your Org file):
 #+PRIORITIES: Low M High Whatever ...
 PS: Sorry for the double reply. I usually subscribe to mailing lists which
 set its Reply-To to list.
 HTH,
 Steven

 You can change it globally through M-x customize-group RET org-priorities

 I use 1-9 for finer control, it looks like you could go crazy with it if you
 really wanted!

 Tracy




-- 
Filippo A. Salustri, Ph.D., P.Eng.
Mechanical and Industrial Engineering
Ryerson University
350 Victoria St, Toronto, ON
M5B 2K3, Canada
Tel: 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salus...@ryerson.ca
http://deseng.ryerson.ca/~fil/



[O] Re: Question about org-new-numbered-item

2011-03-31 Thread Matt Lundin
Carsten Dominik carsten.domi...@gmail.com writes:

 On Mar 31, 2011, at 3:31 PM, Matt Lundin wrote:

 Hi Carsten,
 
 I noticed you have added a new function to org.el called
 org-new-numbered-item, which inserts items like this:
 
 * TODO Action #1:#1:
 * TODO Action #2:#2:
 
 I'd be curious to learn more about possible uses for this feature. For
 instance, if one reorganizes items, will the actions be renumbered?

 No.  The purpose is exactly to have the old numbers retained
 when moving and reorganizing them - a task not well served
 by ordered lists.

Great. That makes sense. Thanks!

 Thanks in advance for entertaining these questions born of
 brainstorming and curiosity!

 Maybe you can first look at the tutorial which explains how
 I am using this.  The function was added to minimize setup
 required for this particular use case.

 http://orgmode.org/worg/org-tutorials/org-meeting-tasks.html

 When you have read this, I am happy to brainstorm more about this
 and see if there are other contexts where this might be useful.

Very informative and thorough. Thanks for sharing your workflow here!

I should have checked Worg first, knowing how efficiently and thoroughly
you get things done. :)

When I saw the new functions I thought they might be the beginnings of a
more generalized syntax for creating enumerated headlines. After reading
the tutorial, I think a better description would be helper functions
that support a workflow for taking meeting notes. I.e., the incremental
tags are not part of official org-mode syntax in the same way that,
say, priority cookies are. I can also see how automatic renumbering
would not be helpful in this context.

Best,
Matt



[O] syntax highlighting for latex elements

2011-03-31 Thread Chris Beard
Hello,
After learning that I can output my Org documents (with tables,
outlined notes and all!) into LaTeX, I've started writing some notes
with the intention of exporting them to LaTeX. So I've been typing
stuff like (sorry, I'm not sure about the standard for formatting code
for emails):


This equation does such and such:
\begin{equation}
  F_2(s) = \frac{r_1}{s+2} + \frac{r_2}{s+4} + \frac{r_3}{s+6},
\end{equation}
And this equation is used to find...



This stuff outputs fine to tex files, but one thing I'd like is LaTeX
syntax highlighting for things like \begin{...}\frac{...}\end{}. I can
get highlighting in code source blocks, but that gets exported in
verbatim environments in the LaTeX output. If I want syntax
highlighting for these things, should I just be editing a standard
.tex file with the appropriate emacs mode, or is there a (hopefully
simple) way to turn on syntax highlighting for LaTeX elements in
standard org-mode?

Thank you
Chris



Re: [O] syntax highlighting for latex elements

2011-03-31 Thread Eric S Fraga
Chris Beard wcbear...@wabash.edu writes:

 Hello,
 After learning that I can output my Org documents (with tables,
 outlined notes and all!) into LaTeX, I've started writing some notes
 with the intention of exporting them to LaTeX. So I've been typing
 stuff like (sorry, I'm not sure about the standard for formatting code
 for emails):

[...]

 This stuff outputs fine to tex files, but one thing I'd like is LaTeX
 syntax highlighting for things like \begin{...}\frac{...}\end{}. I can
 get highlighting in code source blocks, but that gets exported in
 verbatim environments in the LaTeX output. If I want syntax
 highlighting for these things, should I just be editing a standard
 .tex file with the appropriate emacs mode, or is there a (hopefully
 simple) way to turn on syntax highlighting for LaTeX elements in
 standard org-mode?

 Thank you
 Chris

You can enclose the latex:

#+begin_latex
 \begin{equation}
   F_2(s) = \frac{r_1}{s+2} + \frac{r_2}{s+4} + \frac{r_3}{s+6},
 \end{equation}
#+end_latex

Then, with point within this block, you can type C-c ' which will allow
you to edit the latex in a latex-mode buffer with proper fontification.

For source code blocks, you should be able to tell it to export the code
as latex:

#+begin_src latex :exports results :results latex
 \begin{equation}
   F_2(s) = \frac{r_1}{s+2} + \frac{r_2}{s+4} + \frac{r_3}{s+6},
 \end{equation}
#+end_src

and you will get fortification within org-mode if you set
org-src-fontify-natively to be t.  However, there are (currently) some
performance issues with this approach.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.122.g2f72.dirty)



[O] broken link at orgmode.org

2011-03-31 Thread Rustom Mody
In http://orgmode.org/index.html#sec-4
there is this line
... latest released manuals (currently for Org 7.5), please browse
this directory.

The 'this directory' link seems to be broken



[O] Re: [BABEL][BUG] Tangle incorrect with variables

2011-03-31 Thread Sébastien Vauban
Hi Rainer,

Rainer M Krug wrote:
 I get the following tangled output
 
 --8---cut here---start-8---
 
 REV=$(cat 'BABEL_TABLE'
 master
 BABEL_TABLE
 )
 STATE=$(cat 'BABEL_TABLE'
 edited
 BABEL_TABLE
 )
   rm -rf ./R
   rm -f ./spreadSim.sub
   REVISION=$REV.$STATE
   tar -xf nsa.$REVISION.tar.gz
   $HOME/R/R/R-2.12.0/bin/Rscript --vanilla -e
 source('./R/generateLatinHypercubeScenarios.R'); doIt()
   for SCENARIO in ./R/scenarios/*.R; do
 export SCENARIO=${SCENARIO#./R/scenarios/}
 qsub nsa.sub
   done
 --8---cut here---end---8---
 
 Which looks right to me.  Could it be something specific about your
 setup which is causing this issue?

 Sorry - I did not relize that the way the variables are inserted has
 changed - I should have tried the script before asking. It works fine.

For my own understanding, could you explicit what you consider as changed in
the way the variables are inserted?

Best regards,
  Seb

-- 
Sébastien Vauban




[O] Bug: org-export-html-protect-char-alist type def [7.5]

2011-03-31 Thread Michael Heerdegen

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

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

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


Hello,

I use the ELPA built of orgmode.


M-x customize-variable org-export-html-protect-char-alist RET

gives an error.  I guess its custom type definition is illegal:

  :type '((repeat (cons (string :tag Character)
(string :tag HTML equivalent

Emacs  : GNU Emacs 23.2.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2010-12-11 on raven, modified by Debian
Package: Org-mode version 7.5



[O] Re: Bug: Jumping to date in custom agenda looses starting day of week

2011-03-31 Thread Matt Lundin


Sébastien Vauban wxhgmqzgwmuf-genee64ty+gs+fvcfc7...@public.gmane.org
writes:

 Hi Bernt,

 Bernt Hansen wrote:
 I can move forwards and backwards one day at a time with 'f' and 'b' and it
 works great. If however I want to jump to a specific date the block view is
 lost and it reverts back to the regular calendar agenda view.

 In the same spirit, I would add another point: if you have a view with
 starting day (of the week) on Monday:

 (C Weekly appointments
  agenda 
  ((org-agenda-ndays 7)
   (org-agenda-start-on-weekday 1)
   (org-agenda-time-grid nil)
   (org-agenda-prefix-format   %12:t )
   (org-agenda-include-all-todo nil)
   (org-agenda-repeating-timestamp-show-all t)
   (org-agenda-skip-function
'(org-agenda-skip-entry-if 'deadline 'scheduled


[An aside: Setting org-agenda-entry-types to '(:timestamp :sexp) is
faster than using an org-agenda-skip-function here.]

 and jump to a Thursday, then the new 7-days view is beginning on Thursday
 (which is my global setting), instead of keeping the Monday.

I can confirm this. 

Moreover, I find that my custom settings for org-agenda-entry-types are
ignored and org-agenda-span are discarded when jumping to a date. The
following custom command displays a weekly calendar.

--8---cut here---start-8---
(cc Calendar agenda 
 ((org-agenda-span 'week)
  (org-agenda-start-on-weekday 0)   ; start on Sunday
  (org-agenda-time-grid nil)
  (org-agenda-prefix-format  %-12:t )
  (org-deadline-warning-days 0)
  (org-agenda-include-all-todo nil)
  (org-agenda-repeating-timestamp-show-all t)
  (org-agenda-filter-preset '(-nocal1))
  (org-agenda-hide-tags-regexp .*)
  ))
--8---cut here---end---8---

My default org-agenda-span is 'day.

If I jump to Thursday, I get a standard one-day agenda view, which
includes all the org-agenda-entry-types (deadline, schedule, etc.). 

If I then refresh the agenda view, the deadline and schedule items
disappear, but the agenda remains limited to the default span (day)
instead of the custom span (week).

 What I would find logical is to keep this setting active for the jump.

A quick check of the git history reveals that org-agenda-goto-date has
*always* been rather basic. It simply calls org-agenda-list for the date
in question. Unlike org-agenda-goto-today, it pays no attention to the
local settings for the current agenda.

Best,
Matt




[O] question about agendas

2011-03-31 Thread Filippo A. Salustri
Hi all,
I'm looking to customize how some agenda commands work.
The simple example I'm working on is combining changing a task's
priority AND refreshing the agenda.

What I'd normally do is:
1. cursor to the task of interest,
2. change its priority,
3. refresh the agenda.

After step 3, the cursor remains where it was in step 2.  That's fine.

Then I rebind , in org-agenda-mode-map to this:
(defun org-fas-agenda-priority (optional p)
  Change the priority of the current item, then refresh agenda.
  (interactive)
  (save-excursion
(if (org-agenda-priority p)
(org-agenda-redo

When this function runs, it does exactly what I want it to do.

BUT the cursor jumps to row one of the agenda buffer.

Can anyone suggest a cause and a fix?

Cheers.
Fil

-- 
Filippo A. Salustri, Ph.D., P.Eng.
Mechanical and Industrial Engineering
Ryerson University
350 Victoria St, Toronto, ON
M5B 2K3, Canada
Tel: 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salus...@ryerson.ca
http://deseng.ryerson.ca/~fil/



Re: [O] question about agendas

2011-03-31 Thread Nick Dokos
Filippo A. Salustri salus...@ryerson.ca wrote:

 Hi all,
 I'm looking to customize how some agenda commands work.
 The simple example I'm working on is combining changing a task's
 priority AND refreshing the agenda.
 
 What I'd normally do is:
 1. cursor to the task of interest,
 2. change its priority,
 3. refresh the agenda.
 
 After step 3, the cursor remains where it was in step 2.  That's fine.
 
 Then I rebind , in org-agenda-mode-map to this:
 (defun org-fas-agenda-priority (optional p)
   Change the priority of the current item, then refresh agenda.
   (interactive)
   (save-excursion
 (if (org-agenda-priority p)
   (org-agenda-redo
 
 When this function runs, it does exactly what I want it to do.
 
 BUT the cursor jumps to row one of the agenda buffer.
 
 Can anyone suggest a cause and a fix?
 

I don't understand it yet, but can you try without the save-excursion
and see if it does what you want?

Nick



Re: [O] question about agendas

2011-03-31 Thread Filippo A. Salustri
Nick,
Thanks for the quick reply.

I'd actually started with a similar wrapper for org-priority, and the
save-excursion was needed because the org-agenda-redo would punt me
into the agenda from whatever other buffer I was in.

I carried the save-excursion into the agenda version of the function
because I thought it couldn't hurt.

Apparently it does.

Removing the save-excursion from the defun below fixes the cursor problem.
...could it be because the excursion is saved before the agenda buffer
is rebuilt?

Anyways, it's fixed, so I'm happy.
Thanks!
Cheers.
Fil

On 31 March 2011 14:51, Nick Dokos nicholas.do...@hp.com wrote:
 Filippo A. Salustri salus...@ryerson.ca wrote:

 Hi all,
 I'm looking to customize how some agenda commands work.
 The simple example I'm working on is combining changing a task's
 priority AND refreshing the agenda.

 What I'd normally do is:
 1. cursor to the task of interest,
 2. change its priority,
 3. refresh the agenda.

 After step 3, the cursor remains where it was in step 2.  That's fine.

 Then I rebind , in org-agenda-mode-map to this:
 (defun org-fas-agenda-priority (optional p)
   Change the priority of the current item, then refresh agenda.
   (interactive)
   (save-excursion
     (if (org-agenda-priority p)
       (org-agenda-redo

 When this function runs, it does exactly what I want it to do.

 BUT the cursor jumps to row one of the agenda buffer.

 Can anyone suggest a cause and a fix?


 I don't understand it yet, but can you try without the save-excursion
 and see if it does what you want?

 Nick




-- 
Filippo A. Salustri, Ph.D., P.Eng.
Mechanical and Industrial Engineering
Ryerson University
350 Victoria St, Toronto, ON
M5B 2K3, Canada
Tel: 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salus...@ryerson.ca
http://deseng.ryerson.ca/~fil/



Re: [O] broken link at orgmode.org

2011-03-31 Thread Jason Dunsmore
Rustom Mody rustompm...@gmail.com writes:

 In http://orgmode.org/index.html#sec-4
 there is this line
 ... latest released manuals (currently for Org 7.5), please browse
 this directory.

 The 'this directory' link seems to be broken

Yep, it's a 404.

http://orgmode.org/manual/release_7.5/

There are no directories under http://orgmode.org/manual/ on the server.
Where can I find these files Bastien?



[O] Re: Continuation of main section text after subsections ?

2011-03-31 Thread Matt Lundin
Samuel Wales samolog...@gmail.com writes:

 IIUC, OP wants to move stuff around more easily and not have improper
 body text folded.  Improper in this case means belonging to the
 grandparent but after parents.  He doesn't need improper outline
 exporting.

 Correct?

Agreed. That's how I read it. The issue has to do with visibility and
folding while editing, not with exporting (since html and latex can't
render such a nested structure).

Best,
Matt



Re: [O] Illiterate programming question

2011-03-31 Thread Sean O'Halpin
On Wed, Mar 30, 2011 at 11:52 PM, Eric Schulte schulte.e...@gmail.com wrote:
 Babel does have a way to bring changes back from pure source code into
 code blocks in an Org-mode document.  While it isn't perfect (especially
 if you make extensive use of noweb references or variables) there are
 mechanisms to maintain such a /sync/.  To try this out, tangle out code
 with the :comments yes header argument, then change an element of the
 tangled source code, and use the `org-babel-detangle' function to bring
 the changes back into the Org-mode document.

 Improving the detangling (or illiterate) features is an area ripe for
 future Babel development.

 Cheers -- Eric


Hi,

Could anyone please give a working example of this? I tried tangling
the following:

   * A tangle example

   #+source: body
   #+begin_src ruby :comments yes :noweb yes
 puts hello
   #+end_src

   #+source: method
   #+begin_src ruby :comments yes :noweb yes
 def hello
   body
 end
   #+end_src

   #+source: main
   #+begin_src ruby :comments yes :tangle detangle.rb :noweb yes
 method
 hello
   #+end_src

and got the output:

   # [[][main]]

   def hello
 puts hello
   end
   hello

   # main ends here

which doesn't look right to me.

Regards,
Sean



Re: [O] Illiterate programming question

2011-03-31 Thread Nick Dokos
Sean O'Halpin sean.ohal...@gmail.com wrote:

 On Wed, Mar 30, 2011 at 11:52 PM, Eric Schulte schulte.e...@gmail.com wrote:
  Babel does have a way to bring changes back from pure source code into
  code blocks in an Org-mode document.  While it isn't perfect (especially
  if you make extensive use of noweb references or variables) there are
  mechanisms to maintain such a /sync/.  To try this out, tangle out code
  with the :comments yes header argument, then change an element of the
  tangled source code, and use the `org-babel-detangle' function to bring
  the changes back into the Org-mode document.
 
  Improving the detangling (or illiterate) features is an area ripe for
  future Babel development.
 
  Cheers -- Eric
 
 
 Hi,
 
 Could anyone please give a working example of this? I tried tangling
 the following:
 
* A tangle example
 
#+source: body
#+begin_src ruby :comments yes :noweb yes
  puts hello
#+end_src
 
#+source: method
#+begin_src ruby :comments yes :noweb yes
  def hello
body
  end
#+end_src
 
#+source: main
#+begin_src ruby :comments yes :tangle detangle.rb :noweb yes
  method
  hello
#+end_src
 
 and got the output:
 
# [[][main]]
 
def hello
  puts hello
end
hello
 
# main ends here
 
 which doesn't look right to me.
 

What should it look like?

Nick



[O] Re: zotero (or mendeley) integration with org

2011-03-31 Thread Matt Lundin
Stephen Eglen s.j.eg...@damtp.cam.ac.uk writes:

 Agreed. Google Scholar citations need very close proofreading, as they
 can be erroneous or poorly formatted. 

 Thanks Matt - I'd agree with this, having seen oddities from google
 scholar.  I emailed them ages ago about one problem (formatting of
 initials in author names), but never heard back... it is a pity that
 there is no mechanism for tidying up their references, as it seems to be
 the best thing out there that covers all the fields.

 Having said that, if google scholar can save me some typing, I'll
 happilyuse it as a starting point for a bibtex entry.  I've just started
 using pdfmeat -- this is nice, as given a pdf, it outputs the
 corresponding bibtex entry from google scholar.  Probably works similar
 to the way zotero does it, but can be used straight from the command
 line:

   http://code.google.com/p/pdfmeat/


Thanks for the link! That looks like a useful tool.

 accessed by bibsnarf are limited to math and sciences. Since I use
 biblatex together with the Chicago Manual of Style, any bibtex entry I
 clip has to be edited and tweaked substantially. (Indeed, manual editing
 is unavoidable when using biblatex.)

 If its not too tangential, why do you use biblatex -- is it the future
 for bibtex?

I use biblatex because I use citation styles in the humanities
(especially the Chicago Manual of Style). Biblatex and the chicago-notes
package (both now part of TeXLive) handle Chicago Style footnotes and
bibliographies beautifully, with an astounding number of options and
flawless formatting -- but the bibtex entries are a bit fussier than
standard bibtex.

Best,
Matt



[O] Re: unnumbered subsections in latex export

2011-03-31 Thread Nicolas
Hello,

Bastien b...@altern.org writes:

 2. exporters use various methods to export the file (e.g. the HTML
exporter goes line by line, the LaTeX exporter parses the file and
render each section);

*Example*: users often ask why the LaTeX exporter cannot export a
headline of level 3 right after a headline of level 1: they ask that
because the HTML exporter can do this, while the LaTeX one cannot.
And the LaTeX one cannot because parsing an ill-structured Org buffer
is tricky for it.

 3. exporters are maintained by various people: I know the HTML exporter
and the LaTeX one, others know the other exporters, etc.

 I need your help do deal with these issues.

 The first thing to do is to have a list of annoying inconsistencies that
 need to be addressed in priority.

I have been thinking about exporters for a while now, and I'd like to
share my point of view. Be warned, I will be a bit verbose.

Honestly, I wouldn't talk about just annoying inconsistencies. I think
we may be running into a serious problem with exporters if some work
isn't done about them. Indeed, It seems to me that it is too much
difficult to create new exporters and managing them could become
unwieldy soon. I have my opinion on how we could anticipate and solve
that.

At the moment, the export process is done in two parts. At first, the
buffer is parsed and changed into a quite complex, and not documented
enough, format: this is the job of org-exp.el. It is complex because the
new format mixes new string markers (ORG-CENTER-END\n) and text
properties (original-indentation). It isn't documented enough because
some of those properties are not exactly defined, and their meaning, or
their differences, aren't always explicit (org-protected, org-example,
org-verbatim-emph are coming to my mind).

It isn't a problem per se, after all Org is also rich and complex, and
a simpler way to handle this may not be sufficient. But any person
planning to create a new exporter these days has to know all of those
subtleties, and pay attention to both visible and invisible markers when
parsing the new format.

The second part of the export process is backend specific. I'm talking
about org-latex.el org-html.el, etc. As Bastien pointed out, they often
parse the buffer their own way (line-wise or section-wise), adding one
layer of complexity for anyone trying to understand them, and creating
inconsistencies at the same time.

This is why I think exporting should take a slightly different approach.
In essence, org-exp.el should parse itself the format it creates and
call functions from backend specific exporters for each environment or
object it encounters during the parsing. In other words, specific
exporters should only consist in a sum of independent functions, named
uniformly (org-html-export-list, org-latex-export-center), and acting
recursively on parts of the buffer, in a format precisely documented.

Thus, Org documentation should provide an exhaustive list of
environments and objects it offers with their associated format during
export. Then, creating an exporter should be as simple as providing
functions to change every one of them into meaningful strings, which
would then be collected by org-exp.el. The immediate benefit is that
only those among us patching org-exp.el will have to know the
intermediate format it creates, and those creating or patching backends
will work on a well-defined format.

I'll show two examples to illustrate my point: lists and tables. Taken
from a docstring, 

1. first item
   + sub-item one
   + [X] sub-item two
   more text in first item
2. [@3] last item

will be parsed as:

(ordered (nil \first item\
  (unordered (nil sub-item one)
 (nil [CBON] sub-item two))
  more text in first item)
 (3 last item))

This allows to easily (see org-list-to-latex, org-list-to-html,
org-list-to-texinfo, and so on) transform an Org list in many different
formats. Alas, it cannot be used in org-html.el and org-docbook.el, as
those, again, parse buffer line-wise.

The same could be said about tables:

| Row 1 | 1 | 2 |
|---+---+---|
| Row 2 | 3 | 4 |

can be parsed as:

((Row 1 1 2)
 'hline
 (Row 2 3 4))

and from that, such functions as orgtbl-to-html, or orgtbl-to-latex were
easy to create.

So, basically, what I suggest here is:

1. list all possible environments and objects offered by the Org format
   (table, lists, inlinetasks, center, verbatim, paragraph, headlines,
   time-stamps, LaTeX snippets, footnotes, links, source);
2. define an explicit export format for each of them;
3. determine options that should be know by org-exp, by the backend;
4. create a parser, in org-exp, that will output Org buffer in the
   chosen format;
5. create (many are readily available) functions for each backend to
   interpret them.


Now about that explicit format. Taking this buffer,

--8---cut here---start-8---
#+title: 

Re: [O] Re: Continuation of main section text after subsections ?

2011-03-31 Thread Aankhen
On Fri, Apr 1, 2011 at 01:34, Matt Lundin m...@imapmail.org wrote:
 Samuel Wales samolog...@gmail.com writes:

 IIUC, OP wants to move stuff around more easily and not have improper
 body text folded.  Improper in this case means belonging to the
 grandparent but after parents.  He doesn't need improper outline
 exporting.

 Correct?

 Agreed. That's how I read it. The issue has to do with visibility and
 folding while editing, not with exporting (since html and latex can't
 render such a nested structure).

Just to clarify, HTML can, while LaTeX and DocBook can’t.  No idea
about the remaining export formats.

Aankhen



[O] Apply custom CSS class to headings in HTML export?

2011-03-31 Thread Uriel Avalos
Suppose that you export the following document to HTML:

  * Heading 1
  ** Heading 2

The HTML structure is pretty much the following:

  div class=outline-2
h2 Heading 1
div class=outline-text-2
div class=outline-3
  h3 Heading 2

Is there a way to apply a custom CSS class to the:

 1. containing div (outline-2)?
 2. heading itself (h2)?
 3. text inside of the heading (outline-3)?

Why? Suppose you have the following document

 * Heading 1
 ** Resources
 ** Answers
 * Heading 2
 ** Quiz 
 ** Resources
 ** Answers

You need to apply a different style to the Resources and
Quizzes. Unfortunately, these don't always appear in an
outline and they don't always appear in the same order. It
is infinitely easier to use a custom CSS class with each
heading.

--Thanks



Re: [O] Apply custom CSS class to headings in HTML export?

2011-03-31 Thread Juan Pechiar
You can add custom styles via properties:

  In order to add styles to a subtree, use the :HTML_CONTAINER_CLASS:
  property to assign a class to the tree. In order to specify CSS styles
  for a particular headline, you can use the id specified in a
  :CUSTOM_ID: property.

http://orgmode.org/manual/CSS-support.html#CSS-support

So you should do something like:

#+begin_example org
* Top heading
** Resource
   :PROPERTIES:
   :HTML_CONTAINER_CLASS: resource
   :END:
#+end_example

This exports as

#+begin_example html
div ... class=outline-2 resource
h2Resource/h2
...
#+end_example

So you can define styles thus:

#+begin_example css

div.resource h2 { font: comic_sans_forever; }

#+end_example

regards,
.j.

On Thu, Mar 31, 2011 at 06:46:45PM -0400, Uriel Avalos wrote:
 Suppose that you export the following document to HTML:

   * Heading 1
   ** Heading 2

 The HTML structure is pretty much the following:

   div class=outline-2
 h2 Heading 1
 div class=outline-text-2
 div class=outline-3
   h3 Heading 2

 Is there a way to apply a custom CSS class to the:

  1. containing div (outline-2)?
  2. heading itself (h2)?
  3. text inside of the heading (outline-3)?

 Why? Suppose you have the following document

  * Heading 1
  ** Resources
  ** Answers
  * Heading 2
  ** Quiz
  ** Resources
  ** Answers

 You need to apply a different style to the Resources and
 Quizzes. Unfortunately, these don't always appear in an
 outline and they don't always appear in the same order. It
 is infinitely easier to use a custom CSS class with each
 heading.



Re: [O] Re: Using babel to generate a commit log

2011-03-31 Thread Eric Schulte
Luke Crook l...@balooga.com writes:

 Eric Schulte schulte.eric at gmail.com writes:

 Since this could be generally useful would you be willing to add it to
 the library of babel (org/contrib/babel/library-of-babel.org)?  

 That would be great.

 If so then if you could supply a few explanatory sentences, I'll add those 
 and
 the code block to the library-of-babel.org distributed with Org-mode.

 This function will attempt to retrieve the entire commit log for the file 
 associated with the current buffer and insert this log into the export. The 
 function uses the Emacs VC commands to interface to the local version control 
 system, but has only been tested to work with Git. 'limit' is currently 
 unsupported.


Fantastic, I've now added this to the library-of-babel.org file, so
anyone who loads the library of babel can now call this functionality
through the  code block, e.g.,

#+call: 

Thanks for the contribution! -- Eric

ps. since I can be a bit OCD about these things, I made some aesthetic
indentation and reformatting changes to your elisp.



[O] Use-cases for babel

2011-03-31 Thread Marcelo de Moraes Serpa
Hi list,

I'm a long-time org user, and when I followed the development and
release of org-babel with great interest. However, I never really used
it, mainly because I never really found a use-case for me.

I noticed that there were a lot of messages regarding babel and
publishing, but I've read a post other day that opened my eyes:
org-babel can be actually used to create self-contained org-systems,
in other words, org files with elisp scripts that extend and add to
org, and output stuff on the fly.

I never tried org-babel, but this really excited me, I might play
around with the idea more when I have the time.

We could also use this thread for additional ideas on how org-babel
could be used.

Cheers,

Marcelo.



Re: [O] Illiterate programming question

2011-03-31 Thread Sean O'Halpin
On Thu, Mar 31, 2011 at 9:13 PM, Nick Dokos nicholas.do...@hp.com wrote:
 Sean O'Halpin sean.ohal...@gmail.com wrote:

 On Wed, Mar 30, 2011 at 11:52 PM, Eric Schulte schulte.e...@gmail.com 
 wrote:
  Babel does have a way to bring changes back from pure source code into
  code blocks in an Org-mode document.  While it isn't perfect (especially
  if you make extensive use of noweb references or variables) there are
  mechanisms to maintain such a /sync/.  To try this out, tangle out code
  with the :comments yes header argument, then change an element of the
  tangled source code, and use the `org-babel-detangle' function to bring
  the changes back into the Org-mode document.
 
  Improving the detangling (or illiterate) features is an area ripe for
  future Babel development.
 
  Cheers -- Eric
 
 
 Hi,

 Could anyone please give a working example of this? I tried tangling
 the following:

    * A tangle example

    #+source: body
    #+begin_src ruby :comments yes :noweb yes
      puts hello
    #+end_src

    #+source: method
    #+begin_src ruby :comments yes :noweb yes
      def hello
        body
      end
    #+end_src

    #+source: main
    #+begin_src ruby :comments yes :tangle detangle.rb :noweb yes
      method
      hello
    #+end_src

 and got the output:

    # [[][main]]

    def hello
      puts hello
    end
    hello

    # main ends here

 which doesn't look right to me.


 What should it look like?

 Nick

To be honest, I don't know what it /should/ look like but I have ':comments yes'
on three sections and get only one link on output, so I can't see how this
would detangle properly.

Also,

# [[][main]]

is missing the file reference (in the first set of brackets), so it
won't work as a link.

Regards,
Sean

P.S. Apologies again for not replying to all first time.



Re: [O] Re: Timer mode doesn't hyphenate correctly

2011-03-31 Thread Mark S

Hello Nicolas,

--- On Thu, 3/31/11, Nicolas n.goaz...@gmail.com wrote:


I cannot reproduce what you are describing. I may be
misunderstanding you. Could you please post an ECM
for that?



What's an ECM?

The scenario described has occurred 2 or 3 times now, though I can't  
figure out the exact sequence.


Another thing I've noticed is that sometimes the list items are created in  
chronological order, and other times in reverse-chronological order. In  
fact, most of the time it wants to go in reverse-chronological order.  
Since there's no example in the manual, I'm not sure which one is  
normal. I would prefer chronological order, but I can see why some might  
prefer reverse-chronological.


Thanks,
Mark



[O] Re: unnumbered subsections in latex export

2011-03-31 Thread Jambunathan K

One more thing to the list.

Use htmlfontify instead of htmlize. Former is part of standard Emacs
while the latter is not.

Jambunathan K.



[O] Re: unnumbered subsections in latex export

2011-03-31 Thread Jambunathan K

Backward compatibility is a real issue. 

The real challenge is how to move forward while also not breaking
anything that the users have come to rely on.

 Thus, Org documentation should provide an exhaustive list of
 environments and objects it offers with their associated format during
 export. Then, creating an exporter should be as simple as providing
 functions to change every one of them into meaningful strings, which
 would then be collected by org-exp.el. The immediate benefit is that
 only those among us patching org-exp.el will have to know the
 intermediate format it creates, and those creating or patching backends
 will work on a well-defined format.

 I'll show two examples to illustrate my point: lists and tables. Taken
 from a docstring, 

 1. first item
+ sub-item one
+ [X] sub-item two
more text in first item
 2. [@3] last item

 will be parsed as:

 (ordered (nil \first item\
   (unordered (nil sub-item one)
  (nil [CBON] sub-item two))
   more text in first item)
  (3 last item))

 This allows to easily (see org-list-to-latex, org-list-to-html,
 org-list-to-texinfo, and so on) transform an Org list in many different
 formats. Alas, it cannot be used in org-html.el and org-docbook.el, as
 those, again, parse buffer line-wise.

From a refactoring perspective, it is not necessary that a XML-like list
structure be offered to the html backend. In principle, it would suffice
as long as the html exporter is provided with enough information so that
it can deduce the above structure while still continuing to be
line-oriented.


 The same could be said about tables:

 | Row 1 | 1 | 2 |
 |---+---+---|
 | Row 2 | 3 | 4 |

 can be parsed as:

 ((Row 1 1 2)
  'hline
  (Row 2 3 4))

 and from that, such functions as orgtbl-to-html, or orgtbl-to-latex were
 easy to create.

 So, basically, what I suggest here is:

 1. list all possible environments and objects offered by the Org format
(table, lists, inlinetasks, center, verbatim, paragraph, headlines,
time-stamps, LaTeX snippets, footnotes, links, source);
 2. define an explicit export format for each of them;
 3. determine options that should be know by org-exp, by the backend;
 4. create a parser, in org-exp, that will output Org buffer in the
chosen format;
 5. create (many are readily available) functions for each backend to
interpret them.

Do look at my new html exporter. I have been very conservative in making
the changes.

Some observations from my side ...

  It isn't documented enough because some of those properties are not
 exactly defined, and their meaning, or their differences, aren't
 always explicit (org-protected, org-example, org-verbatim-emph are
 coming to my mind).

I agree that text properties are problematic. I see that they are also
used inconsistently.

Consider org-example.

A source block is transformed by org-exp.el in to a html block and is
enclosed in #+begin_html...#+end_html. On the otherhand the #+begin_html
and #+end_html given by the user isn't marked up with this property.

[Context Switch]

Protection this seems to me to happen at three levels. Protection at
block level happens in example/source blocks, Protection at phrase level
happens in verbatim LaTeX equations (fragments?) and Protection at tag
level as implied in @tag @tag/ convention.

[Context Switch]
When I see backend specific code in org-exp.el something in my gut says
that it is not OK.

For example, source blocks are transformed in org-exp.el to
html-specific markup and get inserted between #+begin_html and
#+end_html with org-indentation, org-protected properties. org-html.el
just inserts it.

I believe, it would be all the more better if the above transform 
propertize in org-exp.el and just insert in org-html.el is done as
propertize in org-exp.el and transform  insert in org-html.el.

[Context Switch]
Html exporter is not only line-oriented it is also a transformation
pipeline. The latter part means that if lines are slightly arranged
(that is the order of the transformation is changed) then things will
break in unexpected ways.

This is the root cause of all the recent regressions concerning images
and timestamps in the HTML exporter.

[Context Switch] 
org-html.el opens paragraph in anticipation rather than when it is
actually needed. As a result previous context just diffuses in to a
latter context. If this were not so deleting of empty paragraphs
wouldn't be necessary. 

[Context Switch]
HTML exporter occasionally emit things temporarily and goes back and
fixes it. Table's colalign and colgroup markers come to mind here. In
some sense convenience features like right align if a column is
predominantly numeric also complicated things.

I think one of the reasons Org is so popular it is that it is a
common-man's swiss army knife and not a elitist samurai sword.

Jambunathan K.



Re: [O] Illiterate programming question

2011-03-31 Thread Nick Dokos
Sean O'Halpin sean.ohal...@gmail.com wrote:

 On Thu, Mar 31, 2011 at 9:13 PM, Nick Dokos nicholas.do...@hp.com wrote:
  Sean O'Halpin sean.ohal...@gmail.com wrote:
 
  On Wed, Mar 30, 2011 at 11:52 PM, Eric Schulte schulte.e...@gmail.com 
  wrote:
   Babel does have a way to bring changes back from pure source code into
   code blocks in an Org-mode document.  While it isn't perfect (especially
   if you make extensive use of noweb references or variables) there are
   mechanisms to maintain such a /sync/.  To try this out, tangle out code
   with the :comments yes header argument, then change an element of the
   tangled source code, and use the `org-babel-detangle' function to bring
   the changes back into the Org-mode document.
  
   Improving the detangling (or illiterate) features is an area ripe for
   future Babel development.
  

...example elided...

  
  which doesn't look right to me.
 
 
  What should it look like?
 
  Nick
 
 To be honest, I don't know what it /should/ look like but I have ':comments 
 yes'
 on three sections and get only one link on output, so I can't see how this
 would detangle properly.
 
 Also,
 
 # [[][main]]
 
 is missing the file reference (in the first set of brackets), so it
 won't work as a link.
 

Yes, it does look unlikely. I don't know about the other comments (line
numbers, etc.) but at least the link calculation in
org-babel-tangle-collect-blocks is wrong I believe: it uses
org-store-link to supposedly store a link to the current location on the
global org-stored-links stack and then pops it, takes the car of it and
sanitizes text properties of the result: that then becomes the link that
should be stored in the tangled file.

But it seems that org-store-link does not behave this way when called
non-interactively: I get nothing on the global stack. Instead it seems
to *return* the link as a string, which is then just thrown away.

One can argue that org-store-link is wrong to behave this way[fn:1]
but I will let Eric and Carsten fight it out :-)

Nick

Footnotes:

[fn:1] assuming that it *does* behave this way and I am not fooling
myself.