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  wrote:
>
> Nathan Neff  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) ;  >     (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


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

2010-06-30 Thread Sebastian Rose
Nathan Neff  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) ;  (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


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

2010-06-30 Thread Nathan Neff
On Wed, Jun 30, 2010 at 6:45 AM, Sebastian Rose  wrote:
> Nathan Neff  writes:
>> Some time ago, I set up a blog using org-jekyll.  I recently tried
>> to publish my blog, but when I run:
>>
>> org-jekyll-export-blog
>>
>> I get the message:  Symbol's function definition is void:
>> org-publish-initialize-files-alist
>>
>> I grepped for this function, and noticed that it is now defined in
>> org-protocol.el
>> using (declare-function org-publish-initilialize-files-alist "org-publish"),
>> whereas before, the function was declared in org-publish.el
>>
>> Can anyone help with this problem?
>>
>> I tried putting this in my emacs, but it didn't work:
>> (require 'org-protocol.el)
>> (require 'org-publish)
>> (require 'org-jekyll)
>>
>> Thanks,
>> --Nate
>
>
> Nathan,
>
> I cannot find a file named org-jekyll.el or similar.
>
> But I guess `org-publish-initialize-files-alist' is just called to find
> a project the current files belongs to.
> If that is the case, you simply remove the call to that function and use
>
>  (let ((project
>         (org-publish-get-project-from-filename buffer-file-name)))
>   
>
>
> If you encounter any problems, I'll be glad to help.
>
>
>
>   Sebastian
>

Thanks for your replies -- I don't know too much about the inner workings of
org-jekyll, so I might forward this to the author.  In the meantine,
if anyone wants to take a poke at this, I would appreciate it.  I can
always revert to a prior version of org when I want to publish, so I'm
not being held back.

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) ; 

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

2010-06-30 Thread Sebastian Rose
Nathan Neff  writes:
> Some time ago, I set up a blog using org-jekyll.  I recently tried
> to publish my blog, but when I run:
>
> org-jekyll-export-blog
>
> I get the message:  Symbol's function definition is void:
> org-publish-initialize-files-alist
>
> I grepped for this function, and noticed that it is now defined in
> org-protocol.el
> using (declare-function org-publish-initilialize-files-alist "org-publish"),
> whereas before, the function was declared in org-publish.el
>
> Can anyone help with this problem?
>
> I tried putting this in my emacs, but it didn't work:
> (require 'org-protocol.el)
> (require 'org-publish)
> (require 'org-jekyll)
>
> Thanks,
> --Nate


Nathan,

I cannot find a file named org-jekyll.el or similar.

But I guess `org-publish-initialize-files-alist' is just called to find
a project the current files belongs to.
If that is the case, you simply remove the call to that function and use

  (let ((project
 (org-publish-get-project-from-filename buffer-file-name)))
   


If you encounter any problems, I'll be glad to help.



   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


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

2010-06-30 Thread Sebastian Rose
Nathan Neff  writes:
> Some time ago, I set up a blog using org-jekyll.  I recently tried
> to publish my blog, but when I run:
>
> org-jekyll-export-blog
>
> I get the message:  Symbol's function definition is void:
> org-publish-initialize-files-alist
>
> I grepped for this function, and noticed that it is now defined in
> org-protocol.el
> using (declare-function org-publish-initilialize-files-alist "org-publish"),
> whereas before, the function was declared in org-publish.el
>
> Can anyone help with this problem?
>
> I tried putting this in my emacs, but it didn't work:
> (require 'org-protocol.el)
> (require 'org-publish)
> (require 'org-jekyll)



Hi Nathan,


glad you pointed out this one.

No, that function does not exist anymore!

It is still declared in org-protocol.el but that's obsolete.  I'll have
to remove that from org-protocol.el.


The list of files in a project is now stored as elisp code in cache
files. You can find all the functions in questions by either searching
`(defun org-publish-cache' in org-publish.el, or simply doing

C-h f org-publish-cache TAB TAB





Best wishes

  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


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

2010-06-29 Thread Nick Dokos
Puneeth  wrote:

> Hi,
> 
> On Wed, Jun 30, 2010 at 4:15 AM, Nathan Neff  wrote:
> [..]
> > I tried putting this in my emacs, but it didn't work:
> > (require 'org-protocol.el)
> > (require 'org-publish)
> > (require 'org-jekyll)
> 
> I haven't used Jekyll, but should it be just org-protocol and not
> org-protocol.el?
> (require 'org-protocol)
> 

That's true: the first argument of `require' should be the symbol that
is `provide'-ed by the load file. E.g. org-protocol.el ends with

,
| ...
| (provide 'org-protocol)
`

so the `require' form should indeed be 

 (require 'org-protocol)

- and there is an additional convention that the filename should then be
the printname of the `provide'-ed symbol, with ".el" appended:
org-protocol.el in this case (but the convention can be overridden - see
the documentation of `require' for details).

The function that Nathan was asking about was originally defined in
org-publish.el which does

,
| ...
| 
| (provide 'org-publish)
`

so normally, doing

   (require 'org-publish)

would be enough to load the file and therefore define the function.
However, nothing is going to help in this case, because the function,
even though it is declared and used in org-protocol.el, was deleted from
org-publish.el with this commit:

,
| commit 339d6fe4bbf7b9858c6323d01f32d0c73a4cd3a8
| Author: Sebastian Rose 
| Date:   Thu May 13 13:43:53 2010 +0200
| 
| Publishing, cashing and timestamps
| 
| Carsten Dominik  writes:
| > Hi Sebastian,
| >
| > sorry for being slow.  Could you do me a favor and send me the cache 
patch one
| > more time - if possible updated to the current master.
| >
| > I am just not sure I have the right patch in my hands.
| 
| Hi Carsten,
| 
| no problem. The patch is attached.
| 
| Here is a list of my ChangeLog entries, redated to today:
| 
| 2010-05-13  Sebastian Rose  
| 
|   * org-publish.el (org-publish-cache): Use one big hashmap for
|   each project defined in `org-publish-project-alist'. The
|   hashmap will hold pairs of our timestamp-filenames and
|   timestamps, as well as pairs of source-paths and associated
|   plists for arbitrary values. Currently only the files title is
|   stored there.
| 
|   The caching feature writes the information gathered during
|   publishing to disk and re-loads it from there the next time we
|   publish the same project.  All those informations will hence
|   survive a restart of emacs.
| 
|   One cache file per publishing project is used. The contents of
|   that file is the elisp that fills the new variable
|   `org-publish-cache'.  The cache file is named according to the
|   project with `.cache' added and lives in
|   `org-timestamp-directory'.
| 
|   * org-publish.el (initialize-files-alist): This function and
|   the variable `org-publish-files-alist' are not used anymore in
|   favour of the reloadable cache and the functions for handling
|   it. Removed therefor.
|  
| ...
| 
`

(hence the cc: to Sebastian). Either the function will have to be put
back, or the calls to the function in org-protocol.el will have to be
replaced by something else.

Nick

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


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

2010-06-29 Thread Puneeth
Hi,

On Wed, Jun 30, 2010 at 4:15 AM, Nathan Neff  wrote:
[..]
> I tried putting this in my emacs, but it didn't work:
> (require 'org-protocol.el)
> (require 'org-publish)
> (require 'org-jekyll)

I haven't used Jekyll, but should it be just org-protocol and not
org-protocol.el?
(require 'org-protocol)

Thanks
Puneeth

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


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

2010-06-29 Thread Nathan Neff
Some time ago, I set up a blog using org-jekyll.  I recently tried
to publish my blog, but when I run:

org-jekyll-export-blog

I get the message:  Symbol's function definition is void:
org-publish-initialize-files-alist

I grepped for this function, and noticed that it is now defined in
org-protocol.el
using (declare-function org-publish-initilialize-files-alist "org-publish"),
whereas before, the function was declared in org-publish.el

Can anyone help with this problem?

I tried putting this in my emacs, but it didn't work:
(require 'org-protocol.el)
(require 'org-publish)
(require 'org-jekyll)

Thanks,
--Nate

___
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