Re: [O] Writing your book with orgmode and publishing it on Leanpub

2014-02-24 Thread Juan Reyero
On Mon, Feb 24, 2014 at 8:39 AM, Waldemar Quevedo
waldemar.quev...@gmail.com wrote:
 It is rather annoying that github understands the org syntax but not
 quite, so the sources appear almost but not quite right.
 I maintain the parser that is being by Github =
 https://github.com/wallyqs/org-ruby
 If you let me now the issues I can try to fix them, (or PRs are also
 welcome)

Sorry I sounded dismissive.  You are doing an awesome job, it's
amazing how much it did get right.

My problem is that I am trying to share my sources as code, not as
documentation.  I would like my .org files to be treated as you would
treat Python code, shown as they are and syntax-highlighted.  If you
parse them you will inevitably miss the context I am relying upon to
render them properly (like when you ---rightly--- assume that html
should be left standing, but what I wrote expects a jekyll
post-process).

People visiting the repository will most likely be interested in what
I actually wrote, not in its rendering as a document.  Close to what
you get when you select Raw, but syntax-highlighted.  This is what I
want the repository for; the document is somewhere else.

That said, the one place where the translation fails is when the
source code of babel snippets should not be exported.  Again, probably
due to the tension between the need to show the file's content and the
desire to render it as a document.

 I have this example
 where you can use `#+layout:` instead of YAML.
 https://github.com/wallyqs/yet-another-jekyll-org-template
 https://github.com/eggcaker/jekyll-org/blob/master/convert.rb#L30

Thank you for the pointer.

Best,

jm

 On Mon, Feb 24, 2014 at 4:24 AM, Juan Reyero joa...@gmail.com wrote:

 Greetings,

 I've solved a couple of bugs in the Leanpub[1] markdown exporter[2]
 (cross-links within the book using ids were not working, and footnotes
 containing a colon neither).  As far as I can tell using Orgmode and
 Leanpub to publish books is now quite feasible, and produces rather
 nice results.

 I have also published the sources for my book, The Hacker Ways[3], at

 https://github.com/juanre/hacker-ways

 It is rather annoying that github understands the org syntax but not
 quite, so the sources appear almost but not quite right.  Clone and
 open in Emacs to see what's going on.

 Best regards,

 jm
 --
 http://greaterskies.com
 http://juanreyero.com

 [1] Leanpub.com is a very nice self-publishing platform.  I am not
 associated with them, and they are not responsible for my code.

 [2] http://juanreyero.com/open/ox-leanpub/

 [3] https://leanpub.com/hackerways/





-- 
http://greaterskies.com
http://juanreyero.com



[O] Writing your book with orgmode and publishing it on Leanpub

2014-02-23 Thread Juan Reyero
Greetings,

I've solved a couple of bugs in the Leanpub[1] markdown exporter[2]
(cross-links within the book using ids were not working, and footnotes
containing a colon neither).  As far as I can tell using Orgmode and
Leanpub to publish books is now quite feasible, and produces rather
nice results.

I have also published the sources for my book, The Hacker Ways[3], at

https://github.com/juanre/hacker-ways

It is rather annoying that github understands the org syntax but not
quite, so the sources appear almost but not quite right.  Clone and
open in Emacs to see what's going on.

Best regards,

jm
-- 
http://greaterskies.com
http://juanreyero.com

[1] Leanpub.com is a very nice self-publishing platform.  I am not
associated with them, and they are not responsible for my code.

[2] http://juanreyero.com/open/ox-leanpub/

[3] https://leanpub.com/hackerways/



Re: [O] [ANN] Markdown exporter for leanpub.com

2014-01-28 Thread Juan Reyero
Hi Bastien,

On Tue, Jan 28, 2014 at 10:02 AM, Bastien b...@gnu.org wrote:
 If you make progress about this, I guess a lot of people would enjoy
 it.  Thanks in advance!

Cool.  I've taken it a bit further, and it now supports my whole
book[1], including latex formulas, cross links, code  and tables. I've
written a short intro,

http://juanreyero.com/open/ox-leanpub/index.html

and I'll send you my public key so I can get started contributing to Worg.

Thanks,

jm
--
[1] The Hacker Ways, https://leanpub.com/hackerways
It's just amazing how much orgmode is helping me do things, thank you very much.



[O] [ANN] Markdown exporter for leanpub.com

2014-01-25 Thread Juan Reyero
Greetings,

I have written a small markdown exporter that improves over the default one
for publication with http://leanpub.com.  In particular, it separates code
from its output, and it handles footnotes properly.  It's a very limited
one-morning hack, but I thought it might be of interest to others:

https://github.com/juanre/ox-leanpub

(I am writing a book with lots of code samples and their output.  Exporting
for the web was simple:

http://juanreyero.com/hacker-ways/terminal.html

but going to ebook required more work :-)

Best,

jm
-- 
http://greaterskies.com
http://juanreyero.com


[O] Moving org-jekyll to org-mode 8.0

2013-05-18 Thread Juan Reyero
Greetings,

Org-jekyll is a simple way to export jekyll blog posts from org-mode.  Docs:

http://juanreyero.com/open/org-jekyll/index.html

Code:

https://github.com/juanre/org-jekyll

I have merged Jianing Yang's patch for 8.0 compatibility in
org-jekyll, done some more small updates, and set as master.  I have
left an org-mode-7 branch with the old code just in case.

Best regards,

jm
-- 
http://greaterskies.com
http://juanreyero.com



[O] Automatically build lists of links to related articles

2011-08-19 Thread Juan Reyero
Greetings,

I write articles in their own page, with a main heading as the title.
I've written a function that builds a table with links to other
articles that share tags with the heading under which the table is
built (and that share the same language, assuming that the :lang:
property is set).  The function I've come up with works, but it is
rather ugly. I want it to work during export time, and the only way
I've found to access the target's file name has been to rely on ftname
being bound.

I suspect I must be missing something rather obvious.  Any hints on a
better way to do this, one that doesn't rely on undocumented variable
names bound by the export function?  Here's my function:

(defun related-entries ()
 (let* ((entries ())
        (heading (nth 4 (org-heading-components)))
        (with-tags (org-get-tags-at (point) t))
        (origin-props (org-entry-properties nil 'standard))
        (match-lang (cdr (or (assoc lang origin-props)
                             (assoc LANG origin-props)
   (org-map-entries
    (lambda ()
      (let* ((tags (org-get-tags-at (point) t))
             (current-heading (nth 4 (org-heading-components)))
             (props (org-entry-properties nil 'standard))
             (lang (cdr (or (assoc lang props)
                            (assoc LANG props
             (blurb (cdr (or (assoc blurb props)
                             (assoc BLURB props
             (fname (if (boundp 'ftname) ;; during export
                        (file-relative-name (buffer-file-name)
                                            (file-name-directory ftname))
                      (buffer-file-name
        (if (and (not (string= current-heading heading))
                 (or (not match-lang) (and lang (equal lang match-lang)))
                 (intersection tags with-tags :test 'equal))
            (let ((art-name (nth 4 (org-heading-components
              (add-to-list 'entries
                           (list (concat [[file: fname :: art-name
                                         ][ art-name ]]
                                         (if blurb
                                             (concat  ---  blurb)
                                           )))
                           t)
    nil
    (org-publish-get-base-files (if (boundp 'project) ;; during export
                                    project
                                  (org-publish-get-project-from-filename
                                   (buffer-file-name)
   entries))

Best regards,

jm
--
http://juanreyero.com/
http://alandair.com



Re: [Orgmode] Re: Project management Dynamic block per tag + [Babel]

2011-01-19 Thread Juan Reyero
On Thu, Dec 16, 2010 at 1:19 PM, Francesco Pizzolante
f...@missioncriticalit.com wrote:
  Another option is to use a babel block and org-map-entries to spit out a
  simple list of tasks for each person:
 I've played a little with the code you've sent and here's what I end up with:

 --8---cut here---start-8---
 #+source: tasklist
 #+begin_src emacs-lisp :var person=FPZ :results raw
 (setq org-agenda-files (list (buffer-file-name)))
 (let (tasklist)
  (add-to-list 'tasklist |c||| t)
  (org-map-entries
   (lambda ()
     (let ((priority (nth 3 (org-heading-components
       (add-to-list 'tasklist
                    (concat | * (nth 2 (org-heading-components)) * 
                            |/[# (char-to-string (if priority
 priority ?B)) ]/ 
                            | [[ (nth 4 (org-heading-components)) ]]|) t)))
   (concat person /!TODO|STARTED|WAIT) 'agenda)
  (mapconcat 'identity tasklist \n))
 #+end_src
 --8---cut here---end---8---

 The next step for me, would be to be able to sort this table against
 priorities for instance.

 If you think about a simple way of doing this, please let me know.

I had the same problem, and tweaking your code (I think org-mode
doesn't like the modification of org-agenda-files) this is what I've
ended up with:

(defun tasks-with-tag (person optional scope)
  (let ((tasklist ()))
(org-map-entries
 (lambda ()
   (let ((priority (nth 3 (org-heading-components
 (add-to-list 'tasklist
  (list (if priority (char-to-string priority) C)
(concat [[ (nth 4 (org-heading-components)) ]]))
  t)))
 (concat person /!TASK) scope)
(sort tasklist (lambda (f s)
 (string-lessp (car f) (car s))

The output is sorted and makes a nice table.  Scope is passed directly
to org-map-entries, so if you leave it out the scope will be the
current buffer.

Greetings,

jm
--
http://juanreyero.com/
http://alandair.com

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


Re: [Orgmode] Blogging from org-mode

2011-01-17 Thread Juan Reyero
On Sun, Jan 16, 2011 at 9:57 PM, Tom Breton (Tehom) te...@panix.com wrote:

 Some months back I contributed improvements to org-html.  My intent was to
 make it easy to post org files as blog posts.

 So this is a sort of delayed announcement.  There are two packages that
 post to blogs from org-mode: My org2blog/atom and Puneesh's (punchagan's)
 org2blog/wp.  I know there are also blog hosts based on org-mode, but
 that's different.  This is pushing org files to a normal blog host such
 as Blogger (for org2blog/atom) or Wordpress (org2blog/wp)

 org2blog/atom lives in the git repo http://repo.or.cz/r/org2blog.git and
 org2blog/wp lives in https://github.com/punchagan/org2blog.git

 Both respect the normal export options (#+TITLE: etc) but other than that
 the approaches are fairly different.

 Please tell me if I've missed any other org-based blogging software (other
 than the blog hosting software which is a different category).


I wrote org-jekyll a while back to export a blog to jekyll,

http://juanreyero.com/open/org-jekyll/index.html

From the doc:

 Extracts subtrees from your org-publish project files that have
  a :blog: keyword and an :on: property with a timestamp, and
  exports them to a subdirectory _posts of your project's
  publishing directory in the year-month-day-title.html format
  that Jekyll expects.  Properties are passed over as yaml
  front-matter in the exported files.  The title of the entry is
  the title of the subtree.

I've been happily using it for more than a year.

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


Re: [Orgmode] [RFI] Using DISQUS on certain pages

2010-11-09 Thread Juan Reyero
On Tue, Nov 9, 2010 at 3:43 AM, Jeff Horn jrhorn...@gmail.com wrote:
 Suppose I have a project defined (say, org-blog) that I use to
 generate blog posts, and I want to use Disqus to track comments.
 Further suppose I don't want to use a templating framework such as
 jekyll to transform org into HTML. Does anyone have experience
 inserting disqus code into preambles/postambles?

Yes, and it works great.  If you want to see a working example  take a
look at http://greaterskies.com.  The source code, including the
org-mode setup and headers, footers and jekyll extras, is at
https://github.com/juanre/Greater-Skies.  The blog part (not at all
obvious on the web, just used to enable subscriptions) is done with
org-jekyll, https://github.com/juanre/org-jekyll.

Hope it helps.

jm
---
http://juanreyero.com
ps.  My personal web is also done like that, all org-mode and org-jekyll.

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


Re: [Orgmode] [RFI] Using DISQUS on certain pages

2010-11-09 Thread Juan Reyero
On Tue, Nov 9, 2010 at 8:05 PM, Jeff Horn jrhorn...@gmail.com wrote:
 I think Greater Skies is a very inspiring
 project, and must be rewarding to work on.

Thank you very much.  It is indeed very rewarding, but only in the
rare occasions when I find the time to work on it.  Will keep moving,
though.

 So, if I've gleaned from the source correctly, you've defined a custom
 postamble and put both pieces of code Disqus generates into the
 postamble?

I put them on the templates in jekyll's  _layouts.  Then you can
choose which layout to use with an html chunk at the beginning of each
org file, like

 Beginning of file
#+begin_html
#+include: ../../../loc/en.yml
date:   2008-04-15
layout: page
---
#+end_html

 Also, I didn't see if you needed to use the #diqus_comments
 id, as disqus suggests, in order to get it to work.

I don't know.  I set it up quite a while ago, it might have changed.
But what's there seems to work.

The whole setup is kind of tricky, because I wanted to support a
multilanguage site that wasn't a nightmare to update, but I think the
above covers what you need.

Best,

jm

 On Tue, Nov 9, 2010 at 9:01 AM, Juan Reyero joa...@gmail.com wrote:
 On Tue, Nov 9, 2010 at 3:43 AM, Jeff Horn jrhorn...@gmail.com wrote:
 Suppose I have a project defined (say, org-blog) that I use to
 generate blog posts, and I want to use Disqus to track comments.
 Further suppose I don't want to use a templating framework such as
 jekyll to transform org into HTML. Does anyone have experience
 inserting disqus code into preambles/postambles?

 Yes, and it works great.  If you want to see a working example  take a
 look at http://greaterskies.com.  The source code, including the
 org-mode setup and headers, footers and jekyll extras, is at
 https://github.com/juanre/Greater-Skies.  The blog part (not at all
 obvious on the web, just used to enable subscriptions) is done with
 org-jekyll, https://github.com/juanre/org-jekyll.

 Hope it helps.

 jm
 ---
 http://juanreyero.com
 ps.  My personal web is also done like that, all org-mode and org-jekyll.




 --
 Jeffrey Horn
 Graduate Lecturer and PhD Student in Economics
 George Mason University

 (704) 271-4797
 jh...@gmu.edu
 jrhorn...@gmail.com

 http://www.failuretorefrain.com/jeff/




-- 
http://juanreyero.com/
http://unarueda.com

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


Re: [Orgmode] Org-jekyll - org-publish-initialize-files-alist

2010-07-02 Thread Juan Reyero
Nathan,

I've just pushed a version of org-jekyll that should solve the
problem, following Sebastian's suggestions, and it's available at
http://github.com/juanre/org-jekyll.  Sorry it's taken me so long to
respond; I am pretty much off-line lately for personal reasons.  And
thanks for bringing it out.

Best,

jm
--
http://juanreyero.com

On Wed, Jun 30, 2010 at 9:04 PM, Sebastian Rose sebastian_r...@gmx.de wrote:

 Nathan Neff nathan.n...@gmail.com writes:
  ...
  Below is the code where org-publish-initialize-files-alist is called
  in org-jekyll.
  It looks like in both cases, the code is trying to figure out what
  project the current
  file belongs to.  Can anyone suggest a fix?  I don't mean to push this
  on anyone, but I really don't know lisp that well.

  ...

  (defun org-jekyll-export-current-entry ()
    (interactive)
    (save-excursion
      (org-publish-initialize-files-alist) ; here
      (let ((project-name (cdr (assoc (expand-file-name (buffer-file-name))
                                      org-publish-files-alist
        (org-back-to-heading t)
        (org-jekyll-export-entry project-name

 I suppose `project-name' shall be the name of the project, i.e. a
 string?


 ;; Evtl. needed to keep compiler happy:
 (declare-function org-publish-get-project-from-filename org-publish
                  (filename optional up))

 (defun org-jekyll-export-current-entry ()
  (interactive)
  (save-excursion
    (let ((project-name (org-publish-get-project-from-filename 
 buffer-file-name)))
      (org-back-to-heading t)
      (org-jekyll-export-entry project-name





  (defun org-jekyll-export-blog ()
    Export all entries in project files that have a :blog: keyword
  and an :on: datestamp.  Property drawers are exported as
  front-matters, outline entry title is the exported document
  title. 
    (interactive)
    (save-excursion
      (org-publish-initialize-files-alist) ;;  -- here
      (setq org-jekyll-new-buffers nil)
      (mapc
       (lambda (jfile-project)
         (let ((jfile (car jfile-project))
               (project (cdr jfile-project)))
           (if (string= (file-name-extension jfile) org)
               (with-current-buffer (org-get-jekyll-file-buffer jfile)
                 (org-map-entries (lambda () (org-jekyll-export-entry 
  project))
                                  blog|BLOG)
       (org-publish-get-files (org-publish-expand-projects
                               (list (org-publish-get-project-from-filename
                                      (buffer-file-name) 'up)
      (org-release-buffers org-jekyll-new-buffers)))


 (defun org-jekyll-export-blog ()
  Export all entries in project files that have a :blog: keyword
 and an :on: datestamp.  Property drawers are exported as
 front-matters, outline entry title is the exported document
 title. 
  (interactive)
  (save-excursion
    (setq org-jekyll-new-buffers nil)
    (mapc
     (lambda (jfile-project)
       (let ((jfile (car jfile-project))
             (project (cdr jfile-project)))
         (if (string= (file-name-extension jfile) org)
             (with-current-buffer (org-get-jekyll-file-buffer jfile)
               (org-map-entries (lambda () (org-jekyll-export-entry project))
                                blog|BLOG)

     ;; NOT SURE IF THIS WILL WORK HERE:
     (org-publish-get-base-files
       (list (org-publish-get-project-from-filename (buffer-file-name) 'up
    (org-release-buffers org-jekyll-new-buffers)))



 HTH

   Sebastian

 ___
 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



--
http://juanreyero.com/
http://unarueda.com

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


[Orgmode] Re: Another blog written with org-mode with org-jekyll

2010-02-10 Thread Juan Reyero
On Wed, Feb 10, 2010 at 11:41 AM, Rick Moynihan rick.moyni...@gmail.com wrote:
 Hi all,

 I thought some of you might like to know that my blog is now up and
 running.  I write my posts in org-mode, and export with org-jekyll.
 You can find it here:

 http://sourcesmouth.co.uk/

This is great!  I am really glad that org-jekyll is useful for
somebody other than me :-).  One caveat, though, for those of you who
blog in languages with accented characters: the way jekyll constructs
permalinks doesn't deal properly with them and it fails in some
browsers.  I haven't figured it out yet.

Best,

jm
-- 
http://juanreyero.com/
http://unarueda.com


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


Re: [Orgmode] Announcing org-jekyll

2010-02-02 Thread Juan Reyero
On Mon, Feb 1, 2010 at 9:20 PM, Eric Schulte schulte.e...@gmail.com wrote:
 I have been exporting org-mode subtrees to jekyll blog posts on a couple
 of projects, and I've found it really handy
 - resulting in more attractive web pages than I'm able to generate
  directly from org
 - for the liquid syntax which jekyll provides for programmatic
  generation of elements of html files
 - and for the ability to automatically generate xml/atom/rss from my
  projects

 One issue that I've not been able to solve is the resolution of
 intra-file links when I'm exporting subtrees to external files.  For
 example say I have the following file
 Taking the above idea one step further, if say each subtree has an
 EXPORT_FILE_NAME property then it would be great to support link
 maintenance during export of all such subtrees in a file

It is a great idea.  Most of my links end up being in http format
pointing to the final location of things, which is a brittle solution
and prevents following them from org-mode.

For exporting subtrees in jekyll format you'd probably want to allow
the value of EXPORT_FILE_NAME to be a function that computes it from
the entry properties.

Another problem is how to export images and attachments.  I haven't
solved it yet: I manually copy them to their final destination, and
have a link in org-mode that will translate to something correct when
exported.  It'd be great to be able to refer to an attached file from
a link in an entry, and copy during export the attachments directory.

Best,

Juan
-- 
http://juanreyero.com/
http://unarueda.com


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


Re: [Orgmode] Announcing org-jekyll

2010-02-02 Thread Juan Reyero
On Tue, Feb 2, 2010 at 11:37 AM, Rick Moynihan rick.moyni...@gmail.com wrote:
 On 1 February 2010 19:14, Juan Reyero joa...@gmail.com wrote:
 On Mon, Feb 1, 2010 at 12:23 PM, Rick Moynihan rick.moyni...@gmail.com 
 wrote:
 On 29 January 2010 23:16, Juan Reyero joa...@gmail.com wrote:
 Full description: http://juanreyero.com/open/org-jekyll/
 Source code: http://github.com/juanre/org-jekyll

 I'm not entirely clear on how the org-publish-project-alist relates to
 org-jekyll and org-jekyll-export-blog?  What do you need to do to set
 this up, other than annotate headlines with :blog: keywords and :on:
 properties?

 You set it up so that the files that contain blog entries belong to an
 org-publish project, as described for example in
 http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php
 I've found that calling org-jekyll-export-blog, seems to do nothing...

 It should, if the file from which you are calling is part of an
 org-publish project, and there are entries with the :blog: tag and the
 :on: property.

 Ok, it turns out that there were several problems I had...  After some
 time in the emacs debugger, it turned out that the default values for
 org-jekyll-category and org-jekyll-localize-dir are non-nil... which
 was causing the _posts/ directory to be set to a directory that
 doesn't exist.  Overriding these to nil fixed the first problem.

Souds like the most sensible default, just changed in the repository.
It should only fail if you happened to have a :lang: property in your
entries, though.

 The second problem was that my tags and property keys are all in
 uppercase, yet org-jekyll only works for lower-case keys.

Changed that too.  Now it accepts both lower- and upper-case :BLOG: and :ON:.

 Also it would be nice for org-jekyll-export-blog to fail with an
 error, rather than just dying silently.  Alternatively even better
 might be for it to construct the _post and category directories it
 needs if they don't already exist

Changed to create the directories if they don't exist.  Now the
biggest thing still on my list is taking care of accented characters
in entry names.  Looks like some browsers don't like them in urls.

Best,

Juan
-- 
http://juanreyero.com/
http://unarueda.com


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


Re: [Orgmode] Announcing org-jekyll

2010-02-01 Thread Juan Reyero
On Mon, Feb 1, 2010 at 12:23 PM, Rick Moynihan rick.moyni...@gmail.com wrote:
 On 29 January 2010 23:16, Juan Reyero joa...@gmail.com wrote:
 Full description: http://juanreyero.com/open/org-jekyll/
 Source code: http://github.com/juanre/org-jekyll

 I'm not entirely clear on how the org-publish-project-alist relates to
 org-jekyll and org-jekyll-export-blog?  What do you need to do to set
 this up, other than annotate headlines with :blog: keywords and :on:
 properties?

You set it up so that the files that contain blog entries belong to an
org-publish project, as described for example in
http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php

The idea is that you might want to combine a blog with a bunch of
org-published files, as I do in http://juanreyero.com and
http://greaterskies.com, and you shouldn't have to spend too much time
separating the two things.  So it boils down to defining your
org-publish-project-alist.  Then you open a file that belongs to the
project and do org-jekyll-export-blog or
org-jekyll-export-current-entry, depending on what you need.

 I've found that calling org-jekyll-export-blog, seems to do nothing...

It should, if the file from which you are calling is part of an
org-publish project, and there are entries with the :blog: tag and the
:on: property.

  Also I've seen it complain about org-publish-initialize-files-alist
 not being defined, unless I've first run an org-publish.

It should be able to populate the org-publish files itself; it
certainly works for me without doing org-publish.  If nothing works
for you please send me a minimal setup that reproduces your problem
and I'll try to figure it out.

Best regards, and thanks for the positive feedback,

Juan
---
http://juanreyero.com/
http://unarueda.com


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


[Orgmode] Announcing org-jekyll

2010-01-29 Thread Juan Reyero
Greetings,

I've been toying around with a small package to export entries as a
Jekyll blog.  It is different from other approaches I am aware of in
that it will find your blog entries anywhere in the files belonging to
a project, and it will pass properties along to Jekyll as yaml front
matter.  It also includes some support for localization.

Full description: http://juanreyero.com/open/org-jekyll/
Source code: http://github.com/juanre/org-jekyll

Best regards,

Juan
-- 
http://juanreyero.com/
http://unarueda.com


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


[Orgmode] Setting up org-ctags and exporting ctags links

2010-01-15 Thread Juan Reyero
Greetings,

I've just installed org-ctags in my system and it works beautifully.
One note, though, for those of you running on OS-X: you need to setq
org-ctags-path-to-ctags pointing to your ctags executable before
requiring org-ctags, otherwise it fails as it tries to call a
non-existing (operating-system) function.

Also, there was some talk a while ago about exporting the org-ctags
links; Carsten pointed out that a function that returns the target's
filename was required
(http://www.mail-archive.com/emacs-orgmode@gnu.org/msg20565.html) and
Paul wrote org-ctags-get-filename-for-tag for this purpose.  I wonder,
has anybody used it to actually export HTML with ctags links?  I'd
like my web publishing to take advantage of the great ctags package.

Best,

Juan
-- 
http://juanreyero.com/


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


Re: [Orgmode] Need help exporting subtrees to html

2010-01-01 Thread Juan Reyero
On Thu, Dec 31, 2009 at 8:51 PM, Eric Schulte schulte.e...@gmail.com wrote:
 Juan Reyero joa...@gmail.com writes:

 On Thu, Dec 31, 2009 at 6:15 PM, Eric Schulte schulte.e...@gmail.com wrote:
 Juan Reyero joa...@gmail.com writes:

 On Thu, Dec 31, 2009 at 9:15 AM, Carsten Dominik
 carsten.domi...@gmail.com wrote:
 On Dec 27, 2009, at 8:31 PM, Juan Reyero wrote:
 On Sun, Dec 27, 2009 at 7:35 PM, Carsten Dominik
 carsten.domi...@gmail.com wrote:
 On Dec 27, 2009, at 5:34 PM, Juan Reyero wrote:
 I have written a function to export org-mode subtrees as jekyll posts,
 http://juanreyero.com/open/org-jekyll/  The idea is that any entry in
 an org-publish project that has a :blog: keyword and an :on: property
 with a timestamp should be exported to a _posts directory with the
 year-month-day-title.html that jekyll expects, with the properties as
 front-matter.
 If it helps, I've been doing something similar to support publishing
 updates on the org-babel development -- using the code shown here [1]
 under the Development Updates section.  This generates a files in
 _posts for each subtree of of the tasks and bugs sections which have
 a time-stamp in their properties.  It should be fairly straightforward
 to adapt this code to export all properties as YAML frontmatter.

 It is exactly what I did :-).  I found your code here [1], and adapted
 it so that it would use files in an org-publish project and would
 export properties.

 Ah, I should have read the thread more carefully :)

 So thank you very much for making it available.  It does, however,
 have the same problem I find: the header level with which the piece is
 exported (h1, h2, etc) depends on the outline level on which the item
 you export happened to be.  I was hoping to export the chunks
 independently of where they were written.


 So this turned out to be somewhat tricky.  I was able to adjust my
 previous code so that every subtree will be promoted to a top-level
 heading before export by adding the following (this change can also be
 seen in my published code here [1]).

 --8---cut here---start-8---
                (org-narrow-to-subtree)
                (let ((level (- (org-outline-level) 1))
                      (contents (buffer-substring (point-min) (point-max
                  (dotimes (n level nil) (org-promote-subtree))
                  (setq html (org-export-as-html nil nil nil 'string t nil))
                  (set-buffer org-buffer)
                  (delete-region (point-min) (point-max))
                  (insert contents)
                  (save-buffer))
                (widen)
 --8---cut here---end---8---

It works!  Thank you _very_ much.  I've just had to add a
org-reduced-level to the org-outline-level, like

(org-reduced-level (org-outline-level)).

I've updated it in github and on
http://juanreyero.com/open/org-jekyll/, and I'll try to add something
to worg this afternoon.

Best,

Juan

 Footnotes:
 [1]  http://eschulte.github.com/babel-dev/publish.html
-- 
http://juanreyero.com/
http://unarueda.com


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


Re: [Orgmode] Date tree view in org files created by remember.el

2010-01-01 Thread Juan Reyero
Hi,

On Fri, Jan 1, 2010 at 7:52 AM, Avinash Kulkarni avinas...@gmail.com wrote:
 I am trying to get the following template to build a date-tree view in my
 org files that I use with remember mode. But I never seem to be able to get
 it - I am on Emacs 23.1 built for Mac OSX.

 Here are my remember templates:

 (setq org-remember-templates
   '((Quick ToDo ?n * TODO %?\n  %^{Scheduled for:}T\n
 org-default-notes-file date-tree)
     (Journal ?j * %T %? ~/org/journal.org date-tree)
     (Timer ?t * %?\n ~/org/timer.org Timed Tasks)))

This looks very similar to mine, which works nicely in OS-X with emacs 23.1:

(setq org-remember-templates
  '((Jac ?c
 * %^{Title}  :blog:\n  :PROPERTIES:\n  :on: %T\n  :END:\n  %?\n  %x
 ~/cjr/jac/jac.org date-tree)
(Note ?n
 * %^{Title}\n  :PROPERTIES:\n  :on: %T\n  :END:\n  %?\n  %x
 nil date-tree)))

Did you remember to load it?

(require 'remember)
(org-remember-insinuate)

Best,

Juan
-- 
http://juanreyero.com/
http://unarueda.com


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


Re: [Orgmode] Date tree view in org files created by remember.el

2010-01-01 Thread Juan Reyero
Hi Avinash,

On Fri, Jan 1, 2010 at 6:43 PM, Avinash Kulkarni avinas...@gmail.com wrote:
 Hi Juan,
 Thank you for the reply. Yeah, I already had those 2 lines in my .emacs file
 - and your template setup looks just like mine. I am using the Emacs Cocoa
 build from www.emacsformacosx.com, and its dated 2009-07-30. Are you using
 the same build too?

Same.  But your problem is most likely with the version of org-mode,
not with emacs.  Do you have 6.33?  I actually keep rather close track
with git, but 6.33 is the minimum you'll need.

Best,

Juan

 On Fri, Jan 1, 2010 at 12:29 PM, Juan Reyero joa...@gmail.com wrote:

 Hi,

 On Fri, Jan 1, 2010 at 7:52 AM, Avinash Kulkarni avinas...@gmail.com
 wrote:
  I am trying to get the following template to build a date-tree view in
  my
  org files that I use with remember mode. But I never seem to be able to
  get
  it - I am on Emacs 23.1 built for Mac OSX.
 
  Here are my remember templates:
 
  (setq org-remember-templates
    '((Quick ToDo ?n * TODO %?\n  %^{Scheduled for:}T\n
  org-default-notes-file date-tree)
      (Journal ?j * %T %? ~/org/journal.org date-tree)
      (Timer ?t * %?\n ~/org/timer.org Timed Tasks)))

 This looks very similar to mine, which works nicely in OS-X with emacs
 23.1:

 (setq org-remember-templates
      '((Jac ?c
         * %^{Title}  :blog:\n  :PROPERTIES:\n  :on: %T\n  :END:\n  %?\n
  %x
         ~/cjr/jac/jac.org date-tree)
        (Note ?n
         * %^{Title}\n  :PROPERTIES:\n  :on: %T\n  :END:\n  %?\n  %x
         nil date-tree)))

 Did you remember to load it?

 (require 'remember)
 (org-remember-insinuate)

 Best,

 Juan
 --
 http://juanreyero.com/
 http://unarueda.com





-- 
http://juanreyero.com/
http://unarueda.com


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


Re: [Orgmode] Need help exporting subtrees to html

2009-12-31 Thread Juan Reyero
On Thu, Dec 31, 2009 at 9:15 AM, Carsten Dominik
carsten.domi...@gmail.com wrote:
 On Dec 27, 2009, at 8:31 PM, Juan Reyero wrote:
 On Sun, Dec 27, 2009 at 7:35 PM, Carsten Dominik
 carsten.domi...@gmail.com wrote:
 On Dec 27, 2009, at 5:34 PM, Juan Reyero wrote:
 I have written a function to export org-mode subtrees as jekyll posts,
 http://juanreyero.com/open/org-jekyll/  The idea is that any entry in
 an org-publish project that has a :blog: keyword and an :on: property
 with a timestamp should be exported to a _posts directory with the
 year-month-day-title.html that jekyll expects, with the properties as
 front-matter.

 I was very happy with it, until I realized that the levels of the
 headers in the exported file (h2, h3, etc) depend on the indentation
 of the subtree in the outline.  I wanted to be able to add a :blog:
 subtree anywhere in my project's files, and get it always exported the
 same, regardless of where in the outline it is.

 Is there any reasonably simple way to overcome this problem?  I am
 using:

 (org-narrow-to-subtree)
 (setq html (org-export-as-html nil nil nil 'string t nil))

 Hi Juan,

 Try this:

 (outline-mark-subtree)
 (setq html (org-export-as-html nil nil nil 'string t nil))

 Thanks for your answer.  I've tried it, but now it exports the whole
 buffer, as if (outline-mark-subtree) didn't understand which subtree I
 am looking at.  I am doing this from within an (org-map-entries).  If
 I first narrow and then mark it doesn't work either: it complains of
 Before first headline at position

 You are right, this does not work as I had hoped.  What needs to be
 done is that the tree must be selected, and the region needs to be *active*
 when the export command is called.  I am not quite sure right now
 how to do this in the middle of a Lisp program

Looks like it is not going to be a small investment.  For the time
being I'll stick to writing blog posts as first-level entries, and
I'll try to figure it out when I find some more time.  Thank you very
much for your answers.

Cheers,

Juan

 I have updated the tests at http://github.com/juanre/org-jekyll to
 reflect the problem.
-- 
http://juanreyero.com/
http://unarueda.com


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


Re: [Orgmode] Need help exporting subtrees to html

2009-12-31 Thread Juan Reyero
On Thu, Dec 31, 2009 at 6:15 PM, Eric Schulte schulte.e...@gmail.com wrote:
 Juan Reyero joa...@gmail.com writes:

 On Thu, Dec 31, 2009 at 9:15 AM, Carsten Dominik
 carsten.domi...@gmail.com wrote:
 On Dec 27, 2009, at 8:31 PM, Juan Reyero wrote:
 On Sun, Dec 27, 2009 at 7:35 PM, Carsten Dominik
 carsten.domi...@gmail.com wrote:
 On Dec 27, 2009, at 5:34 PM, Juan Reyero wrote:
 I have written a function to export org-mode subtrees as jekyll posts,
 http://juanreyero.com/open/org-jekyll/  The idea is that any entry in
 an org-publish project that has a :blog: keyword and an :on: property
 with a timestamp should be exported to a _posts directory with the
 year-month-day-title.html that jekyll expects, with the properties as
 front-matter.
 If it helps, I've been doing something similar to support publishing
 updates on the org-babel development -- using the code shown here [1]
 under the Development Updates section.  This generates a files in
 _posts for each subtree of of the tasks and bugs sections which have
 a time-stamp in their properties.  It should be fairly straightforward
 to adapt this code to export all properties as YAML frontmatter.

It is exactly what I did :-).  I found your code here [1], and adapted
it so that it would use files in an org-publish project and would
export properties.  So thank you very much for making it available.
It does, however, have the same problem I find: the header level with
which the piece is exported (h1, h2, etc) depends on the outline level
on which the item you export happened to be.  I was hoping to export
the chunks independently of where they were written.

I will share it with Worg as soon as I manage to make it work.

Best,

Juan

Footnotes:
[1] http://orgmode.org/worg/org-tutorials/org-jekyll.php (end of document).


 Best -- Eric

 Footnotes:
 [1]  http://eschulte.github.com/babel-dev/publish.html





-- 
http://juanreyero.com/
http://unarueda.com


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


[Orgmode] Need help exporting subtrees to html

2009-12-27 Thread Juan Reyero
Greetings,

I have written a function to export org-mode subtrees as jekyll posts,
http://juanreyero.com/open/org-jekyll/  The idea is that any entry in
an org-publish project that has a :blog: keyword and an :on: property
with a timestamp should be exported to a _posts directory with the
year-month-day-title.html that jekyll expects, with the properties as
front-matter.

I was very happy with it, until I realized that the levels of the
headers in the exported file (h2, h3, etc) depend on the indentation
of the subtree in the outline.  I wanted to be able to add a :blog:
subtree anywhere in my project's files, and get it always exported the
same, regardless of where in the outline it is.

Is there any reasonably simple way to overcome this problem?  I am using:

(org-narrow-to-subtree)
(setq html (org-export-as-html nil nil nil 'string t nil))

to do the exporting (all the code is in github,
http://github.com/juanre/org-jekyll).  In summary, what I need is an
org-export-as-html that treats the least indented outline as a
0-indentation.

Best,

Juan
-- 
http://juanreyero.com/
http://unarueda.com


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


Re: [Orgmode] Need help exporting subtrees to html

2009-12-27 Thread Juan Reyero
Hi Carsten,

On Sun, Dec 27, 2009 at 7:35 PM, Carsten Dominik
carsten.domi...@gmail.com wrote:
 On Dec 27, 2009, at 5:34 PM, Juan Reyero wrote:
 I have written a function to export org-mode subtrees as jekyll posts,
 http://juanreyero.com/open/org-jekyll/  The idea is that any entry in
 an org-publish project that has a :blog: keyword and an :on: property
 with a timestamp should be exported to a _posts directory with the
 year-month-day-title.html that jekyll expects, with the properties as
 front-matter.

 I was very happy with it, until I realized that the levels of the
 headers in the exported file (h2, h3, etc) depend on the indentation
 of the subtree in the outline.  I wanted to be able to add a :blog:
 subtree anywhere in my project's files, and get it always exported the
 same, regardless of where in the outline it is.

 Is there any reasonably simple way to overcome this problem?  I am using:

 (org-narrow-to-subtree)
 (setq html (org-export-as-html nil nil nil 'string t nil))

 Hi Juan,

 Try this:

 (outline-mark-subtree)
 (setq html (org-export-as-html nil nil nil 'string t nil))

Thanks for your answer.  I've tried it, but now it exports the whole
buffer, as if (outline-mark-subtree) didn't understand which subtree I
am looking at.  I am doing this from within an (org-map-entries).  If
I first narrow and then mark it doesn't work either: it complains of
Before first headline at position

I have updated the tests at http://github.com/juanre/org-jekyll to
reflect the problem.

Best,

Juan
-- 
http://juanreyero.com/
http://unarueda.com


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


Re: [Orgmode] Org-mode tricks for team management

2009-12-04 Thread Juan Reyero
On Fri, Dec 4, 2009 at 3:31 AM, Torsten Wagner torsten.wag...@gmail.com wrote:

 http://juanreyero.com/article/emacs/org-teams.html

 This solution is very nice. I would encourage you to pack it into an own
 contrib for org-mode. Maybe even trying to merge it into org-mode itself.

Thanks a lot.  I'd be happy to pack it into a contrib file, if Carsten
agrees.  Following your suggestion in a comment to the document it'd
be called org-secretary.

 Please also consider to check out how this could be worked together with org-
 mobile. As far as I understood you are going to have beside the normal agenda
 views a place and person sensitive agenda. This makes even more sens on mobile
 devices.

I actually tried it out as soon as org-mobile became available for the
iphone.  It almost worked, but not quite.  I could however check out
the tasks for everybody in the agenda view in the iphone, which was
nice.

 #+ dream-mode on
 All those smart-phones have GPS now. It would be incredible awesome if the GPS
 location could be used to define the place automatically :) Even send alarm
 messages... (This idea was discussed at the OpenMoko-Community (position-
 sensitive alarm)
 #+ dream-mode off

That'd be neat...

Best regards,

Juan
-- 
http://juanreyero.com/
http://unarueda.com


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


[Orgmode] Org-mode tricks for team management

2009-12-03 Thread Juan Reyero
Greetings,

I have been using org-mode as a key support for my work as a manager
for quite a while now.  I thought some of the tricks and processes for
keeping up-to-date with the work of each person in my team might be of
interest to other people, so I wrote them up at:

http://juanreyero.com/article/emacs/org-teams.html

In summary, it is a simple way to keep track of TODO items associated
to other people, query them, and add context to your notes (who is
with you, where your are, and the time).  The key idea is to ask emacs
to remember these things, and use the extra state to automate agenda
queries and quick tagging.

I am very grateful to Carsten and all the people contributing to
org-mode and this list.  It's made a great positive impact in my work.

Best,

Juan
---
http://juanreyero.com


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


[orgmode] Solutions of blogging tools for org-mode

2009-10-20 Thread Juan Reyero
Greetings,

I want to move my blogs from Wordpress to org-mode. I have found
blorg, org-blog and blorgit, but the first two look like they're not
being worked on (but maybe that's because they are finished), and the
third one seems to be much more than what I need, as it gives you a
web-based interface.  What I am looking for in a blogging engine is a
way to mark entries as belonging to the blog, and generation of an RSS
feed that includes them; all other things, including publishing and
HTML export, are already covered by standard org-mode facilities, and
services like disqus for the comments.

Is this functionality available?  Are people using org-mode to publish blogs?

Best,

jm
-- 
http://juanreyero.com/blog
http://juntoalcamino.com


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


Re: [orgmode] Solutions of blogging tools for org-mode

2009-10-20 Thread Juan Reyero
On Tue, Oct 20, 2009 at 12:23 PM, David Bremner brem...@unb.ca wrote:
 Juan Reyero wrote:

 I am looking for in a blogging engine is a
way to mark entries as belonging to the blog, and generation of an RSS
feed that includes them; all other things, including publishing and
HTML export, are already covered by standard org-mode facilities, and
services like disqus for the comments.

 Please check the recent archives of the list for a longer discussion;
 some of us use ikiwiki with a contributed org-mode plugin by Manoj
 Srivastava.

Ikiwiki and Manoj Srivastava's plugin do look great, but it's a pity
not to take advantage of org-mode's facilities for exporting and
publishing... which I've already set up and adapted to the design of
my webs.  My question was more on the lines of whether there's active
development of the org-mode blog modules, and if there's people using
them.  I am considering building a very minimalistic blog engine (tag
the entries you want as part of the blog, and it builds an RSS feed
for them; you figure out everything else within org-mode's publishing
functionality).  But I'd hate to do something that's already there.

jm


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


Re: [Orgmode] Buffer-wide definitions in org-babel

2009-10-09 Thread Juan Reyero
Hi Dan,

On Thu, Oct 8, 2009 at 4:11 PM, Dan Davison davi...@stats.ox.ac.uk wrote:
 Juan Reyero joa...@gmail.com writes:
 #+begin_src python :session :results output
  2
 #+end_src

 #+resname:
 : 2
 : 2

 (expected nothing, which is what I get if I remove the :session).

 An understandable expectation. In non-session mode, we collect stdout
 and if the expression 2 is passed to the interpreter nothing is output
 to stdout. However in session mode we collect whatever output appears in
 the comint buffer, and if you give the interpreter 2 the interpreter
 comes back and prints the value of that expression.

Ah, got it.  Thanks a lot.  It's kind of tricky to know what you are
going to get, however.  For example:

#+begin_src python :session :results output
str('10' + 'm/s')
'12'
#+end_src

#+resname:
: 10' + 'm/s')
: '10m/s
: 12'
: '12

I guess the answer to that would be to only use :results value when in
:session mode.

 ... However I can't replicate this
 behaviour under linux. I get

 #+resname:
 : 2

 for all three examples.

 I'm using org-version 6.31trans in emacs-version 23.0.91.1 under ubuntu
 jaunty with python 2.6.2. Is this definitely replicable under OSX?

Yes, definitely.  I am using emacs version 22.3.1, and python 2.6.1.
I have stripped bare my .emacs, and still:

#+begin_src python :session :results value
 2
#+end_src

#+resname:
: 0

jm
-- 
http://juanreyero.com/blog


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


Re: [Orgmode] Buffer-wide definitions in org-babel

2009-10-08 Thread Juan Reyero
Eric,

Thanks a lot for your quick response.  I have tried your suggestion
and it does work, but it behaves in an unexpected way when I do some
minor modifications.  Please see below.

On Wed, Oct 7, 2009 at 8:48 PM, Eric Schulte schulte.e...@gmail.com wrote:
 I am trying to define buffer-wide initializations in org-babel, so that I 
 can import a python module once
 and then use its exported symbols in all the code chunks throughout the 
 buffer.  Is there a way to do it?
  I have tried all the obvious approaches and none seems to work.  (My hope 
 was that I could define a
 :session and then use it in every chunk, but python doesn't like it).

 I believe you are on the right track by trying to use sessions.  The
 following works for me

 --8---cut here---start-8---
 ** persistent python
 #+begin_src python :session :results silent
  import types
 #+end_src

 #+begin_src python :session
  types.FunctionType
 #+end_src

 #+resname:
 : function
 --8---cut here---end---8---

This works, but see what happens with this (no previous src chunks):

#+begin_src python :session :results output
 2
#+end_src

#+resname:
: 2
: 2

(expected nothing, which is what I get if I remove the :session).

#+begin_src python :session :results value
 2
#+end_src

#+resname:
: 0

This is how my python buffer looks like after processing this last
chunk in a fresh session:

--8---cut here---start---8---
 import emacs; print '_emacs_out ()'
/Applications/Emacs.app/Contents/Resources/etc/emacs.py:24:
DeprecationWarning: the sets module is deprecated
  from sets import Set
2


_
'org_babel_python_eoe'
2
2


 _
2
 'org_babel_python_eoe'
'org_babel_python_eoe'

--8---cut here---end---8---

But, interestingly, if I return a string instead of a number, as you
do in your example, it works:

#+begin_src python :session :results value
 2
#+end_src

#+resname:
: 2

It is not related to a previous chunk messing up the python
interpreter.  I have moved to the git version, and it still behaves
like this.  I am using python 2.6.1.

 Of if you grab the latest version of Org-mode from the git repo you can
 set the session type in a headline property which would be more similar
 to the file-wide behavior that you described.

This is cool.  It would also be great if you could define a default
interpreter (I suspect most usage will involve a single interpreter
per buffer).

Thanks again!

jm
-- 
http://juanreyero.com/blog


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


Re: [Orgmode] Buffer-wide definitions in org-babel

2009-10-08 Thread Juan Reyero
Hi,

On Wed, Oct 7, 2009 at 9:17 PM, Eric Schulte schulte.e...@gmail.com wrote:
 As you described below the :session environment can be used to deal with
 the need for required stage setting source-code blocks, however there
 is currently no way when directly executing a block to specify that some
 other block in the same session must be evaluated first to setup the
 environment.

 Perhaps a new header argument named :requires would be useful here.
 This would allow any block to require that some other named
 source-code block be prepended to it's self before evaluation.

Sounds like a good solution.  Another possibility would be to add an
option that makes chunks dependent on other chunks that appear earlier
in the buffer.  It is less general, but possibly simpler to implement
(you don't have to worry about circular dependencies) and less
verbose.  If you could assume a functional style without side effects
you could even track which chunks are up-to-date, and only re-compute
from the first one not up-to-date in the buffer onwards to the chunk
you are being asked to process.  This could be yet another option.

Best,

jm
-- 
http://juanreyero.com/blog


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


[Orgmode] Buffer-wide definitions in org-babel

2009-10-07 Thread Juan Reyero
Greetings,
I am trying to define buffer-wide initializations in org-babel, so that I
can import a python module once and then use its exported symbols in all the
code chunks throughout the buffer.  Is there a way to do it?  I have tried
all the obvious approaches and none seems to work.  (My hope was that I
could define a :session and then use it in every chunk, but python doesn't
like it).

I just found out about org-babel, and I am delighted by its promise.
 Org-mode has changed the way I work (after a year and a half I could not
live without it) but now I think this is going to be another bit step.

Many thanks,

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