renard / o-blog

Standalone orgmode blog exporter. DEPECATED, NOT MAINTAINED
http://renard.github.com/o-blog-v2
260 stars 58 forks source link

DATE timestamp issues #32

Closed ghost closed 12 years ago

ghost commented 12 years ago

Timestamps using ob:get-header "DATE" were working, but now produce Lisp error in nil: (wrong-type-argument integerp nil) as of the most recent commits.

renard commented 12 years ago

(ob:get-header "DATE") will retrieve the document's #+DATE: header which maybe not what you need.

If you want to retrieve the post's date, you might want to (ob:format-date (ob:post-timestamp POST) (ob:gettext :post-timestamp)) or something similar.

the timestamp slot in ob:post is a emacs internal encoded time (see encode-time).

ghost commented 12 years ago

Thank you, but I must apologize for not being clear enough. I do want the blog date using (ob:get-header "DATE"). This was working a few days ago, but is no longer working. You can see an example of this problem by visiting your own RSS feed at http://renard.github.com/o-blog/index.xml, which gives the same error "Lisp error in nil: (wrong-type-argument integerp nil)" I am getting. Just to reiterate, the post dates work just fine, but (ob:get-header "DATE") returns the integerp error, and since I see the error on the o-blog example site, I know it must not be a local change of mine that is causing the problem.

renard commented 12 years ago

This had been fixed.

For some reason the #+DATE: (the last file modification) was removed.

ghost commented 12 years ago

Thanks. Yes, that was it. For some silly reason, I thought it was being auto-generated at the time of publishing the blog.

renard commented 12 years ago

Nope this is generated when saving the file.

I got something like that in my emacs configuration:

(add-hook 'before-save-hook 'time-stamp)
(make-variable-buffer-local 'time-stamp-start)
(add-hook 'org-mode-hook (lambda () (setq time-stamp-start "^#\\+DATE: ")))

Check at https://github.com/renard/emacs-el/blob/master/cw/cw-local.el

ghost commented 12 years ago

Thank you for the suggestion!